Overloaded Game Account Inventories
Reported by candidates from Wells Fargo's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Wells Fargo put a SQL question in front of candidates in July 2026, and it looks harmless until you write the join wrong. You need every game account whose items add up to more than 20 in weight, with item count and total weight attached. It's a join plus a GROUP BY plus a HAVING. No window functions, no tricks. If your OA invite is sitting there, this is the kind of question you want to finish in five minutes. And if you blank on the HAVING part, StealthCoder is the invisible safety net running during the live assessment.
The problem
Generate a report of game accounts whose inventories are overloaded. For every qualifying account, return: username. email. The number of owned items as item_count. The total weight of owned items as total_weight. An account qualifies only when total_weight > 20. Sort rows by total_weight in descending order, then by username in ascending order. Tables accounts: id PK (Integer), username (Text), email (Text) items: id PK (Integer), account_id (Integer), type (Text), name (Text), weight (Integer) Constraints items.account_id references accounts.id. Every accounts.username is unique. Only accounts with a strict total weight greater than 20 appear. Every input row follows the declared schema.
Reported by candidates. Source: FastPrep
Pattern and pitfall
The pattern is join, aggregate, filter on the aggregate. Join accounts to items on accounts.id = items.account_id. Group by account id, username and email so every selected column is covered. Use COUNT(items.id) AS item_count and SUM(items.weight) AS total_weight. Then filter with HAVING SUM(items.weight) > 20, not WHERE, because WHERE runs before aggregation and can't see the sum. Finish with ORDER BY total_weight DESC, username ASC. The common pitfall is putting the threshold in WHERE, or forgetting a selected column in GROUP BY. A LEFT JOIN isn't needed, since accounts with no items can't exceed 20 anyway. An inner join is cleaner. The input size doesn't matter here, the database does the work in one pass. If the syntax slips under pressure, StealthCoder can surface the full query on screen while the assessment is live.
If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.
You can drill Overloaded Game Account Inventories cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Wells Fargo's OA.
Wells Fargo reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Overloaded Game Account Inventories FAQ
How hard is the Wells Fargo overloaded inventories SQL question really?+
Easy to medium. It's one join, one GROUP BY and one HAVING. The only real trap is using WHERE instead of HAVING for the total_weight > 20 condition. If you've written an aggregate filter before, you can finish it quickly.
What's the trick to this problem?+
Filter after aggregating. Group items by account, compute SUM(weight) and COUNT(*), then apply HAVING SUM(weight) > 20. WHERE can't reference aggregates because it runs before grouping, so the query errors or returns wrong rows.
Do I need a LEFT JOIN to include accounts with no items?+
No. An account with no items has a total weight of zero or NULL, which never exceeds 20. An inner join returns exactly the qualifying accounts and keeps the query simpler and easier to verify.
How should I sort the output?+
ORDER BY total_weight DESC, username ASC. The weight sorts highest first, and username breaks ties alphabetically. Usernames are unique, so the ordering is fully deterministic and there are no hidden ties.
How do I prepare for this in 48 hours?+
Write three or four GROUP BY plus HAVING queries from memory. Practice joining two tables, aliasing aggregates, and sorting on multiple columns. Check that every non-aggregated selected column appears in GROUP BY. That covers this question.