๐ŸŒ System Design ยท subject

System Design Reliability, Security, and Operations Syllabus

The Reliability, Security, and Operations syllabus for System Design in full: 5 chapters and 19 topics, every one listed below, plus 66 Reliability, Security, and Operations flashcards with answers.

5Chapters
19Topics
66Flashcards

Reliability, Security, and Operations syllabus: all 5 chapters

Expand any chapter to see its topics and sub-topics.

  1. High Availability and Disaster Recovery

    4 topics
    • Redundancy and Failover Strategies
    • Active-Active vs Active-Passive
    • Multi-Region and Multi-AZ Deployments
    • Backups, RPO, and RTO
  2. Observability and Monitoring

    3 topics
    • Metrics, Logs, and Traces
    • Alerting and On-Call
    • Health Checks and Heartbeats
  3. Security Fundamentals

    4 topics
    • Authentication and Authorization
    • Encryption in Transit and at Rest
    • DDoS Protection and WAF
    • Secure Design Principles and Least Privilege
  4. Deployment and Infrastructure

    4 topics
    • Containers and Orchestration with Kubernetes
    • Deployment Strategies
    • Infrastructure as Code
    • CI/CD Pipelines
  5. Distributed System Challenges

    4 topics
    • Clock Synchronization and Logical Clocks
    • Unique ID Generation
    • Handling Failures and Network Partitions
    • Chaos Engineering

System Design Reliability, Security, and Operations flashcards โ€” 66 questions with answers

  1. What is the difference between redundancy and failover?

    Redundancy is having duplicate components (extra capacity/replicas) so no single component is a single point of failure. Failover is the process/mechanism that detects a component failure and switches traffic to a redundant standby. Redundancy is the state; failover is the action that exploits it.

  2. Define N+1, N+2, and 2N redundancy.

    N is the capacity needed to run the workload. N+1 provides one extra unit beyond need (survives 1 failure). N+2 provides two extra units (survives 2 concurrent failures). 2N is full duplication โ€” a complete second set equal to N (survives loss of an entire set).

  3. Compare Active-Active and Active-Passive failover configurations.

    Active-Active: all nodes serve traffic simultaneously, load is balanced across them, giving better resource utilization and instant failover, but requires state synchronization/conflict handling. Active-Passive: only the primary serves traffic while the standby waits idle; on failure traffic fails over to the passive node. Simpler, but wastes standby capacity and has failover delay.

  4. What is a 'hot' vs 'warm' vs 'cold' standby?

    Hot standby: fully running and continuously synced, takes over almost instantly (lowest RTO). Warm standby: running but partially synced/scaled down, needs some time to take over. Cold standby: powered off or unprovisioned, must be started and loaded before use (longest RTO, lowest cost).

  5. What is a Multi-AZ deployment and what failure does it protect against?

    A Multi-AZ (Availability Zone) deployment spreads resources across multiple isolated data centers within the same region, each with independent power, cooling, and networking. It protects against the failure of a single data center/AZ (e.g., power loss, fire) while keeping low inter-AZ latency.

  6. What is a Multi-Region deployment and what does it protect against that Multi-AZ does not?

    Multi-Region spreads resources across geographically distant regions. Beyond AZ-level failures, it protects against an entire region outage and reduces latency for globally distributed users. It also aids data-residency compliance, at the cost of higher cross-region latency and replication complexity.

  7. Why is cross-AZ communication generally preferred over cross-region for synchronous replication?

    AZs within a region are connected by low-latency, high-bandwidth links (typically single-digit milliseconds), so synchronous replication adds little latency. Cross-region links have much higher latency (tens to hundreds of ms), making synchronous replication expensive and slow, so regions usually use asynchronous replication.

  8. Define RPO (Recovery Point Objective).

    RPO is the maximum acceptable amount of data loss measured in time โ€” how far back in time your recovery point can be. It answers 'how much data can we afford to lose?' An RPO of 1 hour means backups/replication must be at most 1 hour behind.

  9. Define RTO (Recovery Time Objective).

    RTO is the maximum acceptable duration to restore service after a failure โ€” how long the system can be down. It answers 'how quickly must we recover?' An RTO of 15 minutes means service must be back within 15 minutes of an outage.

  10. How do RPO and RTO relate to backup frequency and recovery mechanism?

    RPO is driven by how often you back up/replicate data (more frequent = smaller RPO, less data loss). RTO is driven by how fast you can restore/failover (hotter standby, faster restore = smaller RTO). Lower RPO and RTO both cost more.

  11. Contrast full, incremental, and differential backups.

    Full: copies all data every time โ€” largest, slowest, but self-contained restore. Incremental: copies only data changed since the last backup (full or incremental) โ€” smallest/fastest, but restore requires the full plus every increment in order. Differential: copies all data changed since the last full backup โ€” larger than incremental but restore needs only the full plus one differential.

  12. What is the 3-2-1 backup rule?

    Keep at least 3 copies of your data, on 2 different types of storage media, with 1 copy stored off-site (e.g., a different region or cloud). This protects against media failure, site disasters, and single-location loss.

  13. Name the three pillars of observability.

    Metrics, logs, and traces. Metrics are aggregated numeric measurements over time; logs are discrete timestamped event records; traces follow a single request across services showing spans and timing.

  14. What distinguishes a metric from a log from a trace?

    A metric is a numeric value sampled/aggregated over time (e.g., request rate, CPU%), cheap to store. A log is a discrete, often textual record of a specific event with context. A trace records the end-to-end path of one request through a distributed system as a tree of spans, showing where latency is spent.

  15. In distributed tracing, what are a trace, a span, and a trace/context propagation?

    A trace is the whole journey of one request. A span is a single named, timed operation within that trace (e.g., a DB call), with parent-child relationships. Context propagation passes the trace ID and span ID across service boundaries (usually via headers) so spans can be stitched into one trace.

  16. What are the four 'golden signals' of monitoring (per Google SRE)?

    Latency (time to serve a request), Traffic (demand on the system, e.g., requests/sec), Errors (rate of failed requests), and Saturation (how full the system is, e.g., resource utilization). Monitoring these four gives strong coverage of service health.

  17. What is the difference between an SLI, an SLO, and an SLA?

    SLI (Service Level Indicator): a measured metric of service quality (e.g., % of successful requests). SLO (Objective): the internal target for an SLI (e.g., 99.9% success). SLA (Agreement): a contractual promise to customers with consequences (penalties) if the SLO-like target is missed. SLA is usually looser than the internal SLO.

  18. What is an error budget and how is it calculated from an SLO?

    An error budget is the allowed amount of unreliability = $1 - \text{SLO}$. For a 99.9% availability SLO, the error budget is $0.1\%$ of requests/time. If monthly (~30 days), that is about $43.2$ minutes of allowed downtime. When the budget is exhausted, teams freeze risky releases.

  19. Roughly how much downtime per year corresponds to 'three nines', 'four nines', and 'five nines' availability?

    99.9% (three nines) โ‰ˆ 8.76 hours/year. 99.99% (four nines) โ‰ˆ 52.6 minutes/year. 99.999% (five nines) โ‰ˆ 5.26 minutes/year. General formula: $\text{downtime} = (1 - A)\times 525600$ minutes/year.

  20. What is the purpose of alert thresholds, and why prefer symptom-based over cause-based alerting?

    Thresholds trigger alerts when a metric crosses a value indicating a problem. Symptom-based alerting (on user-visible impact like latency/error rate) is preferred because it catches real problems regardless of cause and reduces noise; cause-based alerts (e.g., 'CPU high') may fire without user impact, causing alert fatigue.

Show the other 46 Reliability, Security, and Operations flashcards
  1. What is 'alert fatigue' and how is it mitigated?

    Alert fatigue is desensitization from too many alerts (especially false positives), causing responders to ignore or miss real ones. Mitigations: alert only on actionable, user-impacting symptoms; tune thresholds; deduplicate/group alerts; use severity tiers; and route non-urgent issues to tickets instead of pages.

  2. What are the roles of primary and secondary in an on-call rotation, and what is an escalation policy?

    The primary on-call is first to receive and respond to pages; the secondary is a backup who is paged if the primary doesn't acknowledge within a set time. An escalation policy defines the ordered chain (primary โ†’ secondary โ†’ manager) and timeouts for escalating unacknowledged alerts.

  3. What is a runbook (playbook) in operations?

    A runbook is a documented, step-by-step procedure for diagnosing and resolving a specific alert or incident. It lets on-call engineers respond consistently and quickly without re-deriving the solution, reducing MTTR.

  4. Define MTTR, MTBF, and MTTF.

    MTTR (Mean Time To Recovery/Repair): average time to restore service after a failure. MTBF (Mean Time Between Failures): average operating time between failures for a repairable system. MTTF (Mean Time To Failure): average lifetime of a non-repairable component. Availability $\approx \frac{\text{MTBF}}{\text{MTBF}+\text{MTTR}}$.

  5. What is the difference between a liveness check and a readiness check?

    A liveness check tests whether a process is alive/healthy โ€” if it fails, the orchestrator restarts the instance. A readiness check tests whether the instance is ready to receive traffic โ€” if it fails, the instance is removed from the load balancer but not restarted (e.g., still warming up or a dependency is down).

  6. What is a heartbeat in distributed systems?

    A heartbeat is a periodic 'I'm alive' signal a node sends (or a monitor polls) at a fixed interval. Missing a configured number of consecutive heartbeats marks the node as failed/dead, triggering failover or removal. It is the basis of failure detection.

  7. What is the trade-off in setting the heartbeat timeout/interval?

    A short timeout detects failures fast but risks false positives (marking a slow/temporarily-partitioned node as dead), causing unnecessary failovers. A long timeout avoids false positives but delays detection, increasing downtime. The value balances detection speed against network jitter and load variability.

  8. What is the difference between authentication and authorization?

    Authentication (AuthN) verifies who you are (identity โ€” e.g., password, token, certificate). Authorization (AuthZ) determines what you are allowed to do (permissions/access to resources). Authentication always precedes authorization.

  9. Compare RBAC and ABAC access control models.

    RBAC (Role-Based Access Control) grants permissions to roles, and users get permissions by being assigned roles โ€” simple and coarse-grained. ABAC (Attribute-Based Access Control) makes decisions from attributes of the user, resource, action, and environment via policies โ€” fine-grained and context-aware but more complex to manage.

  10. What is the difference between OAuth 2.0 and OpenID Connect (OIDC)?

    OAuth 2.0 is an authorization framework: it issues access tokens so a client can access resources on a user's behalf (delegated access). OIDC is an authentication layer built on top of OAuth 2.0 that adds an ID token (a JWT) proving the user's identity. OAuth = authorization; OIDC = authentication.

  11. What are the three parts of a JWT and what is each for?

    A JWT has three Base64URL-encoded parts separated by dots: Header (algorithm and token type), Payload (claims such as subject, expiry, roles), and Signature (a MAC/signature over header+payload used to verify integrity and authenticity). Only the signature โ€” not the payload โ€” is protected from tampering; the payload is not encrypted by default.

  12. Distinguish encryption in transit from encryption at rest.

    Encryption in transit protects data moving over a network (e.g., TLS/HTTPS) from eavesdropping and tampering on the wire. Encryption at rest protects stored data (disks, databases, backups) so it is unreadable if the storage medium is stolen or accessed directly. Comprehensive security needs both.

  13. What is the difference between symmetric and asymmetric encryption, and how does TLS use both?

    Symmetric encryption uses one shared key for encrypt and decrypt (fast, e.g., AES). Asymmetric uses a public/private key pair (slower, e.g., RSA/ECC). TLS uses asymmetric crypto during the handshake to authenticate and securely exchange/derive a symmetric session key, then uses the fast symmetric key for the bulk data โ€” combining the strengths of both.

  14. What does a TLS handshake accomplish?

    It authenticates the server (and optionally the client) via certificates, negotiates the protocol version and cipher suite, and establishes a shared symmetric session key (e.g., via ephemeral Diffie-Hellman) โ€” providing confidentiality, integrity, and authenticity for the subsequent session, plus forward secrecy when ephemeral keys are used.

  15. What is a DDoS attack and what are the broad categories?

    A Distributed Denial-of-Service attack overwhelms a target with traffic from many sources to exhaust resources and deny legitimate users. Categories: volumetric (saturate bandwidth, e.g., UDP floods, amplification), protocol/state-exhaustion (e.g., SYN floods exhausting connection tables), and application-layer (Layer 7, e.g., HTTP floods mimicking real requests).

  16. What is a WAF and what layer/threats does it address?

    A Web Application Firewall operates at Layer 7 (HTTP/HTTPS), inspecting request content to block application-layer attacks like SQL injection, XSS, and malicious payloads using rule sets. Unlike a network firewall (L3/L4), it understands web semantics; it complements but does not replace network-level DDoS protection.

  17. How does rate limiting help mitigate DDoS and abuse, and name one algorithm.

    Rate limiting caps the number of requests a client (IP/user/key) can make per time window, throttling floods and abusive callers while allowing normal use. Common algorithms: token bucket, leaky bucket, fixed window, and sliding window log/counter. Token bucket allows bursts up to bucket size while enforcing an average rate.

  18. State the Principle of Least Privilege.

    Every user, process, or component should be granted only the minimum permissions necessary to perform its function, and nothing more. This limits the blast radius of compromised or misused credentials by reducing what an attacker can reach.

  19. What is defense in depth?

    A security strategy of layering multiple independent controls (network firewalls, WAF, authn/authz, encryption, monitoring, least privilege) so that if one layer is breached, others still protect the system. No single control is a single point of failure for security.

  20. What do 'fail secure / fail closed' and 'secure by default' mean as secure design principles?

    Fail secure (fail closed) means that when a component fails or is uncertain, it denies access rather than granting it (default deny). Secure by default means the out-of-the-box configuration is the safe one (e.g., encryption on, ports closed), so security doesn't depend on the user hardening it.

  21. In Kubernetes, what is a Pod and how does it relate to containers?

    A Pod is the smallest deployable unit in Kubernetes. It wraps one or more tightly coupled containers that share the same network namespace (IP/port space) and can share storage volumes. Containers in a Pod are always co-scheduled on the same node and scaled together.

  22. What are the roles of the kube-scheduler, kubelet, and etcd in Kubernetes?

    kube-scheduler assigns unscheduled Pods to suitable nodes based on resources/constraints. kubelet is the per-node agent that starts/monitors the containers for Pods assigned to its node. etcd is the distributed key-value store holding all cluster state (the single source of truth) for the control plane.

  23. What is a Kubernetes Deployment vs a ReplicaSet vs a Service?

    A ReplicaSet ensures a specified number of identical Pod replicas are running. A Deployment manages ReplicaSets to provide declarative updates and rolling upgrades/rollbacks. A Service provides a stable virtual IP/DNS name and load-balances traffic across the matching Pods, decoupling clients from ephemeral Pod IPs.

  24. What does the Horizontal Pod Autoscaler (HPA) do?

    The HPA automatically scales the number of Pod replicas up or down based on observed metrics (e.g., CPU utilization or custom metrics) against a target, so capacity tracks load. It changes replica count, unlike the Vertical Pod Autoscaler which changes per-Pod resource requests/limits.

  25. Compare rolling, blue-green, and canary deployment strategies.

    Rolling: gradually replace old instances with new ones in batches โ€” no extra full environment, but old and new run together briefly. Blue-green: run two full environments (blue=current, green=new); switch all traffic at once and roll back by switching back โ€” fast rollback, double resources. Canary: release the new version to a small % of traffic first, monitor, then gradually ramp โ€” limits blast radius of a bad release.

  26. What is a feature flag and how does it decouple deployment from release?

    A feature flag is a runtime toggle that turns a code path on/off without redeploying. It lets teams deploy code to production dark (disabled) and later release (enable) it โ€” possibly to a subset of users โ€” enabling canary releases, A/B tests, and instant kill-switch rollback independent of the deploy pipeline.

  27. What is Infrastructure as Code (IaC) and its key benefits?

    IaC is managing and provisioning infrastructure through machine-readable definition files rather than manual configuration. Benefits: version control, repeatability/consistency across environments, automated and auditable changes, easy disaster recovery/rebuild, and code review of infrastructure changes.

  28. What is the difference between declarative and imperative IaC, and between provisioning and configuration-management tools?

    Declarative IaC specifies the desired end state and the tool computes how to reach it (e.g., Terraform); imperative specifies the exact steps/commands to execute. Provisioning tools (e.g., Terraform, CloudFormation) create infrastructure resources; configuration-management tools (e.g., Ansible, Chef, Puppet) configure software on existing machines. They are complementary.

  29. What is the difference between immutable and mutable infrastructure?

    Mutable infrastructure is updated in place (patch/config existing servers), risking configuration drift and snowflake servers. Immutable infrastructure never modifies running servers โ€” to change anything you build a new image/instance and replace the old one, guaranteeing consistency and easy rollback by redeploying a prior image.

  30. What is the difference between Continuous Integration, Continuous Delivery, and Continuous Deployment?

    Continuous Integration (CI): developers merge to a shared branch frequently, each change auto-built and tested. Continuous Delivery: every passing build is automatically prepared and can be released to production with a manual approval click. Continuous Deployment: every passing build is automatically released to production with no manual gate.

  31. What are typical stages of a CI/CD pipeline?

    Source/trigger (commit or PR) โ†’ Build (compile, package artifacts) โ†’ Test (unit, integration, security/lint scans) โ†’ Artifact/publish (store image) โ†’ Deploy to staging โ†’ Automated acceptance/smoke tests โ†’ Deploy to production (with a strategy like canary), often followed by monitoring/rollback. Each stage gates the next.

  32. Why is clock synchronization hard in distributed systems, and what does NTP provide?

    Each machine has its own physical clock that drifts, and message delays are variable, so no two clocks agree exactly. NTP (Network Time Protocol) synchronizes clocks against reference time servers, estimating and correcting offset and round-trip delay, typically achieving millisecond-level accuracy โ€” but it cannot guarantee perfectly synchronized clocks, so ordering by wall-clock timestamps is unreliable.

  33. What problem do Lamport logical clocks solve, and what is their key rule?

    Lamport clocks provide a consistent logical ordering of events without synchronized physical clocks, capturing the 'happens-before' relation. Rule: each process increments its counter on every event; when sending a message it attaches its counter; on receipt the receiver sets its counter to $\max(\text{local}, \text{received}) + 1$. If event $a$ happens-before $b$, then $C(a) < C(b)$.

  34. What is the limitation of Lamport clocks that vector clocks overcome?

    With Lamport clocks, $a \to b$ implies $C(a) < C(b)$, but the converse fails: $C(a) < C(b)$ does not tell you whether $a$ happened-before $b$ or they are concurrent. Vector clocks (a per-process counter vector) capture causality exactly, letting you detect concurrency: two events are concurrent iff neither vector dominates the other.

  35. Why not use a single centralized auto-increment counter for unique ID generation in a distributed system?

    A single central counter is a single point of failure and a scalability/throughput bottleneck: every ID request must round-trip to it, and it can't keep up at scale or across regions. Distributed systems instead use schemes (UUIDs, Snowflake, ranges/tickets) that generate IDs locally without global coordination.

  36. Describe how a Twitter Snowflake ID is structured.

    A Snowflake ID is a 64-bit integer, typically: 1 unused sign bit, a 41-bit timestamp (milliseconds since a custom epoch), a ~10-bit machine/worker ID, and a ~12-bit per-millisecond sequence number. This yields globally unique, roughly time-sortable (k-sorted) IDs generated locally without central coordination, with up to $2^{12}=4096$ IDs per machine per millisecond.

  37. What are the trade-offs of UUIDs vs Snowflake-style IDs?

    UUIDs (128-bit) are generated with no coordination and are collision-safe, but are large and random (v4) โ€” poor for database index locality and not time-ordered. Snowflake IDs are 64-bit, compact, and time-sortable (good index locality), but require coordinated worker-ID assignment and depend on clock behavior (clock skew/rollback can cause issues).

  38. State the CAP theorem.

    In a distributed data store, during a network Partition you cannot have both Consistency (every read sees the latest write) and Availability (every request gets a non-error response). You must choose: a CP system rejects/blocks requests to stay consistent, or an AP system stays available but may return stale data. Without a partition, you can have both C and A.

  39. What is a network partition (split-brain) and why is it dangerous?

    A network partition is when a failure splits nodes into groups that cannot communicate. Split-brain occurs when both sides independently believe they are the primary and accept writes, leading to divergent, conflicting state and data corruption. It is prevented with quorum/consensus so only one side (the majority) can act.

  40. How does quorum prevent split-brain, and what is the majority quorum condition?

    By requiring an action (e.g., electing a leader or committing a write) to be approved by a majority of nodes, only the partition containing more than half the nodes can proceed; the minority side cannot form a quorum and stops accepting writes. For a cluster of $N$ nodes the majority quorum is $\lfloor N/2 \rfloor + 1$, which is why clusters use an odd node count.

  41. What is the quorum condition for consistency using read/write quorums (W + R > N)?

    In a replicated store with $N$ replicas, if every write must be acknowledged by $W$ replicas and every read must query $R$ replicas, then setting $W + R > N$ guarantees the read set overlaps the latest write set, so a read sees the most recent write. Tuning $W$ and $R$ trades off read vs write latency and availability.

  42. What is the difference between failover and failback?

    Failover is switching operation from a failed primary to a standby/secondary to keep service running. Failback is the subsequent, controlled switch back to the original (now-recovered) primary once it is healthy, restoring the normal configuration โ€” often done during a low-traffic window to avoid another disruption.

  43. What is graceful degradation and how does it improve reliability?

    Graceful degradation is designing a system to keep providing reduced but useful functionality when some components fail or are overloaded, instead of failing completely โ€” e.g., serving cached/stale data, disabling non-essential features, or returning default responses. It preserves core user value and contains the impact of partial failures.

  44. What is a circuit breaker pattern and its three states?

    A circuit breaker wraps calls to a failing dependency to prevent cascading failures. States: Closed (calls pass through; failures counted), Open (failure threshold exceeded โ†’ calls fail fast without contacting the dependency, giving it time to recover), and Half-Open (after a timeout, a few trial calls test recovery; success closes the breaker, failure re-opens it).

  45. What is the difference between a leader-based (single-leader) and leaderless replication approach for handling writes?

    Single-leader: all writes go through one leader that orders them and replicates to followers โ€” simple consistency and ordering, but the leader is a bottleneck and a failover point. Leaderless (e.g., Dynamo-style): any replica accepts writes and the system uses quorums and conflict resolution (versioning/read-repair) โ€” higher availability during failures but requires handling conflicts and eventual consistency.

  46. Why is exponential backoff with jitter used when retrying failed requests?

    Exponential backoff increases the wait between retries multiplicatively (e.g., $base \cdot 2^{n}$) to avoid hammering a struggling service. Jitter adds randomness to the delay so that many clients don't retry in synchronized waves (the 'thundering herd'), which would otherwise re-overload the recovering service. Together they spread retries out and improve recovery.

System Design Reliability, Security, and Operations FAQ

What is in the System Design Reliability, Security, and Operations syllabus?

System Design Reliability, Security, and Operations is split into 5 chapters: High Availability and Disaster Recovery, Observability and Monitoring, Security Fundamentals, Deployment and Infrastructure and Distributed System Challenges. Together they contain 19 topics.

How many chapters are in System Design Reliability, Security, and Operations?

5 chapters, containing 19 topics. The largest chapter is High Availability and Disaster Recovery, with 4 topics.

Are there flashcards for System Design Reliability, Security, and Operations?

Yes โ€” a 66-card Reliability, Security, and Operations deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.