InterviewStack.io LogoInterviewStack.io

Data Model Design and Access Patterns Questions

Discuss how you'd design data models based on access patterns. Understand relational vs. NoSQL trade-offs. Know when to denormalize, how to handle distributed transactions, and strategies for scaling databases (sharding, partitioning). Discuss read vs. write optimization.

HardTechnical
0 practiced
A popular product row becomes a hotspot with thousands of concurrent reads and updates, causing locks, contention, and degraded performance. Propose a multi-layer mitigation plan: data-model changes (sharded counters, per-region aggregates), access-pattern changes (request coalescing, batching, optimistic concurrency), and infrastructure changes (read-replicas, write routing). Analyze trade-offs and implementation complexity.
MediumTechnical
0 practiced
Design data models for follower lists where users frequently read their followers. Compare storing follower arrays on the user document, a separate follower table, and materialized follower views. Discuss fan-out-on-write versus fan-out-on-read trade-offs, pagination at scale, and how to handle users with millions of followers.
HardTechnical
0 practiced
Design an algorithm and data model to transfer funds between two accounts located on different shards while preserving the invariant that the total balance across the two accounts remains constant. Avoid global locking—explain how you handle idempotency, retries, failure recovery, and analyze expected throughput and latency trade-offs.
MediumTechnical
0 practiced
Compare storing high-cardinality time-series in wide relational tables, specialized time-series DBs (e.g., TimescaleDB, InfluxDB), and columnar/OLAP stores. Discuss ingestion rates, compression, query patterns for aggregations, downsampling, and operational cost trade-offs for each choice.
HardTechnical
0 practiced
Your system uses distributed two-phase commit (2PC) and suffers high latency and blocking during failures. Propose an alternative design using Sagas. Compare choreography vs orchestration styles, design the saga tracking data model, show how to implement compensating transactions and idempotency, and outline how partial failures are recovered.

Unlock Full Question Bank

Get access to hundreds of Data Model Design and Access Patterns interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.