Luyện 50 câu hỏi phỏng vấn thiết kế hệ thống miễn phí kèm đáp án và giải thích về cân bằng tải, bộ nhớ đệm, cơ sở dữ liệu, hàng đợi, API, độ tin cậy và bảo mật.
Cấp độ: System Design InterviewĐộ khó: medium50 câu hỏi60 phút
Trả lời từng câu hỏi thiết kế hệ thống, sau đó kiểm tra điểm. Câu trả lời sai được lưu cục bộ để ôn lại.
Chuỗi ngày: 0 ngàyChỉ lưu trên thiết bị này
Tiến độ0 / 50
Thời gian còn lại: 00:00
Chưa có câu sai được lưu.
Không có câu hỏi phù hợp với bộ lọc.
Câu hỏi 1
Which component distributes incoming traffic across application servers?
A load balancer distributes requests across healthy servers and supports scaling.
Câu hỏi 2
A load balancer that routes based on URL path and HTTP headers operates at which layer?
Layer 7 load balancers inspect HTTP content such as paths, headers, and cookies.
Câu hỏi 3
What does horizontal scaling add?
Horizontal scaling adds more machines to spread the load across the cluster.
Câu hỏi 4
What does vertical scaling add?
Vertical scaling increases the resources of a single machine, such as CPU, RAM, or disk.
Câu hỏi 5
Which technique is best for reducing repeated expensive computations?
Caching stores results so repeated requests can be served without recomputing them.
Câu hỏi 6
Which cache eviction policy removes the least recently used item first?
LRU removes the item that has not been used for the longest time.
Câu hỏi 7
Why place a CDN in front of static assets?
A CDN serves content from edge locations closer to users, reducing latency.
Câu hỏi 8
What is the primary purpose of DNS?
DNS translates human-readable domain names into IP addresses used for routing.
Câu hỏi 9
Which consistency model guarantees that a read returns the latest committed write?
Strong consistency makes the latest committed write visible to all subsequent reads.
Câu hỏi 10
In the CAP theorem, what does the letter C stand for?
CAP stands for Consistency, Availability, and Partition tolerance. The theorem states that a distributed system can guarantee only two of the three under a network partition. Caching, concurrency, and capacity are related concepts but do not form the CAP acronym.
Câu hỏi 11
Which database scaling method splits rows across multiple servers?
Sharding distributes different subsets of data across separate database nodes.
Câu hỏi 12
Which index type is best for exact key lookups?
Hash indexes provide fast equality lookups for exact keys. They compute a hash of the key to locate the value in constant time, which is ideal for point queries. B-tree scans, linked lists, and text indexes are better suited to ranges, sequences, or full-text search.
Câu hỏi 13
Read replicas mainly help which workload?
Read replicas serve SELECT traffic and reduce pressure on the primary database.
Câu hỏi 14
Which component decouples producers from consumers?
A message queue lets producers send work without waiting for consumers.
Câu hỏi 15
Which pattern moves a long-running task out of the request path?
An async job queue accepts the request, returns quickly, and processes the work in the background.
Câu hỏi 16
What is a dead-letter queue used for?
A dead-letter queue stores messages that cannot be processed successfully after retries.
Câu hỏi 17
What does at-least-once delivery guarantee?
At-least-once delivery ensures messages are not lost but may be delivered more than once.
Câu hỏi 18
An idempotency key helps prevent what?
An idempotency key lets the server recognize and ignore duplicate requests.
Câu hỏi 19
Which API style maps HTTP verbs to resources?
REST uses HTTP verbs such as GET, POST, PUT, and DELETE to operate on resources.
Câu hỏi 20
Which HTTP status code means a resource was created?
HTTP 201 Created indicates that a new resource was successfully created.
Câu hỏi 21
Cursor pagination is more stable than offset pagination when what happens?
Cursors reference a position in the dataset, so new or deleted rows do not shift pages.
Câu hỏi 22
Which mechanism limits abusive API clients?
Rate limiting caps the number of requests a client can send in a time window.
Câu hỏi 23
A token bucket is used for what?
A token bucket permits requests at a controlled rate while allowing short bursts.
Câu hỏi 24
Which storage is best for immutable large media files?
Object storage is designed for large immutable files such as images, videos, and backups.
Câu hỏi 25
Which system is well suited for low-latency session storage?
An in-memory key-value store like Redis provides fast reads and writes for sessions.
Câu hỏi 26
Which database type is best for graph relationships?
Graph databases model nodes and edges, making relationship queries efficient.
Câu hỏi 27
Which microservice property enables independent deployment?
Loosely coupled services can change and deploy without tightly depending on other services.
Câu hỏi 28
Which component centralizes authentication, routing, and rate limiting?
An API gateway handles cross-cutting concerns before requests reach backend services.
Câu hỏi 29
What is a circuit breaker used for?
A circuit breaker stops requests to a failing service and lets it recover.
Câu hỏi 30
Why add jitter to retries?
Random jitter spreads retries so many clients do not retry at the same instant.
Câu hỏi 31
Which telemetry type shows a request path across multiple services?
Distributed tracing follows one request across services and shows where time is spent.
Câu hỏi 32
Which metric best indicates service availability?
Availability is usually expressed as the percentage of time the service is operational.
Câu hỏi 33
Which practice protects data in transit?
TLS encrypts traffic between clients and servers to prevent eavesdropping.
Câu hỏi 34
Which pattern isolates failures between services?
A bulkhead partitions resources so failure in one service does not exhaust the whole system.
Câu hỏi 35
Which strategy handles traffic spikes automatically?
Autoscaling adds or removes instances based on load and keeps capacity aligned with demand.
Câu hỏi 36
Which design improves disaster recovery?
Multi-region replication keeps data available when one region fails. It copies data and workloads to independent geographic locations, enabling failover during a disaster. A single region, no backups, and local-only caches increase the risk of total loss when that region becomes unavailable.
Câu hỏi 37
Which are load-balancing strategies?
Round-robin, least connections, and IP hash are common strategies; DNS-only routing is not a load-balancer algorithm.
Câu hỏi 38
Which are common cache layers in a web system?
CDNs, in-memory caches, and database query caches reduce repeated reads; a relational schema is not a cache.
Câu hỏi 39
Which are database scaling techniques?
Sharding, read replicas, and partitioning spread or offload data; deleting indexes hurts performance.
Câu hỏi 40
Which are message queue features or guarantees?
Queues may provide delivery guarantees, dead-letter handling, and ordered partitions; storage is always finite.
Câu hỏi 41
Which are API gateway responsibilities?
Gateways commonly handle auth, rate limiting, and routing; migrations belong to the data layer.
Câu hỏi 42
Which are observability pillars?
Metrics, logs, and traces are the three observability pillars; feature flags are configuration.
Câu hỏi 43
A single database is usually enough for a global product at scale.
Large global products normally need replicas, shards, or multiple data stores to scale.
Câu hỏi 44
Caching improves read latency but adds consistency complexity.
Caches speed up reads but require invalidation and consistency decisions.
Câu hỏi 45
Microservices should share one relational database by default.
Shared databases create tight coupling and make independent deployment harder.
Câu hỏi 46
Exactly-once delivery is easy to guarantee in distributed messaging.
Distributed systems usually need idempotency and coordination to approximate exactly-once behavior.
Câu hỏi 47
Type the protocol that encrypts web traffic.
TLS encrypts HTTP traffic and is the standard security protocol for the web.
Câu hỏi 48
Type the cache eviction policy that removes least recently used items first.
LRU stands for Least Recently Used and is a common cache eviction policy.
Câu hỏi 49
Match each design concern to the technique that addresses it.
Strong consistency returns the latest write, eventual consistency converges over time, partition tolerance keeps the system working during network splits, and availability means it still responds.