George Thomas

An approach for system design interviews

What is a system design interview? 🤔

Tech companies sometimes ask for system design interviews. These assess a few different areas, including:

Why do I need a structured approach? 🤷🏻‍♂️

Unlike coding interviews, system design interviews benefit much more from a structured approach. A structured approach will ensure:

A structured approach for system design interviews 🗼

Here’s a high-level approach. I’ll go into each area separately:

  1. Analyse requirements
  2. Approximate quantitatively
  3. Design data stores
  4. Produce high-level architecture
  5. Dive-deep into problem specifics
  6. Consider tradeoffs
  7. Map back to the original requirements

1. Analyse requirements ✍🏼

A system design question might be something like “design WhatsApp” or “design YouTube” or “design bicycle hire”. It is impossible to cover all the features of those systems in the 40~60 minutes you’ll have.

Instead, spend some time precisely defining the scope of your solution. Think about the core user stories when interacting with the app.

QuestionRequirements
“Design YouTube”
  • Upload videos
  • Watch video
  • Browse videos
“Design bicycle hire”
  • Hire bicycle
  • Return bicycle
  • Find bicycles
  • Journey billing

Make sure that somewhere on your whiteboard / Google Drawing you’ve itemised a list of requirements.

Ensure you ask your interviewer if there are any additional requirements they’d like you to cover that you may have missed.

2. Approximate quantitatively 🔢

Next, produce some “back of the envelop” calculations.

You want to produce approximations for numbers like:

Some useful rules and numbers to know are:

3. Design data stores 💾

What data are you going to store, and how you are going to store it?

Things you’ll want to consider:

Some reoccuring areas you’ll want to consider:

4. Produce high-level architecture 🗺

Your requirements analysis should state your data sources, and your data store design tells you where your data lives. Your high-level architecture connects these together.

Produce a diagram with your sources (or clients) on the left, and your sinks somewhere on the right. Then fill in the middle with whatever servers, load balancers, computer clusters, queuing systems etc. you might need.

You might want to consider:

At a minimum you’ll probably have:

Then you might want to add things depending on your requirements:

Only mention technologies where you understand the tradeoffs they make. Unless you explicitly say something like “I would investigate X as I have never used it directly”. Don’t just name drop technologies that you think will sound smart.

You will also want to talk about the interfaces between each of your components. Will you use raw TCP or UDP, or HTTP, or gRPC, or Thrift? What schemas / message bodies do you use?

5. Deep-dive into problem-specific issues 🧰

Here is an opportunity to demonstrate your understanding of the technical or business problems that might arise in your system, and how you deal with them.

Some generic issues are things like:

Your specific system might have particular issues:

You should volunteer any problems you can think of to your interviewer. Part of the assessment criteria will be your ability to anticipate and mitigate potential future risks.

6. Consider tradeoffs ⚖️

There are probably other systems you could have designed that would have met your requirements. How else could you have designed the system? What would have changed?

For example, you might suggest NoSQL vs SQL data stores. But that might impact data consistency because you might lack database transactions.

Or you might suggest asynchronous rather than synchronous processing, but now you need an email server to notify users when their job is done.

7. Map back to the original requirements 🏆

Finally, read over your initial requirements and briefly note how your design meets them.

Common misconceptions 🎭

Finally, I’ll like to go over some common misconceptions of people doing system design interviews.

“I’ve never used {Redis, BigQuery, RabbitMQ, …} so I will do badly at system design interviews.

Though system design interviews are assessing the breadth of your knowledge, that’s only one axis. There are plenty of other factors at play, and the approach as suggested with help you expose them to the best of your ability.

Coding interviews require less preparation than system design interviews

I think both require adequate preparation. I also think system design is much more difficult to prepare for, because there’s no automated test suite available to validate your design.

Conclusion 🔚

System design interviews are a great way to demonstrate your experience. Use them to highlight your breadth of knowledge, business accumen and ability to anticpate and mitigate failure.

These skills are more difficult to assess than coding, so use a structured approach like the one presented above to maximise your chance of success.