Backend System Design Time Allocation

·

3 min read

A good enough framework for 60 minutes allocation looks like this:

  • 10 + 15 + 25 minutes
  • The 10 minutes left are buffers for introduction, minor technical problems, Q&A which usually doesn't affect your score

10 minutes: Clarification of the requirements

Different companies want a different thing. So you have to clarify unless they give you very detailed instructions. Some popular questions/assumptions look like

  • Could we just focus on the backend?
  • Are there any non-functional requirements?
  • Does it make sense to assume we will have more reads than writes
  • Is it ok to use 3rd party service for our payment gateway?
  • Do we need to support multiple languages?

For estimation, confirm with your interviewers because not every company wants a number. Unless you are asked for, skip the estimation step to save time for other steps.

15 minutes: High-level design

The goal of this step is to provide a big picture to show that we fulfil the functional requirements. At the end of this step, both you and your interviewer should have a general idea of how the data flow from request to response. Some common things you could talk about are:

  • An illustration of your simplest architecture (could be client -> server -> database in some cases)
  • System interface
    • API (HTTP method, what your endpoint does)
  • Databases
    • what kind of data do we want to store
    • what kind of databases and why (Relational, Key-Value, Graph, Search...
    • schema
    • (if you do estimation) figure out how much disk space do we need and see if that makes sense
      • For instance, storing TB sized data in a single relational database instance doesn't make sense (ref: Amazon RDS instance types)

To save time, skip talking about optimization, scaling etc. So no load balancers, no replicas at this point.

25 minutes: Detailed components, optimization, all the goodness

This is where you want to spend most of your time because

  • Compared to high-level design, which might look similar across different titles (think TikTok vs youtube), interviewers are most interested in how deep could you go for the current title
  • a place to show off how knowledgeable you are

Always confirm with your interviewers which components are they more interested in. This is the step you want to mention:

  • How to scale your read and write
  • Add more logic to help your system grows:
    • compression
    • an algorithm like splitting files into chunks etc
  • adding more components/logic to help your system grow. For instance, message queue, CDN etc.

Buffers

If you have more questions than time allowed, it's ok to ask your interviewers to stay more for a few minutes. I did and so far no interviewer rejected.