Layer 3 · Go deeper · 4 min
Go deeper
Size it, build it, then make the calls an interviewer will push you on.
Build-up · 5 steps
From one flat table to five
The food-delivery start-up’s order-lines export, normalized one dependency at a time.
Step 1 of 5
The flat table
One row per dish per order, keyed by order_id and dish_id, eleven columns. The rules come from the business. An order has one customer and one restaurant; a dish is on one menu.
4 interview moments
You’re the candidate
The interviewer pushes on the hard parts. Pick an approach and see how it holds up.
Deep dive 1 of 4
Interviewer
“An engineer wants each order’s items in one jsonb list on the orders row, edited line by line. Do you agree?”
Your move. Pick an approach:
Deep dive 2 of 4
Interviewer
“In area_routing(area, cuisine, kitchen_id), each kitchen cooks one cuisine, so “K3 cooks North Indian” repeats. What do you do?”
Your move. Pick an approach:
Deep dive 3 of 4
Interviewer
“Search filters restaurants by cuisine tag and PIN code. Someone proposes restaurant_tags_pins(restaurant_id, tag, pin). Your call?”
Your move. Pick an approach:
Deep dive 4 of 4
Interviewer
“Your OLTP schema is in BCNF, and the order page joins five tables. A teammate wants restaurant_name copied onto every order. Your answer?”
Your move. Pick an approach: