Data Warehousing and Data Lakes Questions
Architecture of warehouses, data lakes, and lakehouses: storage-compute separation, medallion/zoned layouts, and when each is appropriate. Covers governance of a lake, table formats, and the trade-offs between warehouse-first and lake-first analytics stacks. A core infrastructure-design topic for analytics platforms.
A team is debating whether to adopt a lakehouse or keep maintaining a separate data lake plus a commercial data warehouse. Walk through how you'd actually make that call, and where the real trade-offs tend to show up.
Sample Answer
There's no universal winner here: a lakehouse consolidates a lake and a warehouse into one platform with transactional guarantees on top of cheap object storage, while keeping them separate lets each system specialize. The decision comes down to how much your organization actually needs unified governance and reproducible pipelines versus how much it benefits from best-of-breed, purpose-built tools on each side.
Where the trade-offs actually show up
Consistency and reliability. A lakehouse adds transactional guarantees (atomic commits, isolation between concurrent writers, versioned snapshots) directly on top of the lake's files, so the same storage that used to be 'append and hope' now behaves more like a database table. A separate lake plus warehouse gets this reliability only on the warehouse side; the lake itself is still just files, so anything reading raw lake data directly inherits the lake's weaker guarantees.
Operational complexity. Two systems means two things to operate, two places for metadata to drift apart, and an ETL (Extract, Transform, Load) or ELT (Extract, Load, Transform) layer whose only job is keeping them in sync. A lakehouse removes that sync step, but it shifts the operational burden onto managing one more sophisticated system well: table maintenance, metadata scaling, and query-engine tuning become your responsibility (or your platform vendor's) instead of being split across two mature, narrower products.
Cost. Object storage underneath a lakehouse is cheap, and compute is decoupled from it, so storage cost stays low even as history accumulates. A separate warehouse usually costs more per byte stored because it's optimized for query performance, not just cheap persistence. Whether that matters depends on how much of your data is 'hot' (queried constantly, where warehouse performance pays for itself) versus 'cold' (rarely touched, where cheap lake storage wins).
Tooling and team skills. A managed warehouse's ecosystem (business intelligence, or BI, connectors, workload management, query optimizer) is mature and requires less specialized tuning. A lakehouse built on open table formats gives you more control and avoids vendor lock-in, but your team needs to actually understand things like compaction and file layout to get warehouse-like performance out of it.
Worked example: how you'd actually decide
A useful decision framework, applied to a mid-size company weighing a lakehouse against replacing (or supplementing) an existing warehouse: start from where the trade-offs show up, not from a platform preference.
- If most of your workload is well-known BI reporting on structured data, and your team is small, a managed warehouse alone is probably the pragmatic choice: you get performance and low operational overhead for the workload you actually have.
- If you increasingly need both governed BI numbers and large-scale ML feature engineering off the same raw history, and you're willing to invest in the operational skill to run it well, a lakehouse removes the duplicate-copy, duplicate-pipeline problem that a two-system setup creates.
- A common middle ground, and the one most organizations actually land on, is a hybrid: raw and semi-structured data lives in the lake (or lakehouse bronze layer), and a smaller, highly curated warehouse (or gold layer) serves the numbers the business depends on daily. This keeps the blast radius of 'the analytics platform is down' small and contained to the curated layer.
Trade-offs and pitfalls
The biggest pitfall is picking the lakehouse for its architectural elegance without budgeting for the operational skill it actually requires: an under-tuned lakehouse (poor file sizing, no compaction discipline) can be slower and less reliable than a plain warehouse, which erases the cost advantage once you factor in the engineering time spent firefighting. The second pitfall is the opposite: keeping two systems 'because that's how we've always done it' long after the sync overhead between them has become the single largest source of data inconsistency complaints.
Compare an event-sourced fact design (append every state-change event, derive current state by replay or a running aggregation) against a snapshot fact design (periodically materialize the current state) for the same business process. Discuss storage growth, query complexity, correctness under replay, and when each approach is the better fit.
Sample Answer
Direct answer
An event-sourced fact design appends every state-change event and derives current or historical state by replaying or aggregating events; a snapshot fact design periodically materializes the current state directly. Event-sourcing preserves the fullest history and audit trail at the cost of replay complexity; snapshotting is simpler to query but only as granular in time as the snapshot interval, and derived-state correctness depends entirely on getting the replay logic right.
Structured elaboration
- Storage growth: event-sourced designs grow with every state change, however small; snapshot designs grow with the number of entities times the number of snapshot periods, which can be smaller or larger depending on how frequently entities actually change versus how often you snapshot.
- Query complexity: reconstructing "current state" or "state as of date X" from an event-sourced table requires replaying or aggregating all relevant events, which is more complex (and more compute-expensive per query, unless materialized separately) than a direct snapshot lookup.
- Correctness under replay: event-sourcing is only as correct as its replay logic; a subtly wrong aggregation rule silently produces wrong derived state for every downstream consumer, and bugs can be hard to detect since the raw events "look right" individually. A periodic snapshot's correctness is easier to spot-check directly against the source system at any given time.
- When each fits: event-sourcing fits when you need a full audit trail of every change and the ability to answer arbitrary historical "what happened" questions you didn't anticipate in advance (since you still have the raw events). Snapshotting fits when you know in advance which point-in-time states matter (daily, hourly) and want simple, fast queries without replay logic.
Worked example
Tracking an order's status: an event-sourced design stores order_status_event(order_id, status, changed_at), one row per transition (placed, paid, shipped, delivered), and "current status" is derived by taking the latest event per order. A snapshot design instead stores order_status_daily(order_id, date_key, status), one row per order per day, directly queryable without replay, but unable to tell you the exact minute a status changed within a day, only what it was as of each day's snapshot.
Trade-offs and pitfalls
A common middle ground is event-sourcing the raw truth (since it's cheap to append and preserves everything) while ALSO maintaining a derived snapshot or accumulating-snapshot table for the common query patterns, so most queries hit the cheap, simple snapshot while the full event history remains available for the rare cases needing finer-grained replay. Pure event-sourcing without any derived materialization pushes replay cost onto every single query, which rarely holds up under real dashboard load.
What's the difference between OLTP and OLAP systems? A startup is processing about 1,000 transactions per second and needs both daily and ad-hoc analytics. Would you recommend one combined system or two separate systems, and why?
Sample Answer
Online Transaction Processing (OLTP) systems are built to handle many small, fast reads and writes for a single business transaction, while Online Analytical Processing (OLAP) systems are built to handle fewer, heavier queries that scan and aggregate across large volumes of historical data. For a startup at roughly 1,000 transactions per second needing both order processing and analytics, I'd recommend two separate systems rather than one combined one.
The distinction, dimension by dimension
| Dimension | OLTP | OLAP |
|---|---|---|
| Data model | Normalized, row-oriented; optimized to avoid update anomalies | Denormalized or dimensional (star/snowflake); optimized for aggregation |
| Query pattern | Short point lookups and single-row inserts/updates | Large scans, group-by aggregations, joins across history |
| Latency needs | Milliseconds, on the critical path of the transaction | Seconds to minutes is usually acceptable |
| Consistency | Strong, immediate; a payment can't be half-applied | Often eventually consistent; yesterday's numbers being final by this morning is fine |
| Storage | Row-oriented, indexed for point lookups | Columnar, optimized for scanning specific columns across many rows |
| Scale dimension | Scales for throughput (transactions per second) | Scales for data volume and query concurrency |
Worked example: the recommendation
At 1,000 transactions per second, the order-processing system has to guarantee that a payment and an inventory decrement either both happen or neither does, with response times the customer will notice if they're slow. That's squarely an OLTP workload, and it needs a database built for exactly that: row-level locking, strong consistency, and indexes tuned for 'find this one order.'
The analytics side is a different shape of problem entirely: 'total revenue by category, by day, for the last quarter' touches millions of rows and doesn't care if it's a few minutes stale. Running that query directly against the transactional database competes for the same resources the checkout flow needs, and a single slow-running analytical query can visibly degrade checkout latency for customers, which is the actual failure mode that pushes teams toward separating the two.
So the practical setup is: keep a dedicated OLTP database for order processing, and periodically move data (via a change feed or scheduled batch job) into a separate warehouse or OLAP-oriented store for reporting. This isolates the two workloads so a reporting query never threatens checkout latency, and each side can be scaled independently: the OLTP side for transaction throughput, the analytics side for data volume and query concurrency.
For a data scientist doing exploratory analysis, the OLAP side is also the right place to work from: it's already structured for aggregation, and it won't compete with production traffic the way querying the live transactional database would.
Trade-offs and pitfalls
The main pitfall at small scale is assuming you need this separation from day one when a single well-indexed database would genuinely be fine for a while; premature separation adds operational complexity (a second system, and a pipeline keeping it in sync) before the workload actually demands it. The opposite pitfall, more relevant at 1,000 transactions per second, is running analytical queries directly against the production OLTP database 'just this once' and having that become a habit: it's the single most common way an analytics need turns into a production incident.
You're evaluating whether to move an analytics workload from one managed cloud warehouse to another, say BigQuery to Snowflake. Walk through how you'd actually decide: what would you look at, and how would you structure a pilot to compare the two before committing?
Sample Answer
Deciding whether to actually move a workload between managed cloud warehouses comes down to whether the new platform meaningfully improves something the current one is failing at (performance, cost, or a capability gap), because a migration is expensive enough that 'roughly comparable' isn't a good enough reason to do it.
What I'd actually look at
Performance for your real workload, not a generic benchmark: how the specific queries your dashboards and reports run today perform on the candidate platform, at your actual data volumes and concurrency levels.
Cost, modeled against your real usage pattern, not list pricing: whether your workload is steady (favoring predictable, reserved-style pricing) or bursty (favoring on-demand, pay-per-query pricing), since the two platforms may price these patterns very differently.
Feature and ecosystem fit: whether your existing Business Intelligence (BI) tools, orchestration, and data-loading tools connect natively, and whether any platform-specific feature your team actually relies on today (a particular semi-structured data type, a specific data-sharing capability) has an equivalent on the other side.
Operational overhead: how much day-to-day tuning, maintenance, and specialized expertise each platform demands from your team, since a technically superior platform that needs skills your team doesn't have yet has a real, ongoing cost.
Worked example: structuring the pilot
Rather than a broad, open-ended trial, I'd scope a pilot around a small number of representative, real workloads, not synthetic benchmarks: for instance, one high-concurrency dashboard, one heavy nightly aggregation job, and one workload involving your messiest semi-structured data.
Run both platforms side by side against the same real queries and data for a few weeks, and measure the things that actually matter for the decision: query latency at your typical concurrency, the modeled cost for your specific usage pattern (not vendor list pricing), and how much manual tuning or troubleshooting effort each platform required from your engineers to hit acceptable performance.
At the end, the honest output isn't just 'platform B was 20 percent faster'; it's whether that improvement, weighed against migration cost, cost difference, and any features you'd gain or lose, clears the bar to justify moving a live production workload.
Trade-offs and pitfalls
The most common mistake is running the pilot on a clean, synthetic dataset that doesn't reflect your real data's messiness (skew, semi-structured fields, unusual query patterns), which can make a migration look like a clear win in the pilot and then underperform once real production traffic and data quirks hit it. The second is underweighting operational overhead: a platform that benchmarks faster but requires ongoing specialized tuning your team doesn't have the bandwidth for can end up costing more in engineering time than it saves in compute cost.
Explain schema-on-write versus schema-on-read. What do you gain and give up with each, and how does the choice affect data quality, query performance, and how quickly a team can start exploring new data?
Sample Answer
Schema-on-write means you define and enforce a schema before data is loaded; anything that doesn't fit gets rejected or transformed at load time. Schema-on-read means you store the data as-is and only apply structure when a query actually reads it. The trade-off is agility and ingestion speed versus upfront quality guarantees.
What you gain and give up
| Schema-on-write | Schema-on-read | |
|---|---|---|
| Data quality | Enforced at load; bad records rejected early | Enforced (or not) at query time; bad records can slip through unnoticed until someone queries them |
| Query performance | Fast, predictable; data is already structured and often indexed | Slower unless the engine and file layout are well-tuned; structure is inferred or parsed on the fly |
| Speed of exploring new data | Slow: a new source needs a schema designed and an ETL (Extract, Transform, Load) job built before anyone can query it | Fast: land the data and start querying, even before anyone has agreed on its final shape |
| Responsibility for validation | Shared upfront, by whoever builds the load pipeline | Pushed to whoever writes the query, unless a curated layer exists |
Worked example
Say a new upstream system starts sending event data tomorrow, and nobody has fully agreed on its final field list yet. Under schema-on-write, you'd have to design a table schema, build and test a load job, and only then let anyone query it: useful once it's done, but it blocks any exploration until that's finished. Under schema-on-read, you land the raw events immediately and let an analyst start poking at them the same day, at the cost of not knowing yet whether every record is well-formed.
In practice, the two aren't mutually exclusive within one platform. A common pattern is to apply schema-on-read at ingestion (land raw data immediately, so nothing blocks exploration) and then promote a schema-on-write, validated version of the same data for anything the business depends on daily. That gives you the ingestion speed of one model and the quality guarantee of the other, on the same underlying data, at different points in its lifecycle.
Trade-offs and pitfalls
The most common mistake is picking one model as a blanket policy for an entire platform instead of matching it to the actual use case: forcing every new source through a heavyweight schema-on-write pipeline slows down legitimate exploration, while leaving everything permanently schema-on-read (never promoting anything to a validated layer) means business-critical reports are only as reliable as whatever query someone happened to write. The second pitfall is assuming schema-on-read has no cost: without a curated layer or documented conventions, different analysts querying the same raw data can apply subtly different parsing logic and land on different numbers for what should be the same metric.
Unlock Full Question Bank
Get access to all 20 Data Warehousing and Data Lakes interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.