KatInterview

Diagnosing Performance Bottlenecks and Planning Infrastructure Scale

System DesignModel answer
MediumModel answerSystem Designcapacity-planningperformanceinfrastructure

Last updated

Debug a backend service that degrades under load, then calculate the infrastructure needed to support given traffic assumptions.

Context

You're responsible for a backend API service that has started exhibiting performance problems. When incoming traffic increases, response times degrade significantly and some requests time out completely.

Part 1: Performance Investigation and Remediation

Your service is experiencing latency spikes and timeouts during periods of elevated traffic. Walk through your approach to:

  • Identify the root cause of the performance degradation
  • Implement short-term fixes to stabilize the service immediately
  • Design long-term improvements to prevent recurrence

You have full access to modify both the application code and the underlying infrastructure. Consider both reactive responses and proactive architectural changes.

Part 2: Infrastructure Sizing

Given a set of traffic and workload parameters, explain how you would calculate the required infrastructure capacity. Your answer should cover:

  • What information you need (traffic patterns, performance requirements, resource consumption per operation, etc.)
  • How to translate those inputs into concrete numbers for compute instances, database resources, storage, and network capacity
  • A concrete worked example showing the calculations

Demonstrate that you can move from abstract requirements to quantified resource allocations.

Hints

Hint 1

Start with observability: metrics and traces will reveal where time is actually spent

Hint 2

Remember that systems don't degrade linearly—there's often a sharp cliff as resources saturate

Hint 3

Use Little's Law (concurrency = throughput × latency) to size pools and buffers