Fundamentals · Beginner

URL shortener (first try)

One database behind a cache. Runs out of database capacity at 50k rps.

Asked in interviews at

  • paypal
  • amazon
  • microsoft
  • openai
  • jpmorgan
  • netflix
  • nielsen
  • salesforce

Concepts used here

  • Caching: Keep recent answers in memory so the database only does each piece of work once. Then deal with the three ways that goes wrong: stale data, a full cache, and a stampede.
  • Network layers: Build a real packet by hand: 42 bytes of HTTP inside three envelopes, and which boxes on the way open which one.

Learn more

All system design examples