FreeExam

Warehouses

A data engineer interview on the grain of a table, its history, and which object a teammate should query.

These prompts are original practice. They are not questions from a named employer or a live hiring loop.

  1. 1.An orders table has one row per order line and also a row for the order total. A sum of amount is about twice the real revenue. What is wrong with the table?

  2. 2.You split lines and headers. Which key ties a line to its header?

  3. 3.An analyst sums line amount and also sums a header shipping fee that you copied onto every line. Shipping is counted once per line. Where should the fee live?

  4. 4.You allocate a discount across lines by price. A later return removes a line. The allocation on the remaining lines still reflects the returned one. What has to be recomputed?

  5. 5.A fact table's grain is 'one row per customer per day.' A customer with no activity that day has no row. A count of rows is used as 'customers we could have seen.' What is undercounted?

  6. 6.You densify every customer for every day for five years. Most rows are zeros. The table becomes enormous. When is the spine worth it?

  7. 7.Two facts both use customer id. One uses the id at purchase time. The other uses the id after an account merge, rewritten in place. A join on id drops the old purchases. What did the rewrite destroy?

  8. 8.A dimension stores the current region only. A customer moved in March. A report of January sales by region shows the March region. Who asked for current, and who needed history?

  9. 9.You version the customer dimension. The fact still holds the customer id, not the version. A join fans out to every version. What should the fact store?

  10. 10.A slowly changing dimension has valid_from and valid_to. The current row uses a valid_to of null. One query treats null as unknown and drops current customers. What do you publish instead of a bare null?

  11. 11.A product-day table stores units_on_hand. An analyst sums that column across thirty days and labels it units in the building. The result is many times the stock on any shelf. What kind of number was added?

  12. 12.An order pipeline table is one row per order, and shipped_at is filled when the order ships. A later job inserts a second row at ship time instead of updating the first. A count of rows no longer matches a count of orders. What happened to the grain?

  13. 13.Sales facts have no row for a store that was open and sold nothing, and no row for a store that was closed. Leadership wants open store-days, including the zero-sale days. Where does that population live?

  14. 14.Every line fact carries the order number, and no order-level attributes remain to house. Analysts still filter and group by that number. A review asks for a one-column dimension before the fact may be queried. What is that number?

  15. 15.Ship date and order date both reference one date dimension. One team filters March on ship date, the other on order date, and both title the page March revenue. The totals differ. How should the published metrics be named?

  16. 16.Store sales and web sales each have a customer dimension. The same person is surrogate 14 in one and 902 in the other. A company report unions the facts and joins on customer key. The person splits, and some unrelated keys collide. What is missing?

  17. 17.Six yes/no flags sit on the order fact. You want them off the wide row and in one junk dimension. What is the grain of that dimension?

  18. 18.A claim line stores up to eight diagnosis codes in diagnosis_1 through diagnosis_8. Counting lines where diagnosis_1 equals J45 misses lines where J45 sits later. Summing paid amount by diagnosis_1 gives the whole payment to the first code. What lists every code without copying the money?

  19. 19.The source retires SKU 4401 and later assigns 4401 to a different item. The product dimension is keyed only by SKU, so yesterday's shipments now show today's item name. What identity should the warehouse control?

  20. 20.Orders load at 6 a.m. A new customer's dimension row arrives at noon. The morning load left customer_sk null on those orders. By 1 p.m. the customer exists, and the morning facts still show null. What ongoing behavior repairs this, rather than a one-off edit?

  21. 21.A customer version for the West region closes on Friday. East is the current version on Monday. A Wednesday sale is loaded Monday and joined to whichever row is current at load time. Which version does that sale belong to?

  22. 22.Facts that arrive before their customer point at customer_sk -1, a dimension row named Unknown. A revenue-by-name chart shows a large Unknown bar, and someone deletes that dimension row to clean the chart. What happens to those facts?

  23. 23.About one shipment in ten has a null carrier_id because the carrier was absent in the source. A dashboard inner-joins the carrier dimension, and its total no longer matches a sum of the fact. Freight amounts on those rows are populated. Where did the missing dollars go?

  24. 24.Marketing wants every historical send to show the email address that works today. Compliance wants the address that was actually mailed that day. One email column is overwritten nightly. Which of those requests can the column still answer?

  25. 25.A new plan version opens when the source says the plan changed, but valid_from is the time your job ran, not the source effective time. A plan that started Monday is loaded Wednesday. Monday and Tuesday sales join the old plan. What clock did you version on?

  26. 26.Beside current region you store previous_region and the date that previous value started. A customer moves in January, April, July, and October. A history built from those two columns can see October and one earlier region. What did this pattern retain?

  27. 27.Two versions of customer 88 both run from January through June. A sale on 2 March joins both, and that sale's revenue is added twice. What did the dimension load allow?

  28. 28.Version 1 of a store ends on 1 March. Version 2 starts on 4 March. A sale on 2 March matches nothing, and the inner join drops it from store reports. The store was operating that day. What should the load have refused to publish?

  29. 29.Income band is recomputed every month for about 40 million customers. Versioning the whole customer on each band change multiplies the dimension and forces a new customer key when nothing else changed. Where should the band live?

  30. 30.Store points at district, and district has the vice president. A load copies that name onto every store row and onto every sales fact. The vice president changes, and the three copies disagree. Where does the name live if the question is the current vice president?

  31. 31.Almost every query on the events table filters event_date and tenant_id. The table was clustered on a free-text comment column because that column is high cardinality. Those queries still read most of the files. Why did the cluster miss?

  32. 32.Shipments are partitioned by day and clustered by warehouse_id inside the day. A proposal drops the day partitions and partitions only by warehouse_id: 12 warehouses, four years of days. What do you give up?

  33. 33.A small audit log is partitioned by minute across three years. Most partitions hold a handful of rows. A query for one day spends its time opening partitions rather than reading them. What partition size fits this volume?

  34. 34.Events are partitioned by event_date. A dashboard filters WHERE CAST(event_date AS STRING) LIKE '2026-04-01%' and reads every partition. A range on event_date for that same day touches one partition. Why did the cast scan the table?

  35. 35.Orders were clustered by customer_id at load. A backfill rewrites about 40 percent of the rows and does not recluster. A query for one customer, which used to read a few files, now reads most of them. The ids did not change. What moved?

  36. 36.Published queries join a very large line fact to product on product_sk and rarely restrict the load timestamp. The fact is clustered on load timestamp because that suits the ingest job. The join stays a heavy scan. Which key serves those published queries?

  37. 37.On Sunday an analyst creates analytics_scratch.weekly_revenue and points a dashboard at it. A Monday job drops scratch objects older than seven days. The next Monday the dashboard fails. What should the dashboard have queried?

  38. 38.published.v_revenue is defined as SELECT * FROM scratch.revenue_tmp. The job drops that scratch table at the end of the run and recreates it next time. A report queries the view between runs. What does the view return?

  39. 39.Landing tables hold source emails and payment tokens. The analyst role is granted SELECT on the entire database so people can explore. The marts were the intended surface. What else did that grant open?

  40. 40.Salary sits on the employee dimension. Finance should see department and cost center and should not see salary. The finance role is granted SELECT on the employee table. What can that role read?

  41. 41.Regional managers may see only their region's sales. Region lives on the store dimension and changes under type 2. The row policy uses a region copied onto the fact at load time, while the rule you describe is the store's current region. A store moves and the policy does not. What is the policy enforcing?

  42. 42.The customer mart is one wide table: name, email, city, and lifetime revenue. Revenue analysts do not need the email, and they have SELECT on the wide table because the join is convenient. What narrower grant still lets them compute revenue?

  43. 43.The analyst role was granted SELECT on every table that existed yesterday in the published schema. This morning's job creates published.orders_v2 and grants nothing. Analysts cannot read the new table. Why is it dark?

  44. 44.A published view is defined as SELECT * FROM the fact. A backfill adds raw_payload to the fact. The next consumer query returns raw_payload, which nobody asked to publish. What should the view have listed?

  45. 45.The incremental job inserts source rows whose created_at is newer than the max already loaded. A clerk corrects an older order's amount. created_at stays put and updated_at moves forward. The warehouse still shows the original amount. Which rows does this watermark miss?

  46. 46.A restatement file contains the whole order: same order id, new total. The loader inserts every file it receives. The order now exists twice, with two totals, and a sum adds both. What should a repeated business key do on load?

  47. 47.The source sets deleted_at on a customer. You keep the dimension row and the flag because facts still hold the surrogate. A cleanup hard-deletes that dimension row to mirror the source. Inner joins from the facts no longer find the customer. What should delete mean here?

  48. 48.In April the books said the March premium was $10. In May a correction says March was $12. Finance wants both what April's report contained and what March is believed to be now. You overwrite the March row with $12. Which question survived?

  49. 49.Partitions use the ingestion date. A device offline on Sunday uploads Friday's events on Monday. Those rows sit in Monday's partition with their original Friday timestamps. A report reads Sunday's partition and calls it Sunday activity. Which clock did it use?

  50. 50.Yesterday's file is replayed after a bad transform. The job inserts it again into the day partition that already holds the first copy. The day's revenue doubles. You meant the file to be that day. How is the replay made safe?

  51. 51.Today's customer file has two rows for customer 88, with two different cities. The dimension job inserts both and mints two current surrogates. Facts carry one customer id and no city of their own. What should have happened before the insert?

  52. 52.The customer surrogate is a hash of customer id, email, and city. City is corrected, the hash changes, and facts that stored the old hash no longer join. You also cannot correct city without orphaning history. What should the hash have covered?

  53. 53.Dimension surrogates come from an identity column. You rebuild the dimension from the same customers and the identities are assigned in a different order. Facts still hold last month's numbers, which now point at different people. What kind of key survives the rebuild?

  54. 54.A sale at 11:30 p.m. Pacific is stored as a UTC timestamp on the next calendar day. The date key was taken from the UTC date. The store's register tape, which uses the Pacific date, no longer matches the warehouse day. Which date is the business date?

  55. 55.Fiscal year 2026 runs from 1 February 2025 through 31 January 2026. An analyst filters calendar_year = 2026 and titles the page FY2026. Which months are actually in the result?

  56. 56.The fact stores amount, currency_code, and amount_usd filled by a nightly rate. A global total sums amount, adding yen and dollars as one unit. Which column may be summed across countries, and under what label?

  57. 57.An account-day table stores balance. Summing balances across accounts for one day is a real portfolio total. A quarterly chart adds the ninety daily balances and calls the result the quarter's balance. What did the chart compute?

  58. 58.Each order fact stores margin_percent and revenue. An analyst averages margin_percent across orders, so a huge order and a tiny order pull equally. Leadership asked for the company's margin. What should be computed?

  59. 59.Line facts store unit_price and quantity. An analyst sums unit_price and presents the sum as revenue. A line with quantity 10 contributes the same as a line with quantity 1. Which stored number is the additive revenue?

  60. 60.The org chart is employee and manager. A director reports straight to the CEO, with no VP on that path. Fixed columns level_1 through level_4 put the director in the VP column in one load and drop them from level 3 in another. What kind of tree is this?

  61. 61.A manager should see headcount for every person below them. A recursive query at read time times out, so you materialize a bridge of ancestor, descendant, and depth. Salary lives on the employee. What is the bridge's grain, and what should it not carry?

  62. 62.Employee versions include manager id. A July report of March team size joins each employee to the version current in July, then applies the March fact. People who changed managers in May are counted on their July manager. Which version answers March?

  63. 63.A product sits in three categories. One category key on the sales fact hides the sale from the other two. Exploding the sale into three fact rows makes revenue count three times. Where do the extra categories go, and where does the money stay?

  64. 64.Each night you save the customer extract as a dated snapshot. You also keep a type-2 dimension that you restate when the source fixes history. A ticket asks for the city as the extract showed it on 2 May, before a correction loaded on 10 May. Which object still has that city?

  65. 65.The nightly job replaces the customer table with today's file. Today's file is a partial export from an outage, not the full list. Customers missing from the file disappear, and facts that point at them fail their joins. What had to be true before a full replace was safe?

  66. 66.You infer a delete when a customer was in yesterday's extract and is absent today. The source also sends deleted_flag on rows it still includes. The job ignores the flag. A flagged customer who remains in the file stays current. What signal are you actually using?

  67. 67.The change feed contains a delete for customer 17. The dimension job applies inserts and updates and has no branch for deletes. Customer 17 is still marked current and still joins. What is the warehouse claiming?

  68. 68.January orders reference customer 500, who first appears in the source in March and is backdated. January facts were loaded against the unknown member. In March the dimension row arrives and the old facts are left as they are. January revenue by name still shows Unknown. What did March not do?

  69. 69.While customer 500 is missing, a teammate points the fact at the existing customer with the closest email. The real customer 500 arrives later and is a different person. January revenue now sits on the wrong account and the join looks valid. Which placeholder can still be found and replaced?

  70. 70.A reviewed match table says web id W-9 and store id 4412 are the same person. Facts still store the id from their own system. A unioned customer report counts the person twice. What does the match table have to feed before those counts agree?

  71. 71.One barcode is Trail Mix in the store feed and Trail Mix 12oz in the web feed. Two product dimensions keep both names and two surrogates. The category manager's item total is split across the names. What has to become one key?

  72. 72.A junk dimension is the full cross product of 12 yes/no flags: 4096 rows, most of them never referenced. Half the flags are leftovers no query filters. The key is painful to explain. Which flags belong in it?

  73. 73.Gift, rush, and employee sale are stable yes/no flags on the line, and nearly every line-level query filters them on the fact. A review says the fact is illegal until the flags move to a junk dimension. The combination would not be reused elsewhere. When is leaving them on the fact reasonable?

  74. 74.A wide sales table repeats customer city on every line. The grain is still one row per line. An analyst counts rows and publishes that count as customers. City is filled on every row. What did the count count?

  75. 75.That wide sales table copied city onto the line at load and never updates it. Another report joins the current customer dimension and shows the new city. Both are titled sales by city, and they disagree after a move. What did the copied city freeze?

  76. 76.sales_day is one row per line. sales_month is those lines already summed, with no adjustments of its own. A dashboard adds March from sales_month to the March rows from sales_day. The month is in the total twice. What should be added?

  77. 77.Daily unique buyers are 100, 100, and 100, and they are the same 100 people. Summing those daily counts produces 300, published as monthly unique buyers. The distinct buyers in the month are 100. What was treated as additive?

  78. 78.A distinct-user sketch is built per day. For the quarter, the job adds the already-estimated daily numbers as ordinary integers and does not merge the sketches. The quarter comes out high, in the same direction as summing daily uniques. What produces a quarter-level estimate?

  79. 79.Partitions are event_date, and Friday's report prunes to Friday's partition. A late Friday event arrives Monday and is inserted into Monday because that partition is the one left open. Friday's report never shows the event. Where does the row have to sit for that report to see it?

  80. 80.A multi-terabyte fact is clustered on a surrogate line id that no query puts in the WHERE clause. The reports people run filter sale_date and store_id, which are not the cluster key. What do those reports get from this clustering?

  81. 81.The fact is clustered on (store_id, sale_date). Queries almost always filter sale_date and only sometimes name a store. A date-only query still opens files across every store. You cannot change the queries this quarter. Which cluster order fits them?

  82. 82.Customer events must be gone 400 days after the event date. The table is partitioned by month on that date. A filtered DELETE runs for hours and rewrites files that still hold younger rows. What is the cheap delete for a month that is entirely past the window?

  83. 83.event_date is the partition column. A bad load writes null dates, and those rows land in the null partition. Daily jobs prune a real date and never open that partition. The source had a usable date in another field the mapping skipped. What should the load have done?

  84. 84.The published mart is partitioned and clustered. An analyst copies it into scratch with no partitioning and points a dashboard at the copy, refreshing every ten minutes. The bill rises, and the figures match the mart only until a refresh is skipped. What should the dashboard read?

  85. 85.A feature is trained from the landing orders file because it has a debug counter the mart does not publish. The source resets that counter, and landing double-loads the file on retry. The feature cannot be reproduced the next week. What should be offered instead?

  86. 86.postal_code is dropped from the published customer view because a search of the repo found no references. The next morning a quarterly export that is not in the repo fails. What should have come before the drop?

  87. 87.published.cust_id is renamed to customer_id for style. Saved queries that select cust_id fail, and a view in another schema still references the old name. How do you introduce the new name without that break?

  88. 88.Analysts lose SELECT on the fact and gain SELECT on a published view that omits payment tokens. The view owner can read the fact, and the engine uses the owner's rights. Analysts can query the view. A teammate says the tokens are therefore exposed. Are they?

  89. 89.A row access policy returns rows whose region is listed in scratch.manager_regions. Managers can insert into that scratch table. One manager adds regions they do not manage, and the next query shows those sales. What did the policy allow them to edit?

  90. 90.The nightly sales load logs in as an account that owns every schema, including restricted HR and other teams' scratch. The job only needs to write published sales tables and read its own sources. What should that account be allowed to touch?

  91. 91.An analyst is granted INSERT on the published fact so they can fix a number before a board meeting. They insert a rounded revenue row with no source key. The morning merge does not recognize it, leaves it, and the day no longer matches the source. Where should the fix have been written?

  92. 92.Finance needs a $500 credit against March that the source will not restate. You subtract $500 from the March sale row. The next source reload replaces that row and the credit is gone. Where does the $500 survive a reload?

  93. 93.March is closed and its partition is read-only. A real March return arrives in April. The load rejects it because the partition is frozen, and neither March nor April includes the return. How do you accept it without opening March to ad hoc edits?

  94. 94.The fact stores the source customer id and not the dimension surrogate. The source reuses that id after an account closes. After the reuse, old facts join to the new account's name and region. What should the fact have stored at load?

  95. 95.A shipment has a null freight amount, because it is not priced yet, and a null warehouse id, because the warehouse was missing. A cleanup sets both nulls to 0. The freight sum treats the shipment as free, and warehouse 0 is not in the dimension, so warehouse reports drop the row. What was safe to put in place of those nulls?

  96. 96.Order date and cancel date are two keys to one date dimension. A query joins the dimension once, on order date, filters March, and counts rows whose cancel date is not null. The title says March cancellations. Orders placed in March and cancelled in May are in. Orders placed in January and cancelled in March are out. Which role was joined?

  97. 97.Receipts and issues are stored as movements. Morning on-hand is the sum of every movement since the beginning of time, and no opening balance is stored. One missing receipt from two years ago makes every later morning wrong. What lets you repair a single day?

  98. 98.A pipeline table has one row per order, and delivered_at stays null until delivery. A query counts null delivered_at and labels the count in transit. Orders cancelled before shipment are included, and they will never get a delivery time. What else does the row need before that label is true?

  99. 99.A payment is split across three cost centers on a bridge, with weights 0.5, 0.3, and 0.2. The amount lives once on the fact. A query joins the bridge and sums the amount without using the weight. The payment is counted three times. What does the sum have to multiply by?

  100. 100.Unresolved facts use customer surrogate -1, and the source also emits a real customer whose id is -1. Both populations land on one dimension row. The real customer's name is mixed with everyone still unmatched. What is wrong with the sentinel?

  101. 101.A failed load left is_current true on a new customer version and still true on the old one. A report filters is_current and joins facts on the business key. Each of those facts comes out twice. What should the load have checked before publishing?

  102. 102.When a late customer arrives, a job sets the fact's customer key from unknown to the new surrogate wherever the natural id matches. It also rewrites facts that already sat on a correct surrogate from an earlier, deliberate match. Which rows was it supposed to update?

  103. 103.scratch.revenue is promoted by changing its schema name to published. The analyst who built it still owns the table and can still truncate it. The nightly job is not the owner. What did the rename leave as it was?

  104. 104.Tuesday's partition is replaced with repair files. The table is clustered on store_id, and those files were written without that ordering. A one-store query for Tuesday reads the new files almost end to end. Other days still prune. What did the replace skip?

  105. 105.customer_monthly was one row per customer per month. A later job added product, so the grain is now customer, month, and product. The name stayed. A metric counts rows and divides by the number of months to report customers. Assortment inflates the count. What no longer agrees?