Broken Promises Between Tables
A medium SQL mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- L3
Interview Prompt
The data-quality pipeline runs a battery of validation rules over our warehouse tables, logging each run in dq_checks. A downstream consumer just choked on dangling references, so the on-call DE wants to know how bad the referential-integrity situation is. Count how many data quality checks whose rule is referential integrity actually failed (passed = 0). Note that rule names are not stored consistently, so match the rule case-insensitively. Return a single column fail_count.
Summary
Every foreign key is a pinky-swear. Count the ones that got broken.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your sql solution with real code execution
- Get instant feedback and a hire/no-hire decision