System Design Framework

Mindset

  • The design is less important than the actual collaboration works

    • As no one expect you to design a real-world system within 1 hour
  • Let the interviewer knows what you're thinking, communicate with your interviewer

    • Don't think in silence
  • Some of the skills that you need to demonstate

    • Design skill
    • Defend your design choice
    • Respond to feedback in a constructive manner
  • If get stuck, dont hesitate to ask for hints

  • What the interviewer looking for

    • Ability to
      • Collaborate
      • Work under pressure
      • resolve ambiguity constructively
      • ability to ask good questions
    • Red flags
      • over-engineering
        • High cost
      • narrow mindedness
      • stubborness

Step 1. Establish a design scope (3-10 minutes)

  • Do not jump to a conclusion too early - huge red flags ^980869
  • Ask the right questions.
    • What's the feature?
    • How many users?
    • How fast do we want to scale up (3 months, 6 months or a year)
    • What exisiting services i can use to leverage the design
  • Make proper assumptions
    • If making assumptions, write down in the piece of paper so that you remember later
  • Gather the information
    • Understand the requirements
    • Clarify ambiguities
  • Do back-of-envelope calculation

Step 2. Propose a high-level design, get feedback (10-25 minutes)

Note: treat your interviewer as a co-worker during the process

  • Come up with initial design, get some feedbacks
  • Draw simple diagrams
  • Suggest multiple solutions if possible
  • Go through some concret use cases to detect edge cases
    • Ask if the interviewer needs API endpoints and database schema definition

Step 3. Design details (10-25 minutes)

Make sure before doing this step, you have:

  • Agreed on the overall goals and feature scope from step 2
  • Sketched out the high level design
  • Obtained the feedback from the high level design
    • Had some ideas on which areas to focus on based on the feedback

For this one, you have to

  • Extend from the above design, for example in step 2 you have Fanout Service. in this step you can go into detail of that service

Step 4. Wrap up (3-5 minutes)

  • Never say it's perfect and nothing can be improved
    • Always say there is always something to improve upon
  • Give a recap of your design
  • Error cases (server failure, network lost)
  • How to handle next scale, what if you have to handle 10 million users
  • Propose refinement if have time