KatInterview

Define and optimize performance for a high-traffic microservice

System DesignModel answer
HardModel answerSystem Designperformanceobservabilityload-testing

Last updated

Design SLIs/SLOs, instrument a service, plan load tests, identify bottlenecks, and propose optimizations with trade-offs for a stateless HTTP API.

You're working on a stateless HTTP microservice that handles high request volumes. Walk through your approach to measuring and improving its performance.

Your response should cover:

  1. SLIs and SLOs: Which service-level indicators would you track, and what objectives would you set? How do you choose meaningful targets?

  2. Instrumentation and profiling: What telemetry would you collect, and which profiling techniques would you use to understand where time is spent?

  3. Load testing strategy: How would you design load tests to validate performance? What scenarios matter most?

  4. Bottleneck identification: What are the most common performance bottlenecks in HTTP services, and how do you diagnose each one?

  5. Optimization approach: Propose specific improvements with their trade-offs. How do you prioritize which changes to make?

Assume a concrete example to ground your answer—such as a read-heavy API serving user data or content metadata—and explain your reasoning with numbers where relevant.

Hints

Hint 1

Use percentiles rather than averages for latency—tail latency matters under fan-out

Hint 2

Distinguish between open-loop and closed-loop load testing to avoid coordinated omission

Hint 3

Profile both on-CPU and off-CPU time; waiting on locks or I/O often dominates actual computation