1. Home
  2. Explore
  3. Engineering
  4. System Design Course

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

System Design Course

  • 21Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Large-Scale Distributed Systems

What is a defining characteristic of a large-scale distributed system?

21 questions

  1. 1

    What is a defining characteristic of a large-scale distributed system?

    1. A

      It uses only one server located in a single data center

    2. B

      It requires a monolithic architecture for easier management

    3. C

      It is designed for small user bases to ensure simplicity

    4. D

      It involves multiple servers in different locations for fault tolerance and performance

    Correct answer
    D

    It 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.

  2. 2

    Which of the following is NOT a characteristic of a large-scale system like Google Maps?

    1. A

      It is used by many people

    2. B

      It experiences frequent updates

    3. C

      It has low performance expectations

    4. D

      It stores a large amount of data

    Correct answer
    C

    It has low performance expectations

    Explanation

    Large-scale systems like Google Maps have high performance expectations; users expect quick and accurate results.

  3. 3

    In system design, a design pattern is best described as:

    1. A

      A method for writing unit tests

    2. B

      A common solution to a recurring problem in system design

    3. C

      A specific programming language feature

    4. D

      A type of database schema

    Correct answer
    B

    A 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.

  4. 4

    What is the primary purpose of using design patterns in system design?

    1. A

      To ensure the system uses only one type of database

    2. B

      To convert business requirements into reliable, scalable, and maintainable technical solutions

    3. C

      To replace the need for any testing

    4. D

      To make the system more complex and difficult to maintain

    Correct answer
    B

    To 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.

  5. 5

    When starting the design of a system, the first step is to:

    1. A

      Choose a database technology

    2. B

      Write code for the core functionality

    3. C

      Identify the most important features from the user's perspective

    4. D

      Define the network protocol

    Correct answer
    C

    Identify 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).

  6. 6

    In the context of API design, what is the difference between a stateless and a stateful protocol?

    1. A

      Stateless protocols require the server to remember client context, while stateful protocols do not

    2. B

      Stateless protocols include all necessary information in each request, while stateful protocols rely on server-stored context

    3. C

      Stateless protocols are slower than stateful protocols

    4. D

      Stateful protocols are used only for video streaming

    Correct answer
    B

    Stateless 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.

  7. 7

    Which protocol is most suitable for real-time video streaming where some packet loss is acceptable?

    1. A

      HTTP (stateless)

    2. B

      WebRTC (peer-to-peer, UDP-based)

    3. C

      FTP (file transfer)

    4. D

      RTMP (reliable, TCP-based)

    Correct answer
    B

    WebRTC (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.

  8. 8

    What is the role of the MPEG-DASH protocol in video streaming?

    1. A

      It provides adaptive streaming by adjusting video quality based on network conditions and device capabilities

    2. B

      It is a reliable protocol for ensuring no data loss during transmission

    3. C

      It is a proprietary format used only by Apple devices

    4. D

      It is used for uploading raw video footage from cameras

    Correct answer
    A

    It 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.

  9. 9

    Why is RTMP (Real-Time Messaging Protocol) preferred for the source camera when capturing live video?

    1. A

      It is a stateless protocol that simplifies server design

    2. B

      It supports adaptive streaming for multiple resolutions

    3. C

      It is optimized for low bandwidth environments

    4. D

      It provides high reliability with low latency, ensuring no data loss at the source

    Correct answer
    D

    It 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.

  10. 10

    Which database type is most appropriate for storing video files in a live streaming system?

    1. A

      A NoSQL database like MongoDB for key-value storage

    2. B

      An in-memory cache like Redis

    3. C

      A file system like HDFS or Amazon S3

    4. D

      A SQL database like MySQL for relational queries

    Correct answer
    C

    A 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.

  11. 11

    Why might a NoSQL database be chosen over a SQL database for storing comments in a live streaming system?

    1. A

      NoSQL databases are better for transactions and relational integrity

    2. B

      NoSQL databases offer better scalability for high-volume, simple key-value data

    3. C

      SQL databases cannot store text data

    4. D

      Comments require complex joins with user and video tables

    Correct answer
    B

    NoSQL 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.

  12. 12

    In video processing, what is the purpose of segmenting raw video into 10-second chunks before conversion?

    1. A

      To reduce the file size for easier storage

    2. B

      To ensure each chunk is exactly the same size

    3. C

      To enable parallel processing on different servers for different resolutions and formats

    4. D

      To allow the video to be played in reverse order

    Correct answer
    C

    To 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.

  13. 13

    What is the main advantage of using a CDN (Content Delivery Network) for serving video content?

    1. A

      It provides real-time video processing capabilities

    2. B

      It guarantees lossless video transmission

    3. C

      It eliminates the need for any authentication

    4. D

      It reduces the load on the origin server by serving static content from edge locations

    Correct answer
    D

    It 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.

  14. 14

    In high-level system design, what is the primary focus?

    1. A

      Writing detailed code for each component

    2. B

      Implementing user interface designs

    3. C

      Optimizing database queries for performance

    4. D

      Defining how components interact using network calls and APIs

    Correct answer
    D

    Defining 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.

  15. 15

    What is the purpose of a use case diagram in low-level design?

    1. A

      To identify actors and their actions (use cases) in the system

    2. B

      To define the sequence of interactions between objects

    3. C

      To show the class hierarchy and relationships

    4. D

      To represent database schema

    Correct answer
    A

    To 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.

  16. 16

    In a class diagram, what do 'states' and 'behaviors' refer to?

    1. A

      States are the data attributes, and behaviors are the methods that operate on that data

    2. B

      States are the user actions, and behaviors are the system responses

    3. C

      States represent network protocols, and behaviors represent database queries

    4. D

      States are the methods, and behaviors are the data fields

    Correct answer
    A

    States 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.

  17. 17

    Why is it important to create diagrams (use case, class, sequence) before coding?

    1. A

      They replace the need for any testing

    2. B

      They help clarify requirements and interactions, reducing mistakes and making coding more efficient

    3. C

      Diagrams are required for project documentation and are not used during coding

    4. D

      They are only useful for large teams, not for individual developers

    Correct answer
    B

    They 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.

  18. 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?

    1. A

      Static constants are only allowed in primitive types

    2. B

      Instance variables are faster to access than static constants

    3. C

      Static constants cannot be changed, while instance variables allow flexibility for frames of different durations

    4. D

      Instance variables are automatically initialized to zero

    Correct answer
    C

    Static 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.

  19. 19

    In the example of a live streaming system, what is the core requirement that must be addressed first?

    1. A

      Providing multiple video resolutions

    2. B

      Displaying advertisements during the stream

    3. C

      Allowing users to post comments and reactions

    4. D

      Showing video to many users without downtime

    Correct answer
    D

    Showing 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.

  20. 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?

    1. A

      To determine the video resolution to send

    2. B

      To enable analytics by distinguishing between user-initiated actions and automated buffering

    3. C

      To decide which database to query

    4. D

      To change the network protocol used

    Correct answer
    B

    To 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.

  21. 21

    Which of the following is an example of a common design pattern mentioned in the course?

    1. A

      Observer pattern for UI updates

    2. B

      Singleton pattern for database connections

    3. C

      Factory pattern for creating video objects

    4. D

      Publisher-subscriber model for broadcasting events to millions

    Correct answer
    D

    Publisher-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.

Question 1 of 21
Question 1 of 21

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent