System Design Course
- 21Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is a defining characteristic of a large-scale distributed system?
What is a defining characteristic of a large-scale distributed system?
21 questions
- 1
What is a defining characteristic of a large-scale distributed system?
- A
It uses only one server located in a single data center
- B
It requires a monolithic architecture for easier management
- C
It is designed for small user bases to ensure simplicity
- D
It involves multiple servers in different locations for fault tolerance and performance
Correct answer
DIt involves multiple servers in different locations for fault tolerance and performance
Explanation
Large-scale distributed systems use multiple servers in different geographical locations to handle high traffic, provide fault tolerance, and improve performance by reducing latency.
- A
- 2
Which of the following is NOT a characteristic of a large-scale system like Google Maps?
- A
It is used by many people
- B
It experiences frequent updates
- C
It has low performance expectations
- D
It stores a large amount of data
Correct answer
CIt has low performance expectations
Explanation
Large-scale systems like Google Maps have high performance expectations; users expect quick and accurate results.
- A
- 3
In system design, a design pattern is best described as:
- A
A method for writing unit tests
- B
A common solution to a recurring problem in system design
- C
A specific programming language feature
- D
A type of database schema
Correct answer
BA common solution to a recurring problem in system design
Explanation
Design patterns are reusable solutions to common problems, such as the publisher-subscriber model for broadcasting events to millions of users.
- A
- 4
What is the primary purpose of using design patterns in system design?
- A
To ensure the system uses only one type of database
- B
To convert business requirements into reliable, scalable, and maintainable technical solutions
- C
To replace the need for any testing
- D
To make the system more complex and difficult to maintain
Correct answer
BTo convert business requirements into reliable, scalable, and maintainable technical solutions
Explanation
Design patterns help engineers build systems that are reliable, scalable, and maintainable, effectively translating business needs into technical implementations.
- A
- 5
When starting the design of a system, the first step is to:
- A
Choose a database technology
- B
Write code for the core functionality
- C
Identify the most important features from the user's perspective
- D
Define the network protocol
Correct answer
CIdentify the most important features from the user's perspective
Explanation
Engineers should first understand user requirements and prioritize core features, often documented in a product requirement document (PRD).
- A
- 6
In the context of API design, what is the difference between a stateless and a stateful protocol?
- A
Stateless protocols require the server to remember client context, while stateful protocols do not
- B
Stateless protocols include all necessary information in each request, while stateful protocols rely on server-stored context
- C
Stateless protocols are slower than stateful protocols
- D
Stateful protocols are used only for video streaming
Correct answer
BStateless protocols include all necessary information in each request, while stateful protocols rely on server-stored context
Explanation
In stateless protocols like HTTP, each request contains all needed information. Stateful protocols maintain context on the server, which can simplify client code but risks losing context if the server crashes.
- A
- 7
Which protocol is most suitable for real-time video streaming where some packet loss is acceptable?
- A
HTTP (stateless)
- B
WebRTC (peer-to-peer, UDP-based)
- C
FTP (file transfer)
- D
RTMP (reliable, TCP-based)
Correct answer
BWebRTC (peer-to-peer, UDP-based)
Explanation
WebRTC is a peer-to-peer protocol often used for real-time communication; it can tolerate some packet loss, which is acceptable in live streaming where timeliness is more important than reliability.
- A
- 8
What is the role of the MPEG-DASH protocol in video streaming?
- A
It provides adaptive streaming by adjusting video quality based on network conditions and device capabilities
- B
It is a reliable protocol for ensuring no data loss during transmission
- C
It is a proprietary format used only by Apple devices
- D
It is used for uploading raw video footage from cameras
Correct answer
AIt provides adaptive streaming by adjusting video quality based on network conditions and device capabilities
Explanation
MPEG-DASH (Dynamic Adaptive Streaming over HTTP) automatically adjusts video quality (e.g., from 144p to 4K) depending on bandwidth and device, enhancing user experience.
- A
- 9
Why is RTMP (Real-Time Messaging Protocol) preferred for the source camera when capturing live video?
- A
It is a stateless protocol that simplifies server design
- B
It supports adaptive streaming for multiple resolutions
- C
It is optimized for low bandwidth environments
- D
It provides high reliability with low latency, ensuring no data loss at the source
Correct answer
DIt provides high reliability with low latency, ensuring no data loss at the source
Explanation
RTMP is a reliable protocol that ensures no data loss from the source, which is critical because any loss at the source affects all subsequent viewers.
- A
- 10
Which database type is most appropriate for storing video files in a live streaming system?
- A
A NoSQL database like MongoDB for key-value storage
- B
An in-memory cache like Redis
- C
A file system like HDFS or Amazon S3
- D
A SQL database like MySQL for relational queries
Correct answer
CA file system like HDFS or Amazon S3
Explanation
Video files are large and static; storing them in a file system (e.g., HDFS, S3) is cheap and efficient, while databases are more suited for structured data with frequent updates.
- A
- 11
Why might a NoSQL database be chosen over a SQL database for storing comments in a live streaming system?
- A
NoSQL databases are better for transactions and relational integrity
- B
NoSQL databases offer better scalability for high-volume, simple key-value data
- C
SQL databases cannot store text data
- D
Comments require complex joins with user and video tables
Correct answer
BNoSQL databases offer better scalability for high-volume, simple key-value data
Explanation
Comments are often high-volume and need to be stored and retrieved quickly without complex joins; NoSQL databases scale well for such key-value data.
- A
- 12
In video processing, what is the purpose of segmenting raw video into 10-second chunks before conversion?
- A
To reduce the file size for easier storage
- B
To ensure each chunk is exactly the same size
- C
To enable parallel processing on different servers for different resolutions and formats
- D
To allow the video to be played in reverse order
Correct answer
CTo enable parallel processing on different servers for different resolutions and formats
Explanation
Segmenting video into chunks allows multiple servers to process chunks simultaneously for different outputs (e.g., resolutions, formats), a pattern similar to MapReduce.
- A
- 13
What is the main advantage of using a CDN (Content Delivery Network) for serving video content?
- A
It provides real-time video processing capabilities
- B
It guarantees lossless video transmission
- C
It eliminates the need for any authentication
- D
It reduces the load on the origin server by serving static content from edge locations
Correct answer
DIt reduces the load on the origin server by serving static content from edge locations
Explanation
CDNs cache static content (e.g., video segments) at geographically distributed edge servers, reducing latency and offloading traffic from the origin server.
- A
- 14
In high-level system design, what is the primary focus?
- A
Writing detailed code for each component
- B
Implementing user interface designs
- C
Optimizing database queries for performance
- D
Defining how components interact using network calls and APIs
Correct answer
DDefining how components interact using network calls and APIs
Explanation
High-level design focuses on the overall architecture, component interactions, and data flow, without diving into implementation details.
- A
- 15
What is the purpose of a use case diagram in low-level design?
- A
To identify actors and their actions (use cases) in the system
- B
To define the sequence of interactions between objects
- C
To show the class hierarchy and relationships
- D
To represent database schema
Correct answer
ATo identify actors and their actions (use cases) in the system
Explanation
A use case diagram identifies the actors (e.g., customer, admin) and the actions they can perform (use cases) in the system.
- A
- 16
In a class diagram, what do 'states' and 'behaviors' refer to?
- A
States are the data attributes, and behaviors are the methods that operate on that data
- B
States are the user actions, and behaviors are the system responses
- C
States represent network protocols, and behaviors represent database queries
- D
States are the methods, and behaviors are the data fields
Correct answer
AStates are the data attributes, and behaviors are the methods that operate on that data
Explanation
In object-oriented design, a class has states (data/attributes) and behaviors (methods) that define what the object knows and does.
- A
- 17
Why is it important to create diagrams (use case, class, sequence) before coding?
- A
They replace the need for any testing
- B
They help clarify requirements and interactions, reducing mistakes and making coding more efficient
- C
Diagrams are required for project documentation and are not used during coding
- D
They are only useful for large teams, not for individual developers
Correct answer
BThey help clarify requirements and interactions, reducing mistakes and making coding more efficient
Explanation
Diagrams document thought processes and interactions, allowing engineers to focus on coding without rethinking design decisions, thus speeding up development and reducing errors.
- A
- 18
When implementing a video frame retrieval method in Java, why is it better to store the frame duration as an instance variable in the Frame class rather than a static constant?
- A
Static constants are only allowed in primitive types
- B
Instance variables are faster to access than static constants
- C
Static constants cannot be changed, while instance variables allow flexibility for frames of different durations
- D
Instance variables are automatically initialized to zero
Correct answer
CStatic constants cannot be changed, while instance variables allow flexibility for frames of different durations
Explanation
Frames can have different durations depending on content (e.g., high-motion scenes may be shorter). Storing duration per frame allows each object to have its own value, providing flexibility.
- A
- 19
In the example of a live streaming system, what is the core requirement that must be addressed first?
- A
Providing multiple video resolutions
- B
Displaying advertisements during the stream
- C
Allowing users to post comments and reactions
- D
Showing video to many users without downtime
Correct answer
DShowing video to many users without downtime
Explanation
The primary requirement is to stream video to a large number of users reliably. Other features like comments and ads are secondary.
- A
- 20
What is the purpose of adding a flag to the API to indicate whether a video frame request comes from user seek or background buffering?
- A
To determine the video resolution to send
- B
To enable analytics by distinguishing between user-initiated actions and automated buffering
- C
To decide which database to query
- D
To change the network protocol used
Correct answer
BTo enable analytics by distinguishing between user-initiated actions and automated buffering
Explanation
A flag allows the system to log user interest (seek) separately from routine buffering, providing valuable analytics for business decisions.
- A
- 21
Which of the following is an example of a common design pattern mentioned in the course?
- A
Observer pattern for UI updates
- B
Singleton pattern for database connections
- C
Factory pattern for creating video objects
- D
Publisher-subscriber model for broadcasting events to millions
Correct answer
DPublisher-subscriber model for broadcasting events to millions
Explanation
The publisher-subscriber pattern is used to distribute events (e.g., a celebrity post) to many subscribers efficiently, controlling load and ensuring delivery.
- A

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