EASYasked at 4 companies

Students and Examinations

A easy-tier problem at 60% community acceptance, tagged with Database. Reported in interviews at Roblox and 3 others.

Founder's read

Students and Examinations is a database problem that sits at the intersection of SQL joins and aggregation logic. With a 60% acceptance rate, it looks deceptively simple but catches candidates who skip the join details or miss edge cases around NULL handling. Roblox, Bloomberg, Cognizant, and TCS have all asked it. The problem tests whether you can accurately track student exam attempts and produce clean output without logical gaps. If you're prepping for a database-heavy OA and this problem hits your assessment unprepared, StealthCoder solves it in seconds, invisible to the proctor.

Companies asking
4
Difficulty
EASY
Acceptance
60%

Companies that ask "Students and Examinations"

If this hits your live OA

Students and Examinations 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. Made for the engineer who has done the work but might still blank with a webcam pointed at him.

Get StealthCoder
What this means

The trap here is writing a query that looks correct but produces wrong counts or missing rows. Most candidates jump to a simple GROUP BY without ensuring all students appear in the result, even those with zero exams. The real work is the JOIN strategy: you need a Cartesian product between students and subjects, then a LEFT JOIN to exam records so unattended exams show as NULL or zero. The acceptance rate of 60% suggests a meaningful percentage of submissions fail on edge cases like duplicate exam records, incorrect count logic, or forgetting to handle students who never sat an exam. StealthCoder's hedge here is that if you blank on the full join structure during live assessment, it delivers a working solution immediately.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Students and Examinations 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. Made for the engineer who has done the work but might still blank with a webcam pointed at him. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Students and Examinations interview FAQ

Is this really just a simple GROUP BY with a count?+

No. A basic GROUP BY misses students who took no exams at all. You need to cross-join students and subjects first, then LEFT JOIN the exam table to capture zero-exam cases. That structural mistake accounts for many of the 40% failed submissions.

Do I need to handle duplicate exam records?+

Possibly, depending on the test data. Exam records might include retakes. Use COUNT(DISTINCT exam_id) or filter duplicates before joining to avoid inflated counts. Always check the schema and sample input.

Why do Roblox and Bloomberg ask a database problem instead of an algorithm one?+

Data pipeline and analytics roles are common at those companies. Database correctness directly impacts product reliability and reporting. Even backend roles need SQL proficiency for migrations and debugging.

Should I use a subquery or CTE for this?+

Either works. A CTE is cleaner: define student-subject pairs in one, join exams in the next, then aggregate. Subqueries work too but are harder to debug. Choose whichever you're faster at writing.

What's the most common reason submissions fail?+

Missing the Cartesian product of students and subjects. Candidates write joins that only return students who took at least one exam, losing rows for zero-exam students entirely. Always verify your row count matches expected output before submitting.

Want the actual problem statement? View "Students and Examinations" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.