System Design Flashcards

1
Q

ACID

A

ACID:
- Atomicity
- Consistency
- Isolation
- Durability

(traditional RDBMS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

ACID vs. BASE

A
  • ACID ensures strong consistency.
  • BASE favors availability and partition tolerance.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

BASE

A

BASE:
- Basically Available
- Soft state
- Eventual consistency

(NoSQL)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

ACID applies to ___ DBMS

A

Traditional Relational

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

BASE applies to ___ DB

A

NoSQL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Microservice

A

Microservices: small, independently deployable services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Monolith

A

Monolith: single deployable artifact with all functionality.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Microservices vs. Monolith

A

Microservices scale independently but add complexity in communication and deployment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

REST

A

REST: resource-based, typically over HTTP with JSON.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

RPC

A

RPC: direct function calls (e.g., gRPC) often with protocol buffers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

REST vs. RPC

A
  • REST is simpler, more flexible.
  • RPC can be more efficient and strongly typed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

CAP Theorem

A

Definition:
In a distributed system, you can guarantee ONLY TWO of:

  • Consistency
  • Availability
  • Partition Tolerance

If a network is partitioned, systems choose to be CP (consistent, not fully available) or AP (available, not fully consistent).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

AP systems are ___ but not ___ (Partitioned network)

A

AP systems are AVAILABLE but not fully CONSISTENT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

CP systems are ___ but not ___ (Partitioned network)

A

CP systems are CONSISTENT but not fully AVAILABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Scaling - Horizontal

A

Horizontal: adding more machines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Scaling - Vertical

A

Vertical: adding more resources (CPU/RAM) to existing machines

17
Q

Horizontal vs. Vertical Scaling

A

Horizontal scaling is generally better for elasticity and resilience.

Definitions:
- Horizontal: adding more machines.
- Vertical: adding more resources (CPU/RAM) to existing machines.

18
Q

Load Balancer

A

Definition:
Distributes network or application traffic across multiple servers.

  • Improves scalability, fault tolerance, and availability.
  • Can operate at different layers (L4 vs. L7).
19
Q

Rate Limiter

A

Definition:
A mechanism or service that limits the number of requests a client can make in a defined time window.

  • Prevents abuse or DoS (Denial of Service) attacks by throttling excessive requests.
  • Common algorithms include Token Bucket or Leaky Bucket.
20
Q

Redis

A

Definition:
An in-memory key-value data store used for caching, messaging, and fast data operations.

  • Offers high throughput and low latency.
  • Supports data structures (strings, lists, sets, hashes) and persistence options.
  • Often used for session management, leaderboards, rate limiting, etc.
21
Q

APIs

A

Definition:
Application Programming Interfaces provide a contract for how different software components communicate.

  • Often exposed as REST, SOAP, GraphQL, or gRPC endpoints.
  • Require versioning, authentication, and rate limiting considerations in production.
22
Q

Transactions

A

Definition:
A sequence of operations performed as a single logical unit of work, which must either fully complete or fully fail (rollback).

  • In relational databases, transactions follow ACID properties.
  • Distributed transactions can be more complex (e.g., two-phase commit).
23
Q

Primary Key

A

Definition:
A column (or set of columns) in a relational table that uniquely identifies each row.

  • Ensures uniqueness of records.
  • Cannot contain NULL (in most SQL implementations).
  • Often indexed for fast lookups.
24
Q
A