Skip to content

ONE QUESTION. YOUR REASONING.

Design peer-to-peer file distribution

Design a way to copy one very large file, such as a model’s weights, from one machine to thousands of others as fast as the network allows.

System designInfrastructure and platformSeniorStaff

YOUR BRIEF

What to work through

Work through peer-to-peer file distribution as a spoken system design interview. Start by clarifying the scope, sketch a working design and explain the trade-offs behind your choices.

  • Publish a new version of a large file for a set of target machines
  • Every target ends up with a complete copy, checked against hashes
  • Targets fetch pieces from each other, not only from the source
  • A target that crashes or joins late catches up without starting over
  • Report progress, and switch each target to the new version once it holds all of it

BEFORE YOU START

Constraints to discuss

  • Finish close to the lower bound the links allow
  • Stay under each machine’s link cap, shared between sending and receiving, and leave room for live traffic
  • No piece is used or forwarded before its hash checks out
  • No single coordinator on the data path
  • Scale to thousands of hosts: Uber’s Kraken runs at least 8,000 per cluster
Need a starting point?

Watch for these common gaps as you prepare:

  • Every host downloading from one central store
  • No hash per piece, so one corrupted piece spreads through the swarm
  • Putting the tracker on the data path
  • Ignoring that a machine’s upload and download share one link
  • Activating a host before it holds the whole checked file
Read: System design questions and who asks them

Why this question is in the collection

These sources connect the problem to company interview reports or preparation guides. They do not guarantee what a company will ask you.

KEEP GOING

Your next question

Storage, files and linksDesign BitlyInfrastructure and platformDesign a rate limiterInfrastructure and platformDesign an A/B testing platformInfrastructure and platformDesign an ad click aggregator
Browse the collection
01

Pick a question

Read the brief and choose what you want to work on.

02

Talk it through

Explain your thinking. Respond to follow-ups. Draw when a design needs it.

03

Find your next improvement

Use the feedback from your interview to decide what to practise next.