The Software Design Interview
February 16, 2021•342 words
Just like the Coding Interview, there is a systematic way to approach these software engineering interview questions.
- Gather Requirements
- Back-of-the-envelope Estimates
- Interface Design
- Domain Modeling
- High-level Design
- Detailed Design
- Identify and Resolve Bottlenecks
Gather Requirements
System requirements are always going to be different so it's important to discover requirements before even discussing potential solutions. Even with the same set of requirements there is always more than one solution.
Remember that this question is where some creativity is required. The interviewer wants to see that you can navigate a realistic scenario by discussing multiple solutions and their pros and cons.
Back-of-the-envelope Estimates
Make estimates on the amount of usage the system will have and the ratio of reads to writes within the system. For example, how many tweets per second can the system expect to handle? Figure out the usage patterns. How will the data be consumed?
Make estimates on the system's storage capacity given an estimated data retention policy.
Make estimates on the sort of network bandwidth.
Interface Design
Create a rough API for any obvious integration points. This will help guide the design of your system.
Domain Modeling
Discover domain entities that exist beyond the software system such as users, tweets and connections. This will ensure that the most important business logic is considered up front.
What is the expected database system? SQL/NoSQL? What is the transport medium? What about encryption?
High-level Design
This should be 5-6 connected blocks showing the system from the front-end to the back-end. Use bounded contexts to help guide high-level separation.
Detailed Design
Pick 2 or 3 important bounded contexts that you want to dive deeper into. Bring up multiple approaches so that you can discuss trade-offs.
As mentioned before, system designs always have trade-offs. What are the pros/cons?
Identify and Resolve Bottlenecks
This is a good opportunity to discuss single points of failures and how the design would deal with them.
How will you monitor performance degradation and alert on issues?