Analytics, warehouses and change data capture
24 questions in 6 subtopics.
Star and snowflake schemas
Explain fact and dimension tables in a star schema using an online shop. How does a snowflake schema differ?Givenfact_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.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.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
What is the difference between ETL and ELT, and why did ELT become common with cloud warehouses?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.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.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
What is log-based change data capture, and how does Debezium capture changes from PostgreSQL and MySQL?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.A service writes an order to PostgreSQL and must publish anOrderPlaced event to Kafka without losing or inventing events. Explain the transactional outbox with Debezium and its pitfalls.Should other teams consume raw table-level CDC streams from your service's database? Discuss the architecture trade-offs.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
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?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.Teams want to query the warehouse from user-facing product features (for example customer dashboards). What architecture would you approve?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
A product manager asks for reports directly from the production database. Compare using a read replica with building a warehouse.A BI tool connected to a PostgreSQL hot standby keeps failing with 'ERROR: canceling statement due to conflict with recovery'. Explain and give options.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
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?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.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.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?No question matches these choices.