Scrivio Interview library

Analytics, warehouses and change data capture

24 questions in 6 subtopics.

Star and snowflake schemas

ConceptFoundations6 min read
Explain fact and dimension tables in a star schema using an online shop. How does a snowflake schema differ?
CodingFoundations7 min read
Given fact_sales(date_key, product_key, store_key, amount) and dim_product(product_key, category), dim_date(date_key, year, month), write SQL for total sales per category per month in 2026.
DesignIntermediate8 min read
Product attributes such as category and price tier change over time, and reports must show sales by the category the product had at the time of sale. Design the dimension.
DesignAdvanced6 min read
Business units define 'active customer' and 'revenue' differently, and dashboards disagree. As the architect of the analytics platform, how do you fix the model?

ETL vs ELT

ConceptFoundations6 min read
What is the difference between ETL and ELT, and why did ELT become common with cloud warehouses?
DebuggingIntermediate7 min read
A nightly job extracts orders updated since the last run using WHERE updated_at > :lastRun, and the warehouse is missing some orders every few days. Find likely causes.
DesignAdvanced6 min read
Design the data pipeline standard for 50 services that feed one warehouse: how data leaves services, how it lands, how it is transformed and tested.
LeadershipPrincipal6 min read
Data pipelines in your company are owned by a central data team that has become a bottleneck. Would you move to a data mesh with domain ownership? What would you do?

Change data capture with Debezium

ConceptFoundations7 min read
What is log-based change data capture, and how does Debezium capture changes from PostgreSQL and MySQL?
DebuggingIntermediate7 min read
After a schema change that added a NOT NULL column with a default to a table, downstream consumers of Debezium events fail to deserialize messages. Explain and prevent this.
DesignIntermediate7 min read
A service writes an order to PostgreSQL and must publish an OrderPlaced event to Kafka without losing or inventing events. Explain the transactional outbox with Debezium and its pitfalls.
DesignAdvanced6 min read
Should other teams consume raw table-level CDC streams from your service's database? Discuss the architecture trade-offs.
DesignPrincipal7 min read
Your platform has grown to many CDC pipelines (Debezium, vendor tools, custom triggers) feeding search, caches and the warehouse. How would you set strategy for CDC as a platform capability?

Column-oriented warehouses

ConceptFoundations7 min read
Why are column-oriented warehouses faster than a row store like PostgreSQL for a query such as SELECT region, SUM(amount) FROM sales GROUP BY region over 2 billion rows?
ScenarioIntermediate7 min read
Compare running analytics on PostgreSQL with a columnar extension, on a cloud warehouse (BigQuery, Snowflake, Redshift), and on an embedded engine like DuckDB, for a company with 3 TB of data.
DesignAdvanced6 min read
Teams want to query the warehouse from user-facing product features (for example customer dashboards). What architecture would you approve?
LeadershipPrincipal7 min read
Warehouse spending at your company has tripled in two years. How do you lead cost control without stopping the analytics teams?

Reporting replicas vs warehouses

ConceptFoundations6 min read
A product manager asks for reports directly from the production database. Compare using a read replica with building a warehouse.
DebuggingIntermediate7 min read
A BI tool connected to a PostgreSQL hot standby keeps failing with 'ERROR: canceling statement due to conflict with recovery'. Explain and give options.
ScenarioAdvanced7 min read
Ten services each expose a reporting replica, and analysts join data across them in spreadsheets. Leadership wants one source of truth. What do you propose?

Data retention and archiving

ScenarioFoundations7 min read
An audit_log table in PostgreSQL grows by 50 million rows per month, and policy says keep 13 months online and 7 years in archive. How would you implement retention?
DesignIntermediate7 min read
GDPR requires erasing a customer's personal data on request, but data also lives in backups, a warehouse, Kafka topics and archives. Design how deletion works.
DesignAdvanced6 min read
Design archiving for an orders database where 90 percent of queries touch the last 3 months, but customer service occasionally needs orders from 10 years ago.
LeadershipPrincipal6 min read
Your company keeps all data forever because 'it might be useful'. Storage cost, breach exposure and legal risk keep growing. How do you change this?