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
61 practiced
Given this PostgreSQL query against a table 'events(user_id, type, created_at, payload'):
SELECT user_id, count(*) FROM events WHERE type = 'purchase' AND created_at >= now() - interval '30 days' GROUP BY user_id HAVING count(*) > 5;
Explain concrete optimization steps for large datasets (tens of millions of rows): indexes (partial/covering), partitioning strategy, materialized views, and rewrite alternatives. Discuss trade-offs in write cost, storage, and freshness.
HardTechnical
51 practiced
Given requirements: (1) deliver real-time fraud alerts within 2 seconds, (2) compute large-scale metrics and billing daily, and (3) keep operational cost minimal, design a hybrid processing pipeline. Discuss streaming vs batch components, windowing semantics, state stores, checkpointing, pre-aggregation strategies, and how to share derived state between real-time and batch jobs to reduce duplication and cost.
HardTechnical
43 practiced
You have a backlog of performance optimizations with estimated engineering effort, expected monthly cost savings, and risk levels. Describe a prioritization framework to decide which optimizations to implement this quarter. Include how to compute ROI and confidence intervals, how to weight business impact versus operational risk, and how to measure and report realized savings after deployment.
HardTechnical
43 practiced
For a high-throughput Java backend experiencing long GC pause times that hurt p99 latency, propose a JVM and GC tuning plan. Discuss different collectors (G1, ZGC, Shenandoah), heap sizing approaches, region sizing, G1 ergonomics, escape analysis, and the trade-offs between lower pause times and reduced throughput or increased memory footprint.
EasyTechnical
53 practiced
Describe a measurement-driven method to set latency budgets and SLOs for a backend API used by a mobile app. Outline steps to collect baseline metrics, segment users by region/device, map SLOs to business metrics (e.g., conversion), choose percentile targets (p50/p95/p99), and set error budgets and escalation policies.

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.