Percentage of Users Attended a Contest
A easy-tier problem at 59% community acceptance, tagged with Database. Reported in interviews at Fortinet and 0 others.
You're staring at a SQL problem that asks you to calculate what fraction of all registered users actually showed up to a contest. It sounds simple, but the join logic and null-handling will trip you if you're not careful. Fortinet has asked this one. The acceptance rate sits around 59%, which tells you most people get it right, but that 41% failure rate means there's a subtle trap in the grouping or aggregation that catches people who rush. If this lands in your live assessment and you blank on the join strategy, StealthCoder surfaces a working query in seconds, invisible to the proctor.
Companies that ask "Percentage of Users Attended a Contest"
Percentage of Users Attended a Contest 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 by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know.
Get StealthCoderThe real challenge here is counting total unique users and matching them against those who actually participated. You can't just do a simple COUNT or SUM on a naive join, because duplicate rows will inflate your numerator. The pattern is: seed from the users table, LEFT JOIN to the contests or registrations table, then use conditional aggregation or subqueries to isolate the two counts. Most people either miss the LEFT JOIN and lose non-participating users entirely, or they count rows instead of distinct users. The acceptance rate being just under 60% suggests half the test-takers solved the JOIN correctly but botched the aggregation. If you hit this live and can't recall whether to use COUNT(DISTINCT) or a subquery pattern, StealthCoder executes the right approach while your proctor sees nothing.
Pattern tags
You know the problem.
Make sure you actually pass it.
Percentage of Users Attended a Contest 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 by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Percentage of Users Attended a Contest interview FAQ
Is this actually an easy problem or does the rating lie?+
It is easy if you know the SQL join pattern. The 59% acceptance rate confirms most people pass it, but the 41% who fail usually mess up the distinct count or forget a LEFT JOIN. If you've done aggregate SQL before, you'll breeze it. If not, the null-handling stings.
What's the one mistake that fails most attempts?+
Counting rows instead of distinct users after the join. If a user registers multiple times or if your join creates duplicates, you'll overcount participation. Use COUNT(DISTINCT user_id) or filter your JOIN logic upstream to avoid that.
Do I need a subquery or is one JOIN enough?+
One JOIN with proper grouping and aggregation usually works, but a subquery approach is cleaner for some people and avoids accidental row duplication. Either works if your distinct count is right.
How does this relate to other database problems Fortinet asks?+
Fortinet leans toward SQL fundamentals: joins, aggregation, filtering. This problem tests whether you can combine users (one table) with event data (another) and compute a single percentage. It's foundational for any data query role.
Should I round the percentage or cast to decimal?+
The problem statement will specify. Most systems expect a decimal or a rounded integer. Read the output format carefully in your assessment. Casting to DECIMAL or using ROUND() is standard practice.
Want the actual problem statement? View "Percentage of Users Attended a Contest" on LeetCode →