InterviewStack.io LogoInterviewStack.io

Performance Engineering and Cost Optimization Questions

Engineering practices and trade offs for meeting performance objectives while controlling operational cost. Topics include setting latency and throughput targets and latency budgets; benchmarking profiling and tuning across application database and infrastructure layers; memory compute serialization and batching optimizations; asynchronous processing and workload shaping; capacity estimation and right sizing for compute and storage to reduce cost; understanding cost drivers in cloud environments including network egress and storage tiering; trade offs between real time and batch processing; and monitoring to detect and prevent performance regressions. Candidates should describe measurement driven approaches to optimization and be able to justify trade offs between cost complexity and user experience.

MediumTechnical
57 practiced
Estimate monthly cost for an image-classification inference service given: steady average 500 RPS, average request upload 50KB, response 10KB, 30% of traffic egresses to EU from us-east-1, GPU instances cost $2.5/hr and provide 100 RPS at 70% utilization, model storage is 200GB at $0.02/GB-month. Break down compute, egress, and storage costs monthly and propose a plan to reduce total cost by ~30% with concrete levers.
HardTechnical
58 practiced
During an A/B experiment, variant B shows 2x p99 latency compared to control. Outline a thorough root-cause analysis plan spanning code, model, infrastructure, and data. Include steps to collect evidence (traces, logs, flame graphs), run targeted canary rollbacks or shadowing, compare request characteristics between variants, and what instrumentation you'd add to isolate the issue.
HardSystem Design
47 practiced
You operate distributed data-parallel training on 128 GPUs but observe significant GPU idle time due to input pipeline and synchronization overhead. Propose a set of solutions to increase utilization and lower cost: gradient accumulation, mixed precision, overlapping compute and communication, larger micro-batches, optimized collective communication (NCCL tuning), and data-local scheduling. Explain trade-offs and measurement methods to validate improvements.
MediumTechnical
90 practiced
Scenario: your organization stores many large daily dataset snapshots and model artifacts, causing monthly storage costs to balloon. Propose an automated storage tiering policy using rules based on age, access frequency, size, and project importance. Outline the migration tools or cloud lifecycle policies you would use, monitoring you would add, and guardrails to ensure reproducibility for experiments.
HardTechnical
48 practiced
Implement (in Python) a function that estimates cost-per-request for inference given: model_flops_per_inference, instance_flops (FLOPS per second), instance_hourly_price, expected_gpu_utilization (0-1), network_bytes_per_request, egress_price_per_gb, and target_requests_per_second. The function should return dollars per request and recommended instance count to meet the target_requests_per_second at a utilization cap (e.g., 70%). Show your calculations and assumptions in comments.

Unlock Full Question Bank

Get access to hundreds of Performance Engineering and Cost Optimization interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.