~learn.
❯ design of the week · one open problem a week

Design of the week.

Every Monday a new system design problem. Write your design in markdown with Mermaid diagrams, then vote on everyone else's. The best ones are featured here and on the author's profile.

Voting openMon, 19 Oct, 09:00 IST → Mon, 26 Oct, 09:00 IST

Short codes for 10 billion links, redirects in single-digit milliseconds, and a marketing campaign that turns one link into a hot key.

voting closes in
designs submitted0
votes per learner3
Read the designs, vote for up to 3. You can't vote for your own, and you can move a vote until voting closes.
Counts stay hidden until voting closes, and the order is shuffled for you.
No designs were submitted for this one.
the brief

A messaging app wants its own link shortener. Every link shared in chats goes through it, so the read side dwarfs the write side, and a single viral link can take a large share of all traffic for an hour.

You own the service end to end: code generation, storage, redirects and click analytics.

The traffic#

  • 10 billion links stored over five years; 40 million new links a day at launch.
  • Redirects: 200,000 a second on a normal evening, peaking at 1.2 million a second during a festival sale.
  • One campaign link once took 8% of all redirects for 40 minutes.
  • Click counts per link must be visible to the link owner within a minute.

The hard parts#

  • Short codes that never collide, without a single counter becoming the bottleneck.
  • Partitioning 10B rows so a redirect is one lookup, and so growth doesn't mean a painful reshard.
  • A hot key that would melt one shard and one cache node.
  • Counting clicks without putting a write on the redirect path.

What to submit#

Write it like the whiteboard half of an interview, in markdown:

  1. Requirements you'd confirm first (functional and non-functional), and what you'd leave out.
  2. Estimates: the back-of-the-envelope numbers that drive the design (QPS, storage, bandwidth).
  3. API and data model: the few calls and tables/keys that matter.
  4. High-level design as at least one Mermaid diagram.
  5. Deep dives on the two hardest parts, with the failure modes and how you contain them.
  6. Trade-offs: what you chose, what you gave up, and what would make you change your mind.

Keep it under ~2,500 words. Diagrams beat paragraphs.

How it works

  1. 01 · Monday 09:00 ISTA new problem opens. Read the brief, the constraints and what a strong answer shows.
  2. 02 · Until Saturday 09:00Write your design: markdown + Mermaid, autosaved. Designs stay private while you write.
  3. 03 · Saturday → MondayThe gallery opens. Vote for up to three designs (not your own). Counts stay hidden.
  4. 04 · MondayWinners are featured here, on the course hub and on their profile, with a badge and XP.