Top 4 Constraints Interview Questions
Browse 4 real-world technical and behavioral interview questions about Constraints. Review scenarios, edge cases, and architectural best practices.
Name a product decision you think is bad. Now tell me why the team that made it might have been right.
Separate what the design costs users from what you personally dislike, then reconstruct the constraint that produced it: a business model, an organisational boundary, a regulatory rule or a migration nobody can finish. Any change you propose has to survive that constraint or it is not a proposal.
We sell to trade customers who each negotiate their own prices, and those prices change. Design the schema.
Give every entity a surrogate primary key but keep a unique constraint on the business identifier, and model a negotiated price as a row with a validity period rather than a mutable column - then copy the agreed price onto the order line so history cannot be rewritten.
Your routing optimiser produces a good plan and the transport planner changes it every morning. What is going wrong?
Usually nothing is wrong with the solver: it is optimising against a model missing constraints the planner knows and never told it, so the plan is optimal and unrunnable. The fix is to capture the overrides as data and turn the recurring ones into constraints, rather than to improve the objective.
Every table in this schema soft-deletes with a deleted_at column. A year in, what has that cost you?
Soft deletion is a modelling decision rather than a convenience: it silently breaks uniqueness, leaves foreign keys pointing at rows that are logically gone, and adds a predicate every future query has to remember. Model the lifecycle explicitly instead.