CHAPTER 3: A FRAMEWORK FOR SYSTEM DESIGN INTERVIEWS

An effective system design interview gives strong signals about a
person’s ability to collaborate, to work under pressure, and to resolve ambiguity constructively. The ability to ask good questions is also an essential skill, and many interviewers specifically look for this skill.

A good interviewer also looks for red flags. Over-engineering is a real disease of many engineers as they delight in design purity and ignore tradeoffs.

A 4-step process for effective system design interview

Step 1 - Understand the problem and establish design scope

Answering without a thorough understanding of the requirements is a huge red flag as the interview is not a trivia contest. There is no right answer. Slow down. Think deeply and ask questions to
clarify requirements and assumptions. This is extremely important.

When you ask a question, the interviewer either answers your question directly or asks you to make your assumptions. If the latter happens, write down your assumptions on the whiteboard or paper. You might need them later.

Ask questions to understand the exact requirements.

• What specific features are we going to build?
• How many users does the product have?
• How fast does the company anticipate to scale up? What are the anticipated scales in 3
months, 6 months, and a year?
• What is the company’s technology stack? What existing services you might leverage to simplify the design?

Step 2 - Propose high-level design and get buy-in

Come up with an initial blueprint for the design. Ask for feedback. Treat your interviewer as a teammate and work together. Many good interviewers love to talk and get involved.

Draw box diagrams with key components on the whiteboard or paper. This might include clients (mobile/web), APIs, web servers, data stores, cache, CDN, message queue, etc.

Do back-of-the-envelope calculations to evaluate if your blueprint fits the scale constraints. Think out loud. Communicate with your interviewer if back-of-the-envelope is necessary before diving into it.

If possible, go through a few concrete use cases. This will help you frame the high-leveldesign. It is also likely that the use cases would help you discover edge cases you have not yet considered.

Should we include API endpoints and database schema here? This depends on the problem.

Step 3 - Design deep dive

At this step, you and your interviewer should have already achieved the following objectives:
• Agreed on the overall goals and feature scope
• Sketched out a high-level blueprint for the overall design
• Obtained feedback from your interviewer on the high-level design
• Had some initial ideas about areas to focus on in deep dive based on her feedback

You shall work with the interviewer to identify and prioritize components in the architecture.

Time management is essential as it is easy to get carried away with minute details that do not demonstrate your abilities.

Step 4 - Wrap up

• The interviewer might want you to identify the system bottlenecks and discuss potential
improvements. Never say your design is perfect and nothing can be improved. There is
always something to improve upon. This is a great opportunity to show your critical
thinking and leave a good final impression.
• It could be useful to give the interviewer a recap of your design. This is particularly important if you suggested a few solutions. Refreshing your interviewer’s memory can be helpful after a long session.
Error cases (server failure, network loss, etc.) are interesting to talk about.
• Operation issues are worth mentioning. How do you monitor metrics and error logs? How to roll out the system?
• How to handle the next scale curve is also an interesting topic. For example, if your
current design supports 1 million users, what changes do you need to make to support 10
million users?
• Propose other refinements you need if you had more time.

Dos

• Always ask for clarification. Do not assume your assumption is correct.
• Understand the requirements of the problem.
• There is neither the right answer nor the best answer. A solution designed to solve the problems of a young startup is different from that of an established company with millions
of users. Make sure you understand the requirements.
• Let the interviewer know what you are thinking. Communicate with your interview.
• Suggest multiple approaches if possible.
• Once you agree with your interviewer on the blueprint, go into details on each component. Design the most critical components first.
Bounce ideas off the interviewer. A good interviewer works with you as a teammate.
• Never give up.

Don’ts

• Don’t be unprepared for typical interview questions.
• Don’t jump into a solution without clarifying the requirements and assumptions.
• Don’t go into too much detail on a single component in the beginning. Give the highlevel design first then drills down.
• If you get stuck, don’t hesitate to ask for hints.
• Again, communicate. Don’t think in silence.
• Don’t think your interview is done once you give the design. You are not done until your interviewer says you are done. Ask for feedback early and often.

Step 1 Understand the problem and establish design scope: 3 - 10 minutes
Step 2 Propose high-level design and get buy-in: 10 - 15 minutes
Step 3 Design deep dive: 10 - 25 minutes
Step 4 Wrap: 3 - 5 minutes

你可能感兴趣的:(System,Design,系统架构)