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
43 practiced
Model geospatial data to support proximity queries at scale (e.g., find nearest restaurants within 5 km). Discuss coordinate representation options (lat/long, geohash, S2 cells), indexing approaches (R-tree/GiST, geohash prefix), sharding and partitioning by geography, and techniques to minimize false positives and extra distance calculations.
HardSystem Design
34 practiced
Design a zero-downtime online schema migration plan for a live PostgreSQL database with millions of rows. Include steps for adding a new non-null column and backfilling data in the background, using views or triggers during migration, rolling back safely, and what metrics and alerts you would monitor during the migration.
HardTechnical
35 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.
EasyTechnical
44 practiced
What is a database index? Explain at a high level how B-tree indexes and hash indexes are structured, their typical use-cases, and limitations (for example, range scans, ordering, partial matches). Give examples of queries that benefit from each index type.
MediumTechnical
55 practiced
Compare pagination strategies for large datasets: OFFSET/LIMIT vs keyset (seek) pagination. Provide example SQL for keyset pagination on table orders(id BIGINT, created_at timestamptz) that returns the next page after a known last (id, created_at). Explain how keyset avoids large offsets and why index choice matters.

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.