System Design Course
- 34Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is a large-scale distributed system?
A system with high usage (many users, large data, frequent updates, high performance expectations) and servers distributed globally for fault tolerance and performance.
Or swipe the card
34 cards
What is a large-scale distributed system?
A system with high usage (many users, large data, frequent updates, high performance expectations) and servers distributed globally for fault tolerance and performance.
Why are servers distributed globally in distributed systems?
For fault tolerance (if one server crashes, others take over) and performance (users access nearby servers for faster response).
Give an example of a large-scale distributed system.
Google Maps, which stores vast map data, is used by millions, updated frequently, and must be fast and accurate.
What is fault tolerance in system design?
The ability to avoid single points of failure by using multiple servers (e.g., across regions or within a region) with mechanisms like data duplication or partitioning.
What is extensibility in system design?
The ease with which a system can adapt to changing requirements without major redesign, achieved by decoupling code from specific features.
How can fault tolerance be achieved within the same region?
By having multiple servers with data duplication (so another server can quickly take over) or partitioning (so only a portion of users are affected if one fails).
What are design patterns in system design?
Particular practices, principles, or processes used by engineers to solve common problems in building large-scale systems.
Describe the publisher-subscriber design pattern.
A pattern where a publisher (e.g., a celebrity) produces content distributed to many subscribers (followers), with an intermediary controlling the pace to avoid server overload.
Why are design patterns useful?
They provide reusable solutions to common problems, helping engineers convert business requirements into reliable, scalable, and maintainable technical solutions.
What is the first step in system design?
Define requirements from the user's perspective, often captured in a product requirement document (PRD).
How are features converted into data definitions?
Abstract concepts are turned into objects with attributes (e.g., a 'like' has an ID, user ID, timestamp) that can be mapped to database tables.
What are APIs in system design?
Endpoints that allow external users to query and manipulate data, with well-defined signatures (e.g., GET /video/frame).
Why is testing important in high-level design?
To verify the design handles edge cases and common cases, and to load test for feasibility before coding.
What is the difference between stateless and stateful protocols?
Stateless protocols (e.g., HTTP) require all context in the request, keeping the server simple. Stateful protocols maintain context on the server, which can be lost if the server crashes.
What is an advantage of stateless protocols like HTTP?
They simplify server design because no client context is stored; if a server crashes, no state is lost, and new servers can be added easily.
When would you use TCP vs UDP for video streaming?
Use TCP for reliable transmission (e.g., lecture where all data is required) and UDP for real-time efficiency (e.g., live streaming where some packet loss is acceptable).
What is WebRTC and when is it used?
A peer-to-peer protocol for real-time communication, useful for video conferencing (many-to-many) but less suitable for one-to-many broadcast.
What is RTMP?
Real-Time Messaging Protocol, a reliable protocol used for ingesting video from a source (e.g., camera) to ensure no data loss.
What are adaptive streaming protocols like MPEG-DASH and HLS?
Protocols that adjust video quality based on network bandwidth and device capabilities, handling changes automatically (e.g., DASH for general, HLS for iOS).
What type of database is suitable for storing comments in a live streaming system?
NoSQL database, because comments are key-value pairs and don't require complex joins, and scalability is more important than transactions.
Why is a file system like HDFS or S3 preferred over a relational database for storing video files?
Video files are large and static; file systems are cheaper and easier to query for such data, while databases are expensive and slower for file storage.
What is the trade-off between SQL and NoSQL databases for social features?
SQL provides transactions and joins but may not scale horizontally well; NoSQL offers scalability and flexibility but lacks complex querying.
What is the map-reduce pattern used for in video streaming?
To split raw video into segments (e.g., 10 seconds) and process them in parallel across multiple servers to produce different resolutions and formats.
What are typical video resolutions for streaming?
1080p (full HD), 720p (HD), 480p (decent for mobile), and sometimes 144p for low bandwidth.
How does a CDN help in video streaming?
CDNs cache static content (e.g., video segments) on edge servers near users, reducing load on origin servers and improving performance.
What is the challenge of using a CDN for authenticated video content?
Authentication must be handled, possibly by custom code on the CDN or by ensuring only authorized users can access the content.
What is a use case diagram in low-level design?
A diagram showing actors (users) and the actions they can perform in the system, e.g., customer, admin, videographer.
What are core use cases for a customer in a video streaming app?
Play video from a timestamp, resume from where left off, stream maximum quality allowed by network/device, and nonstop play (buffering).
What is a class diagram?
A diagram showing the states (data) and behaviors (methods) of objects in the system, e.g., Video class with id, frames, metadata, and getFrame method.
What is a sequence diagram?
A diagram that shows the sequence of interactions between objects over time, e.g., user requests timestamp, then requests video frame.
How does low-level design differ from high-level design?
Low-level design focuses on detailed implementation of specific components (e.g., classes and methods), while high-level design looks at overall system architecture and component interactions.
What is the role of the WatchedVideo class?
It tracks which video a user is watching, storing user ID, video ID, and seek timestamp to allow resuming playback.
Why might you separate the API for seeking from the API for buffering?
Although technically similar, they have different business meanings: seeking indicates user interest (analytics), while buffering is for smooth playback.
What is the advantage of making frame duration a property of each frame object?
It allows different frames to have different durations (e.g., high-action scenes may be shorter than static scenes), increasing flexibility over using a class constant.

Ask anything
We've read this whole study set, so questions about it get the best answers.