Database Selection and Trade-offs Questions
Choosing the right database and data platform for a workload: relational versus NoSQL versus specialized stores, managed versus self-hosted, and matching technology to consistency, scale, cost, and query needs. Covers structuring the decision, naming trade-offs, and defending a recommendation. A judgment-heavy interview surface for architects and senior engineers.
You're designing storage for user activity logs that must support (A) ad-hoc analytics and complex queries, and (B) extremely high write throughput with simple access patterns. Compare when to choose a relational database (PostgreSQL) versus a key-value/NoSQL store (DynamoDB). Discuss data model flexibility, transactional guarantees, secondary indexes, scaling patterns, operational cost, and provide a recommended choice for scenario A and scenario B with rationale.
Design a robust batch ETL process to load daily CSV files (hundreds of millions of rows per day) into a PostgreSQL analytical schema for downstream modeling. Include steps for ingestion, validation, deduplication, schema evolution, idempotency, and performance optimizations (bulk load, partitioning). Assume files land in S3 and processing will run on a cluster.
Your training dataset occasionally differs between staging and production because source databases are eventually consistent. As a data scientist, how would you detect, quantify, and fix these discrepancies to ensure reproducible model training and correct evaluation metrics?
A query on production Postgres is slow. Describe step-by-step how you would use EXPLAIN and EXPLAIN ANALYZE, collect planner statistics, identify common causes (sequential scan, bad index choice, large joins, mismatched data types), and propose fixes (indexes, rewritten query, stats updates, partitioning).
Design a feature store that supports both offline feature generation (for training) and online low-latency serving. Describe technology choices for offline store (Parquet on S3, Hive/Delta), online store (Redis, DynamoDB), feature versioning and lineage, freshness guarantees, and how you would keep them consistent.
Unlock Full Question Bank
Get access to all Database Selection and Trade-offs interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.