InterviewStack.io LogoInterviewStack.io

Performance Trade-offs & Optimization Strategy Questions

Deciding what to optimize, how far, and at what cost to other qualities. Covers performance vs readability/reliability/cost trade-offs, prioritizing the optimization with the highest payoff, knowing when a system is fast enough, and sequencing optimization work. Emphasizes optimization as a strategic engineering judgment rather than a reflex.

HardTechnical
58 practiced
Implement in Python (asyncio) a BatchScheduler with the API: BatchScheduler(batch_size: int, max_wait_ms: int, worker_fn: Callable[[List[Any]], Awaitable[List[Any]]]). Method submit(payload, priority=0) -> Awaitable[result]. The scheduler should flush a batch when batch_size is met or when the oldest item reaches max_wait_ms. If a higher-priority request arrives, it should allow early preemption of low-priority items (flush sooner) to meet SLAs. Provide a concurrency-safe implementation, explain starvation avoidance, and show how exceptions from worker_fn propagate to callers.
EasyTechnical
55 practiced
What is model warmup and why does it matter for latency-critical serving? Describe practical warmup strategies for CPU and GPU models (for example: synthetic requests to load kernels, preloading weights into memory, triggering JIT compilation) and discuss the operational costs and trade-offs of keeping warm instances vs on-demand cold starts.
HardTechnical
69 practiced
Design an experiment to quantify the cost-versus-accuracy trade-offs introduced by various quantization and pruning configurations for a production model. Specify experiment design (datasets, sample sizes), metrics (inference latency, memory, throughput, accuracy metrics), statistical tests to compare variants, and how you would present a Pareto frontier to stakeholders to guide decisions.
MediumSystem Design
74 practiced
Design an observability plan for model-serving that includes real-time latency dashboards, error budgets, data-drift detectors, resource-level metrics (GPU/CPU/memory), and automated mitigation actions (scale-out, degrade to baseline model). Which signals should trigger automated mitigation versus human alerts, and why?
HardTechnical
73 practiced
You must replicate large model checkpoints across data centers for warm standby. Propose a checkpoint transfer and compression strategy that balances network cost and restore latency. Cover options: chunked streaming, delta-compression between checkpoints, quantized or sparse checkpoints, resumable transfers, and integrity verification. Explain trade-offs in restore time and storage overhead.

Unlock Full Question Bank

Get access to hundreds of Performance Trade-offs & Optimization Strategy interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.