Interview Q&A / System Design

INTERVIEW Q&A · 70 QUESTIONS

System Design interview questions

Caching, scaling, databases and classic design problems for beginners.

  1. What is the CAP theorem, in simple words?

    The CAP theorem says that when a network partition splits a distributed system, it must choose between consistency (every read sees the latest write or gets an error) and availability (every request gets a non-error response, possibly stale). Partitions can't be ruled out, so the real choice is CP or AP during a partition.

    IntermediateIn-depth4 min read
  2. What is the difference between strong and eventual consistency?

    Strong consistency means every read sees the latest completed write. Eventual consistency means replicas may briefly return old data but will all converge to the same value if no new writes arrive.

    BeginnerQuick answer1 min read
  3. In CAP, why is partition tolerance not really a choice?

    Network partitions happen in any real distributed system, so you cannot opt out of P. The real decision is what to do during a partition: refuse some requests to stay consistent (CP) or answer with possibly stale data (AP).

    IntermediateQuick answer1 min read
  4. What is the difference between synchronous and asynchronous replication?

    Synchronous replication makes the leader wait for replicas to confirm before acknowledging a write, so no acknowledged write is lost but writes are slower. Asynchronous replies immediately and replicates later, which is faster but can lose recent writes.

    IntermediateQuick answer1 min read
  5. What is the PACELC theorem and how does it extend CAP?

    PACELC says: if there is a Partition, choose Availability or Consistency; Else, when running normally, choose between Latency and Consistency. It captures that consistency costs latency even when nothing is broken.

    AdvancedQuick answer1 min read
  6. What is the transactional outbox pattern and what problem does it solve?

    It solves the dual-write problem: updating a database and publishing an event can't be atomic. The outbox writes the event into a table in the same database transaction, and a separate process publishes it to the broker.

    AdvancedQuick answer1 min read