Steps to approach a system design interview
·2 mins
- Clarify requirements.
- Highly important: understand who is going to use the system and how. Call it out explicitly and don’t make assumptions.
- Internal or public facing.
- How can you extend the system in future, but that’s far less important than solving all the use cases I am given. (While obvious, I didn’t properly do the latter in all the interviews.)
- Security requirements.
- Non-functional requirements, give numbers where possible:
- Availability vs consistency: what matters more?
- Availability, but don’t discuss if some components can have lower availability. (No one wants to design a low availability system in an interview.)
- Consistency: strong vs eventual.
- Can some operations be asynchronous?
- Latency.
- End to end latency for an operation. For e.g., if an event enters your system, how soon do you want to process it and present results to end users?
- Availability vs consistency: what matters more?
- Design considerations.
- Highly important: understand who is going to use the system and how. Call it out explicitly and don’t make assumptions.
- Back-of-the-envelope estimation: only do those that make sense for the question. Examples:
- If there are mobile users, estimate data size.
- API design.
- High level design.
- Standard stuff:
- Telemetry (i.e. logging and metrics).
- Standard stuff:
Based on interview’s choice:
- Dig deeper into 2-3 components as required.
- Failure handling.
- Identify and resolve bottlenecks.
- Database schema.
- Back-of-the-envelope estimation.
- Assume designing a system for 5 years. (5 years = 60 months, so easier than 3 years = 36 months.)
- Data and cache storage.
- Traffic:
- Request rate.
Bandwidth. (Probably tricky to estimate, so skip.)
Other things to keep in mind:
- Write a lot and don’t assume interviewers are following everything you are saying. Use bullet points.