Latency Analysis & Optimization Questions
Understanding and reducing response time across the request path: where latency accumulates (compute, I/O, serialization, network hops, queuing), percentile-based reasoning (p50/p95/p99/p999), tail-latency behavior (why the tail diverges from the median, fan-out amplification across dependencies, hedged/speculative requests and other targeted mitigations), latency budgets and SLOs, and critical-path or distributed-trace span analysis that pinpoints where a request's wall-clock time actually goes. Focuses on end-to-end latency as a measured, engineered property rather than an incidental one. This is distinct from profiling a codebase to find CPU or memory hotspots with flame graphs, sampling, or instrumentation tooling (that is performance-optimization-and-bottleneck-analysis), and distinct from the reactive process of triaging, mitigating, and running the postmortem for a live production incident (that is performance-optimization-and-incident-response).
Explain how Garbage Collection (GC) pauses can cause latency spikes in a JVM-based service. What metrics or JVM flags would you check first to identify GC-related latency, and list two immediate mitigations plus one long-term architectural change to reduce GC impact on tail latency.
You observe only tail latency (p99) rising, while average CPU and memory metrics across hosts are unchanged. Application logs show an increase in request retries. Describe a diagnostic approach to confirm retry amplification and outline three immediate and two long-term mitigations.
You are defining SLOs for an HTTP JSON API used by a billing product. Describe how you would pick SLO targets and error budgets, which latency and availability metrics to use, and how to translate business impact (e.g., lost revenue, customer churn) into SLO thresholds. Explain how error budgets should influence release cadence and incident response playbooks.
Explain why averages can be misleading for latency-sensitive services and why tail percentiles (p95/p99/p999) matter. Provide concrete examples where optimizing average latency could degrade user experience and outline approaches focused specifically on reducing tail latency.
A multi-tenant JVM host shows one tenant's workload causing CPU spikes that degrade latency for every other tenant on the box. Walk through how you would detect which tenant is responsible, what you would do immediately to restore fairness, and how you would redesign the hosting model so this doesn't keep happening.
Unlock Full Question Bank
Get access to all 26 Latency Analysis & Optimization interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.