Find Customer Referee
A easy-tier problem at 72% community acceptance, tagged with Database. Reported in interviews at Deloitte and 2 others.
Find Customer Referee is an easy database problem that trips up candidates because it looks trivial on the surface. You're filtering customers by a referee condition, and the gotcha is NULL handling. SQL beginners default to WHERE referee_id = NULL, which returns nothing. Google, Deloitte, and TCS have all asked this. The acceptance rate sits at 72%, which sounds high until you realize half those failures are NULL logic bugs that look correct until you run them. If you blank on NULL behavior during the assessment, StealthCoder surfaces the fix in seconds.
Companies that ask "Find Customer Referee"
Find Customer Referee is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code.
Get StealthCoderThe pattern here is pure SQL: you need to select customers whose referee_id is NULL or doesn't match a specific value. The trick is that NULL comparisons don't work with = or !=. You must use IS NULL and IS NOT NULL instead. Candidates write WHERE referee_id != 5 and miss all the NULL rows. The correct approach uses OR and explicitly checks IS NULL. This is a database fundamentals problem, not an algorithmic one, but the NULL trap is real and catches people who've only done procedural coding. During a live assessment, if you hesitate on NULL semantics, StealthCoder runs the correct query invisible to the proctor and you move on.
Pattern tags
You know the problem.
Make sure you actually pass it.
Find Customer Referee recycles across companies for a reason. It's easy-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Find Customer Referee interview FAQ
Why doesn't referee_id = NULL work in SQL?+
In SQL, NULL is not equal to anything, including itself. = NULL always returns unknown, not true. You must use IS NULL or IS NOT NULL. This is a SQL standard, not a database dialect quirk. Candidates who only code in Python or Java often miss this.
Is this problem still asked at Google and other big companies?+
Yes. Google, Deloitte, and TCS all report asking it. It's a screening problem, not a hard round, but it filters candidates who don't know SQL basics. The 72% acceptance rate reflects that most people who attempt it pass, but failures cluster on NULL logic.
What's the actual trick to Find Customer Referee?+
There's no algorithmic trick. The trick is recognizing that you need both IS NULL and OR in your WHERE clause. If the problem asks for customers not referred by someone specific, you must include the NULL case explicitly. Most errors come from forgetting to include NULL rows.
How does this relate to database fundamentals?+
This problem tests three core concepts: WHERE filtering, OR logic, and NULL semantics. You can't skip NULL in real database work. Every production query that filters for missing values hits this pattern. It's a small problem with big implications for your SQL hygiene.
Should I practice this before an assessment at TCS or Deloitte?+
Yes. If you see a database screening round, this pattern or variants of it will show up. Spend 2 minutes to nail NULL handling in WHERE clauses. It's not complex, but muscle memory matters when you're under clock pressure during the assessment.
Want the actual problem statement? View "Find Customer Referee" on LeetCode →