InterviewLegend

Design a Metrics Aggregation Service

Frequently asked
Alex Chen45 min readAdded 37 real interview reports

A metrics aggregation service counts events for a whole engineering org. Every service reports small increments, like one more request to /v1/charges that returned 200, and the service turns millions of them a second into totals per time bucket. Engineers read those totals on dashboards. Alert rules watch them and page someone when the error count climbs. Each piece is simple on its own. Volume and correctness make it hard. Tens of millions of increments arrive every second from thousands of hosts, some of them twice and some of them minutes late, and the totals still have to be right enough to page on. Labels add to it, because every new label value creates a new series to store.

The Stripe angle
Candidates have reported this design at Stripe for years, under several names: a metrics counter with rollups, a count-metrics platform with alerts and replay, an analytics or ads aggregator, an APM system. Open with correctness. A lost or doubled count costs little on a dashboard and a lot on anything that bills a customer.

StripePremium lesson · System design round

The Stripe design, worked end to end.

  1. The API and data modelSystem design · Frequently asked
  2. The design, drawn out1 diagram
  3. 6 deep divesWith the tradeoffs
Get the Stripe questions

$49 a year · all 107 companies · instant access

20,000+ candidate reports · guide updated

Stripe interview guide

Know what Stripe asks before you walk in.

21 coding · 6 system design · 31 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

Had your Stripe interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.