System Design quiz

Scaling, caching, load balancing, databases and trade-offs.

70 questionsInstant feedbackFree

Set up your quiz

Difficulty
Number of questions

Tip: press 1–4 to answer and Enter for the next question.

All 70 questions with answers
  1. What does scalability mean?

    • Ability of a system to handle growing load (correct)
    • Making a system look bigger
    • Reducing the number of users
    • Encrypting all data
  2. What is the main role of a load balancer?

    • Store user data
    • Distribute incoming traffic across multiple servers (correct)
    • Compile source code
    • Encrypt passwords
  3. What is horizontal scaling?

    • Adding more RAM to one server
    • Upgrading the CPU of one server
    • Adding more machines to share the load (correct)
    • Reducing server count
  4. What is the main purpose of caching?

    • Increase disk storage
    • Encrypt data
    • Delete old data
    • Reduce latency by serving frequently used data quickly (correct)
  5. What does CDN stand for?

    • Central Data Node
    • Content Delivery Network (correct)
    • Cloud Database Network
    • Compressed Data Namespace
  6. Which of these is a relational (SQL) database?

    • MongoDB
    • Redis
    • PostgreSQL (correct)
    • Cassandra
  7. What is latency?

    • Total storage capacity
    • Number of users online
    • Number of servers
    • Time taken for a request to receive a response (correct)
  8. What are the three properties in the CAP theorem?

    • Cache, Availability, Performance
    • Consistency, Availability, Partition tolerance (correct)
    • Concurrency, Atomicity, Persistence
    • Capacity, Access, Protocol
  9. What is database sharding?

    • Backing up a database
    • Encrypting a database
    • Splitting data across multiple databases (correct)
    • Deleting duplicate rows
  10. What is a key benefit of a message queue?

    • Faster CPU speed
    • Larger storage
    • Better UI design
    • Asynchronous communication that decouples services (correct)
  11. Which of these is a rate-limiting algorithm?

    • Quick sort
    • Token bucket (correct)
    • Dijkstra
    • Merge sort
  12. What is a single point of failure?

    • A component whose failure brings down the whole system (correct)
    • The fastest server
    • A backup database
    • A load balancer pair
  13. What is database replication?

    • Deleting old data
    • Compressing tables
    • Copying data to multiple nodes for availability and reads (correct)
    • Renaming tables
  14. REST APIs are typically:

    • Stateful
    • Stateless (correct)
    • Binary only
    • Connection-persistent
  15. Which cache eviction policy removes the least recently used item first?

    • FIFO
    • MRU
    • LRU (correct)
    • Random
  16. What does eventual consistency mean?

    • Data is always instantly consistent
    • Replicas converge to the same value if no new updates occur (correct)
    • Data is never consistent
    • Only one replica exists
  17. What problem does consistent hashing solve?

    • Password storage
    • Image compression
    • Slow queries
    • Minimizing data movement when nodes are added or removed (correct)
  18. Which pattern helps prevent cascading failures between services?

    • Circuit breaker (correct)
    • Singleton
    • Observer
    • Factory
  19. What does a write-through cache do?

    • Writes only to the cache
    • Writes to the database after a long delay
    • Writes to both cache and database synchronously (correct)
    • Never writes data
  20. During a network partition, a CP system chooses to:

    • Sacrifice availability to keep consistency (correct)
    • Sacrifice consistency to keep availability
    • Sacrifice partition tolerance
    • Sacrifice durability
  21. What is a server?

    • A computer that provides services or data to other computers (correct)
    • A type of cable
    • A web browser
    • A keyboard
  22. What is a client in client-server architecture?

    • A network switch
    • The server's owner
    • The device or program that requests services from a server (correct)
    • A database
  23. What is an API?

    • A web browser
    • A programming language
    • A defined way for programs to communicate with each other (correct)
    • A type of database
  24. What is vertical scaling?

    • Removing servers
    • Adding more power (CPU, RAM) to one machine (correct)
    • Splitting a database
    • Adding more machines
  25. What is availability?

    • The speed of a system
    • The percentage of time a system is up and working (correct)
    • The size of the database
    • The number of users
  26. What does 99.9% availability allow per year roughly?

    • About 1 month
    • About 3 days
    • About 8.8 hours of downtime (correct)
    • About 1 minute
  27. What is throughput?

    • The delay of one request
    • The disk size
    • The amount of work a system handles per unit of time (correct)
    • The number of servers
  28. What is a database index used for?

    • Backing up data
    • Deleting old rows
    • Encrypting data
    • Speeding up queries (correct)
  29. What is a monolith?

    • An application built and deployed as one single unit (correct)
    • Many small services
    • A type of database
    • A load balancer
  30. What are microservices?

    • An application split into small, independently deployable services (correct)
    • A tiny server
    • One big service
    • A database table
  31. Which of these is a NoSQL database?

    • MySQL
    • Oracle Database
    • PostgreSQL
    • MongoDB (correct)
  32. Which of these is commonly used as an in-memory cache?

    • Redis (correct)
    • Nginx
    • Git
    • PostgreSQL
  33. What does a reverse proxy do?

    • Sends emails
    • Blocks all traffic
    • Stores files
    • Sits in front of servers and forwards client requests to them (correct)
  34. What is a stateless service?

    • One that never changes
    • One with no database
    • One without an API
    • One that keeps no client session data between requests (correct)
  35. Why are stateless services easier to scale horizontally?

    • They need no network
    • Any instance can handle any request (correct)
    • They use less code
    • They never fail
  36. What is a cache hit?

    • The data is deleted
    • The requested data is found in the cache (correct)
    • The cache is full
    • The cache crashes
  37. What is cache invalidation?

    • Removing or updating cached data when the source changes (correct)
    • Encrypting the cache
    • Restarting the cache
    • Filling the cache
  38. What is TTL in caching?

    • The type of data stored
    • How long an item stays in the cache before it expires (correct)
    • The total cache size
    • The number of hits
  39. What is the cache-aside pattern?

    • Writes go only to the cache
    • The cache is never used
    • The database writes to the cache directly
    • The app reads from the cache and loads from the database on a miss (correct)
  40. What is master-slave (primary-replica) replication used for?

    • Encrypting data
    • Reducing storage
    • Faster writes on every node
    • Scaling reads and providing redundancy (correct)
  41. What is a read replica?

    • A backup tape
    • A cache
    • A copy of the database that serves read queries (correct)
    • A log file
  42. What is replication lag?

    • A full disk
    • The delay before changes on the primary appear on replicas (correct)
    • Slow network cables
    • A failed backup
  43. What is a CDN mainly used for?

    • Running databases
    • Sending emails
    • Serving static content from servers close to users (correct)
    • Compiling code
  44. What does a message broker such as Kafka or RabbitMQ do?

    • Stores web pages
    • Passes messages between producers and consumers asynchronously (correct)
    • Encrypts traffic
    • Balances CPU load
  45. What is the publish-subscribe pattern?

    • A client polls a server
    • Two servers share a database
    • Publishers send messages to topics and all subscribers receive them (correct)
    • A user subscribes to email
  46. What is idempotency in an API?

    • The request is cached
    • The request is very fast
    • The request needs authentication
    • Repeating the same request has the same effect as doing it once (correct)
  47. Which HTTP method should be idempotent by definition?

    • POST
    • PUT (correct)
    • CONNECT
    • PATCH always
  48. What is a health check?

    • A doctor's visit
    • A security audit
    • A code review
    • A periodic request to see if a service is working (correct)
  49. What is round-robin load balancing?

    • Sending all traffic to one server
    • Sending each new request to the next server in turn (correct)
    • Sending to the closest datacenter only
    • Choosing a random user
  50. What is an API gateway?

    • A frontend framework
    • A single entry point that routes requests to backend services (correct)
    • A database
    • A firewall only
  51. What is rate limiting?

    • Limiting the database size
    • Compressing responses
    • Making the server faster
    • Restricting how many requests a client can make in a period (correct)
  52. What is the purpose of a unique ID generator in distributed systems?

    • Encrypting passwords
    • Creating IDs that never collide across many servers (correct)
    • Counting users
    • Naming servers
  53. What is a URL shortener's core operation?

    • Compressing web pages
    • Redirecting emails
    • Encrypting URLs
    • Mapping a short code to a long URL (correct)
  54. What is the difference between strong and eventual consistency?

    • Eventual consistency is always faster to write and read correctly
    • Strong consistency returns the latest write; eventual consistency may return stale data briefly (correct)
    • Strong consistency loses data
    • They are identical
  55. What is a quorum in distributed databases?

    • A backup node
    • The minimum number of nodes that must agree on a read or write (correct)
    • The total number of nodes
    • The leader node
  56. With N replicas, which condition on R and W ensures reads see the latest write?

    • R + W > N (correct)
    • R + W < N
    • R = W = 1
    • R > N
  57. What is leader election?

    • Picking the fastest server for a request
    • Voting by users
    • Choosing a database type
    • Choosing one node to coordinate the others (correct)
  58. What is the purpose of the Raft or Paxos algorithm?

    • Compressing files
    • Load balancing
    • Reaching consensus among distributed nodes (correct)
    • Sorting data
  59. What is a write-back (write-behind) cache?

    • Writes go to the cache first and are saved to the database later (correct)
    • Writes skip the cache
    • The cache is read-only
    • Writes go to both at once
  60. What is the thundering herd problem?

    • Too many servers start together
    • A slow disk
    • A network storm
    • Many clients hit the backend at once, for example when a popular cache key expires (correct)
  61. What is the purpose of a dead-letter queue?

    • Speeding up delivery
    • Encrypting messages
    • Holding messages that could not be processed after retries (correct)
    • Deleting old messages
  62. What is backpressure?

    • A cache miss
    • A way for a slow consumer to signal producers to slow down (correct)
    • Network congestion
    • A failed write
  63. What does a bloom filter tell you?

    • The exact count of items
    • The order of items
    • Whether an item is definitely not in a set or possibly in it (correct)
    • The size of items
  64. What is the saga pattern used for?

    • Caching data
    • Load balancing
    • Logging errors
    • Managing a transaction that spans several services with compensating actions (correct)
  65. What is CQRS?

    • Separating the models for reading data and writing data (correct)
    • A replication method
    • A cache algorithm
    • A type of SQL query
  66. What is event sourcing?

    • Storing state changes as an append-only log of events (correct)
    • Sourcing data from users
    • Sending events by email
    • Logging errors only
  67. What is a hot partition (hot shard)?

    • A deleted shard
    • A shard receiving far more traffic than the others (correct)
    • A shard that overheats
    • A new shard
  68. What is exponential backoff?

    • Retrying immediately forever
    • Doubling the number of servers
    • Waiting longer after each failed retry (correct)
    • Reducing timeouts
  69. Which component would you use to fan out notifications to millions of users?

    • A message queue with many worker consumers (correct)
    • A single cron job on one server
    • A CDN only
    • A larger database
  70. What does a geohash or quadtree help with?

    • Encrypting coordinates
    • Sorting users by name
    • Compressing images
    • Finding nearby locations efficiently (correct)