InterviewStack.io LogoInterviewStack.io

Performance Under Resource Constraints Questions

Optimizing in environments with hard limits on compute, memory, battery, or bandwidth. Covers mobile and embedded performance, energy and power efficiency, working within tight memory and CPU envelopes, and platform-specific optimization and constraints. Emphasizes the trade-offs unique to constrained targets rather than server-class assumptions.

EasyTechnical
50 practiced

Explain how model serialization formats (pickle, TorchScript, ONNX) affect cold-start time, portability, and runtime optimization opportunities for a model deployed in a microservice. Include practical trade-offs when choosing a format for production.

EasyTechnical
28 practiced

Define graceful degradation for ML systems. Provide three practical strategies to implement graceful degradation in a low-latency online recommendation service when the model becomes slow or unavailable.

HardTechnical
27 practiced

You observe that network serialization/deserialization dominates inference latency when using gRPC for model serving. Propose optimizations at protocol, serialization, and system levels to reduce latency, and quantify expected gains and risks for each optimization.

MediumTechnical
32 practiced

Implement a Python function that performs batched inference on variable-length text inputs. The function should group similar-length inputs to minimize padding (bucketing) and return predictions in the original input order. You may assume a provided predict(batch_inputs) function.

HardTechnical
32 practiced

Derive an approximate formula for peak memory usage during forward and backward passes of a feedforward neural network given layer activation sizes and batch size. Then explain how activation checkpointing (recomputation) changes that formula and quantify the memory vs compute trade-off qualitatively.

Unlock Full Question Bank

Get access to all Performance Under Resource Constraints interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.