More in Databases & Architecture — page 4
Least privilege for database service accounts
WHAT IT TESTS: secure access design. OUTLINE: grant each account only the minimum rights its job needs; for an app service account, scope grants to specific tables and verbs, never use the superuser.
Full, differential, and incremental backups
WHAT IT TESTS: backup-strategy tradeoffs. OUTLINE: full copies everything; differential copies all changes since the last full; incremental copies changes since the last backup of any type.
Mitigating a database shard hot spot
WHAT IT TESTS: load-distribution remedies. OUTLINE: short-term, add read replicas or cache the hot keys; long-term, fix the partition key with hashing, salting, or finer-grained splitting. RED FLAG: only adding hardware without addressing the skewed key.
Split-brain, consensus, and quorum
WHAT IT TESTS: partition handling. OUTLINE: split-brain is two nodes both believing they are leader during a partition; Raft/Paxos require a majority quorum to elect a leader and commit, so the minority side cannot make progress.
Durable write path in a sharded KV store
WHAT IT TESTS: end-to-end durable write design. OUTLINE: route by key hash to the shard leader, append to WAL and fsync, replicate to two followers, ack on quorum, then confirm. RED FLAG: confirming the client before any durable persistence.
What is eventual consistency?
WHAT IT TESTS: consistency-model tradeoffs. OUTLINE: replicas converge to the same value if writes stop, allowing temporary staleness for higher availability and lower latency. RED FLAG: claiming it means data is wrong or never converges.
Leader-follower vs multi-leader replication
WHAT IT TESTS: replication topology tradeoffs. OUTLINE: single-writer leader-follower is simple but a write bottleneck; multi-leader accepts writes in many regions for latency and availability. RED FLAG: ignoring that multi-leader needs conflict resolution.
Range-based vs hash-based sharding trade-offs?
WHAT IT TESTS: choosing a shard strategy by query pattern. OUTLINE: range sharding keeps ordered keys together, great for range scans but prone to hot spots on sequential keys; hash sharding spreads keys evenly, avoiding hot spots but killing efficient range…
Apply the CAP theorem to a real system
WHAT IT TESTS: applying CAP to concrete systems. OUTLINE: define C, A, P; note partitions are unavoidable, so the real choice during one is consistency versus availability; then classify a system as CP or AP with reasoning.
What is sharding and why shard over vertical scaling?
WHAT IT TESTS: horizontal partitioning rationale. OUTLINE: sharding splits one dataset across servers by a shard key so each holds a subset; you shard because vertical scaling hits hardware ceilings, gets costly, and remains a single point of failure.
What is database replication and why use it?
WHAT IT TESTS: basics of copying data across nodes. OUTLINE: replication keeps copies of data on multiple servers; primary benefits are high availability through failover and improved read scalability by spreading reads.
What is an OLAP cube and its operations?
WHAT IT TESTS: multidimensional analysis concepts. OUTLINE: a cube pre-aggregates measures across dimensions; operations are slice, dice, drill-down, roll-up, and pivot.
Why separate storage and compute in a cloud warehouse?
WHAT IT TESTS: understanding decoupled warehouse architecture. OUTLINE: data lives in cheap shared object storage while independent compute clusters scale separately, enabling elastic, concurrent, isolated workloads and pay-per-use.
What is a Type 2 slowly changing dimension?
WHAT IT TESTS: preserving history in dimensional models. OUTLINE: an SCD handles dimension attributes that change over time; Type 2 inserts a new row per change with a surrogate key and validity dates, marking one current.
How does columnar storage speed up analytics?
WHAT IT TESTS: physical storage layout versus query type. OUTLINE: columnar stores each column contiguously, so aggregations read only needed columns, scan far less data, and compress better with vectorized execution.
Star schema vs snowflake schema trade-offs?
WHAT IT TESTS: dimensional design trade-offs. OUTLINE: star keeps dimensions denormalized for fewer joins and faster simpler queries; snowflake normalizes dimensions into sub-tables saving space and easing maintenance but adding joins.
What is the difference between ETL and ELT?
WHAT IT TESTS: knowing where transformation runs in a pipeline. OUTLINE: ETL transforms before loading, on a separate engine; ELT loads raw then transforms inside a scalable warehouse. Choose ELT with cloud warehouses and large raw or schema-on-read data.
What is a star schema?
WHAT IT TESTS: dimensional modeling fundamentals. OUTLINE: a central fact table of measures and foreign keys surrounded by denormalized dimension tables of descriptive attributes, joined in one hop for fast, simple analytical queries.
What is the difference between OLTP and OLAP?
WHAT IT TESTS: understanding two opposite workload profiles. OUTLINE: OLTP handles many short read-write transactions on normalized current data; OLAP runs few large analytical scans over denormalized historical data.
What consistency do you sacrifice in an AP system?
WHAT IT TESTS: precise reasoning about consistency models and anomaly handling. OUTLINE: you give up linearizability and often sequential consistency, accepting stale reads and conflicts, then mitigate with quorums, vector clocks or CRDTs, and…