Book description
The system design interview is one of the hardest challenges you’ll face in the software engineering hiring process. This practical book gives you the insights, the skills, and the hands-on practice you need to ace the toughest system design interview questions and land the job and salary you want.In Acing the System Design Interview you will master a structured and organized approach to present system design ideas like:
- Scaling applications to support heavy traffic
- Distributed transactions techniques to ensure data consistency
- Services for functional partitioning such as API gateway and service mesh
- Common API paradigms including REST, RPC, and GraphQL
- Caching strategies, including their tradeoffs
- Logging, monitoring, and alerting concepts that are critical in any system design
- Communication skills that demonstrate your engineering maturity
Don’t be daunted by the complex, open-ended nature of system design interviews! In this in-depth guide, author Zhiyong Tan shares what he’s learned on both sides of the interview table. You’ll dive deep into the common technical topics that arise during interviews and learn how to apply them to mentally perfect different kinds of systems.
About the Technology
The system design interview is daunting even for seasoned software engineers. Fortunately, with a little careful prep work you can turn those open-ended questions and whiteboard sessions into your competitive advantage! In this powerful book, Zhiyong Tan reveals practical interview techniques and insights about system design that have earned developers job offers from Amazon, Apple, ByteDance, PayPal, and Uber.
About the Book
Acing the System Design Interview is a masterclass in how to confidently nail your next interview. Following these easy-to-remember techniques, you’ll learn to quickly assess a question, identify an advantageous approach, and then communicate your ideas clearly to an interviewer. As you work through this book, you’ll gain not only the skills to successfully interview, but also to do the actual work of great system design.
What's Inside
- Insights on scaling, transactions, logging, and more
- Practice questions for core system design concepts
- How to demonstrate your engineering maturity
- Great questions to ask your interviewer
About the Reader
For software engineers, software architects, and engineering managers looking to advance their careers.
About the Author
Zhiyong Tan is a manager at PayPal. He has worked at Uber, Teradata, and at small startups. Over the years, he has been in many system design interviews, on both sides of the table.
The technical editor on this book was Mohit Kumar.
Quotes
Deconstructs the system design interview and presents each component in an accessible manner for new job seekers as well as seasoned engineers. The attention to detail makes this book a must have.
- Mohammad Shafkat Amin, Meta
Comprehensively covers the most common topics, along with helpful tips and advice. It gives you all the tools you need to ace your next system design interview.
- Rajesh Kumar, Google
The practical advice and real world examples in this book will help you master the art of system design and succeed in your next interview.
- Kevin Goh, PayPal
Publisher resources
Table of contents
- Inside front cover
- Acing the System Design Interview
- Copyright
- dedication
- contents
- front matter
- Part 1.
-
1 A walkthrough of system design concepts
- 1.1 A discussion about tradeoffs
- 1.2 Should you read this book?
- 1.3 Overview of this book
-
1.4 Prelude: A brief discussion of scaling the various services of a system
- 1.4.1 The beginning: A small initial deployment of our app
- 1.4.2 Scaling with GeoDNS
- 1.4.3 Adding a caching service
- 1.4.4 Content distribution network
- 1.4.5 A brief discussion of horizontal scalability and cluster management, continuous integration, and continuous deployment
- 1.4.6 Functional partitioning and centralization of cross-cutting concerns
- 1.4.7 Batch and streaming extract, transform, and load (ETL)
- 1.4.8 Other common services
- 1.4.9 Cloud vs. bare metal
- 1.4.10 Serverless: Function as a Service (FaaS)
- 1.4.11 Conclusion: Scaling backend services
- Summary
-
2 A typical system design interview flow
- 2.1 Clarify requirements and discuss tradeoffs
- 2.2 Draft the API specification
- 2.3 Connections and processing between users and data
- 2.4 Design the data model
- 2.5 Logging, monitoring, and alerting
- 2.6 Search bar
- 2.7 Other discussions
- 2.8 Post-interview reflection and assessment
- 2.9 Interviewing the company
- Summary
-
3 Non-functional requirements
- 3.1 Scalability
- 3.2 Availability
-
3.3 Fault-tolerance
- 3.3.1 Replication and redundancy
- 3.3.2 Forward error correction and error correction code
- 3.3.3 Circuit breaker
- 3.3.4 Exponential backoff and retry
- 3.3.5 Caching responses of other services
- 3.3.6 Checkpointing
- 3.3.7 Dead letter queue
- 3.3.8 Logging and periodic auditing
- 3.3.9 Bulkhead
- 3.3.10 Fallback pattern
- 3.4 Performance/latency and throughput
- 3.5 Consistency
- 3.6 Accuracy
- 3.7 Complexity and maintainability
- 3.8 Cost
- 3.9 Security
- 3.10 Privacy
- 3.11 Cloud native
- 3.12 Further reading
- Summary
-
4 Scaling databases
- 4.1 Brief prelude on storage services
- 4.2 When to use vs. avoid databases
- 4.3 Replication
- 4.4 Scaling storage capacity with sharded databases
- 4.5 Aggregating events
- 4.6 Batch and streaming ETL
- 4.7 Denormalization
- 4.8 Caching
- 4.9 Caching as a separate service
- 4.10 Examples of different kinds of data to cache and how to cache them
- 4.11 Cache invalidation
- 4.12 Cache warming
- 4.13 Further reading
- Summary
- 5 Distributed transactions
- 6 Common services for functional partitioning
- Part 2.
-
7 Design Craigslist
- 7.1 User stories and requirements
- 7.2 API
- 7.3 SQL database schema
- 7.4 Initial high-level architecture
- 7.5 A monolith architecture
- 7.6 Using an SQL database and object store
- 7.7 Migrations are troublesome
- 7.8 Writing and reading posts
- 7.9 Functional partitioning
- 7.10 Caching
- 7.11 CDN
- 7.12 Scaling reads with a SQL cluster
- 7.13 Scaling write throughput
- 7.14 Email service
- 7.15 Search
- 7.16 Removing old posts
- 7.17 Monitoring and alerting
- 7.18 Summary of our architecture discussion so far
-
7.19 Other possible discussion topics
- 7.19.1 Reporting posts
- 7.19.2 Graceful degradation
- 7.19.3 Complexity
- 7.19.4 Item categories/tags
- 7.19.5 Analytics and recommendations
- 7.19.6 A/B testing
- 7.19.7 Subscriptions and saved searches
- 7.19.8 Allow duplicate requests to the search service
- 7.19.9 Avoid duplicate requests to the search service
- 7.19.10 Rate limiting
- 7.19.11 Large number of posts
- 7.19.12 Local regulations
- Summary
-
8 Design a rate-limiting service
- 8.1 Alternatives to a rate-limiting service and why they are infeasible
- 8.2 When not to do rate limiting
- 8.3 Functional requirements
- 8.4 Non-functional requirements
- 8.5 Discuss user stories and required service components
- 8.6 High-level architecture
- 8.7 Stateful approach/sharding
- 8.8 Storing all counts in every host
- 8.9 Rate-limiting algorithms
- 8.10 Employing a sidecar pattern
- 8.11 Logging, monitoring, and alerting
- 8.12 Providing functionality in a client library
- 8.13 Further reading
- Summary
-
9 Design a notification/alerting service
- 9.1 Functional requirements
- 9.2 Non-functional requirements
- 9.3 Initial high-level architecture
- 9.4 Object store: Configuring and sending notifications
- 9.5 Notification templates
- 9.6 Scheduled notifications
- 9.7 Notification addressee groups
- 9.8 Unsubscribe requests
- 9.9 Handling failed deliveries
- 9.10 Client-side considerations regarding duplicate notifications
- 9.11 Priority
- 9.12 Search
- 9.13 Monitoring and alerting
- 9.14 Availability monitoring and alerting on the notification/alerting service
- 9.15 Other possible discussion topics
- 9.16 Final notes
- Summary
-
10 Design a database batch auditing service
- 10.1 Why is auditing necessary?
- 10.2 Defining a validation with a conditional statement on a SQL query’s result
- 10.3 A simple SQL batch auditing service
- 10.4 Requirements
- 10.5 High-level architecture
- 10.6 Constraints on database queries
- 10.7 Prevent too many simultaneous queries
- 10.8 Other users of database schema metadata
- 10.9 Auditing a data pipeline
- 10.10 Logging, monitoring, and alerting
- 10.11 Other possible types of audits
- 10.12 Other possible discussion topics
- 10.13 References
- Summary
-
11 Autocomplete/typeahead
- 11.1 Possible uses of autocomplete
- 11.2 Search vs. autocomplete
- 11.3 Functional requirements
- 11.4 Non-functional requirements
- 11.5 Planning the high-level architecture
- 11.6 Weighted trie approach and initial high-level architecture
-
11.7 Detailed implementation
- 11.7.1 Each step should be an independent task
- 11.7.2 Fetch relevant logs from Elasticsearch to HDFS
- 11.7.3 Split the search strings into words and other simple operations
- 11.7.4 Filter out inappropriate words
- 11.7.5 Fuzzy matching and spelling correction
- 11.7.6 Count the words
- 11.7.7 Filter for appropriate words
- 11.7.8 Managing new popular unknown words
- 11.7.9 Generate and deliver the weighted trie
- 11.8 Sampling approach
- 11.9 Handling storage requirements
- 11.10 Handling phrases instead of single words
- 11.11 Logging, monitoring, and alerting
- 11.12 Other considerations and further discussion
- Summary
-
12 Design Flickr
- 12.1 User stories and functional requirements
- 12.2 Non-functional requirements
- 12.3 High-level architecture
- 12.4 SQL schema
- 12.5 Organizing directories and files on the CDN
- 12.6 Uploading a photo
- 12.7 Downloading images and data
- 12.8 Monitoring and alerting
- 12.9 Some other services
- 12.10 Other possible discussion topics
- Summary
-
13 Design a Content Distribution Network
- 13.1 Advantages and disadvantages of a CDN
- 13.2 Requirements
- 13.3 CDN authentication and authorization
- 13.4 High-level architecture
- 13.5 Storage service
- 13.6 Common operations
- 13.7 Cache invalidation
- 13.8 Logging, monitoring, and alerting
- 13.9 Other possible discussions on downloading media files
- Summary
- 14 Design a text messaging app
- 15 Design Airbnb
- 16 Design a news feed
-
17 Design a dashboard of top 10 products on Amazon by sales volume
- 17.1 Requirements
- 17.2 Initial thoughts
- 17.3 Initial high-level architecture
- 17.4 Aggregation service
- 17.5 Batch pipeline
- 17.6 Streaming pipeline
- 17.7 Approximation
- 17.8 Dashboard with Lambda architecture
- 17.9 Kappa architecture approach
- 17.10 Logging, monitoring, and alerting
- 17.11 Other possible discussion topics
- 17.12 References
- Summary
- Appendix A. Monoliths vs. microservices
- Appendix B. OAuth 2.0 authorization and OpenID Connect authentication1
- Appendix C. C4 Model
- Appendix D. Two-phase commit (2PC)
- index
Product information
- Title: Acing the System Design Interview
- Author(s):
- Release date: January 2024
- Publisher(s): Manning Publications
- ISBN: 9781633439108
You might also like
audiobook
Acing the System Design Interview
The system design interview is one of the hardest challenges you’ll face in the software engineering …
book
The Pragmatic Programmer: your journey to mastery, 20th Anniversary Edition, 2nd Edition
"One of the most significant books in my life." —Obie Fernandez, Author, The Rails Way "Twenty …
book
Designing Data-Intensive Applications
Data is at the center of many challenges in system design today. Difficult issues need to …
audiobook
The Staff Engineer's Path
For years, companies have rewarded their most effective engineers with management positions. But treating management as …