← Questions

Debug performance problems in a distributed system

0
MicrosoftSystem designLast asked Dec 2025

A system design interview question asked in Microsoft's HackerRank assessment, last asked Dec 2025. It tests performance, debugging and distributed systems.

A distributed service has regressed: latency is up, or throughput is down. Walk through, step by step, how you would find the cause and fix it.

Requirements

  • Functional: a practical method that covers the first signals you check, how you narrow down where the time goes (client, network, services, storage), how you test a hypothesis safely in production, and how you stop the problem from returning.
  • Non-functional: the service stays up for users while you investigate; changes are reversible.

Clarifying questions

  • Is it latency, throughput, errors, or several? For all requests or some endpoints, tenants or regions?
  • When did it start, and what changed then (deploys, config, traffic, dependencies)?
  • What observability exists: metrics, distributed tracing, logs, profiles?
  • Is it getting worse, and how many users are affected?

What a strong answer covers

  • Starting with impact and timing: percentiles (p50, p99) rather than averages, the start time matched against deploys and config changes, a rollback if one lines up.
  • A top-down method: the golden signals per service (latency, traffic, errors, saturation), then traces to find which hop holds the extra time.
  • Common causes and how each shows up: hot partitions or keys, lock contention, retry storms and timeouts, garbage collection pauses, connection pool exhaustion, slow queries and missing indexes, noisy neighbours, network loss.
  • Confirming a hypothesis: profile one instance, reproduce in staging, or test a fix with a canary or a feature flag on a small share of traffic.
  • Prevention: alerts on the regressed metric, latency budgets per hop, load tests in CI, and a written post-incident review.

Follow-ups

  • p50 is unchanged but p99 doubled. Where do you look first?
  • Traces show the time is in a database call that is fast when run by hand. What next?
  • How do you tell a capacity problem from a code regression?

Where it's asked

What it tests

performance · debugging · distributed systems

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing