MEDIUMasked at 1 company

Suspicious Bank Accounts

A medium-tier problem at 45% community acceptance, tagged with Database. Reported in interviews at J.P. Morgan and 0 others.

Founder's read

Suspicious Bank Accounts is a database problem that shows up in J.P. Morgan assessments. You're given transaction tables and need to identify accounts that meet certain risk criteria. With a 45% acceptance rate, it's not trivial. Most candidates either over-complicate the query logic or miss edge cases in the filtering conditions. The trick is clean join structure and exact threshold matching. If this hits your live OA and you blank on the window functions or GROUP BY logic, StealthCoder surfaces a working solution in seconds, invisible to the proctor.

Companies asking
1
Difficulty
MEDIUM
Acceptance
45%

Companies that ask "Suspicious Bank Accounts"

If this hits your live OA

Suspicious Bank Accounts 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 engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share.

Get StealthCoder
What this means

This problem lives in the zone where SQL fundamentals meet real-world constraints. You'll write queries that aggregate transaction data, compare counts or sums against thresholds, and join multiple tables without duplicating rows. The gotcha isn't the syntax. It's knowing when to use HAVING vs WHERE, when to aggregate before joining vs after, and how to handle NULL values in financial data. Common failures come from candidates who join first and then filter, creating cartesian product nightmares, or who forget that some accounts may have zero qualifying transactions and shouldn't appear in results. The pattern is: aggregate to get your suspicious signals, then filter those aggregates, then join back to get account details if needed. StealthCoder is your hedge if the exact column names or threshold values trip you up on test day.

Pattern tags

The honest play

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

Suspicious Bank Accounts recycles across companies for a reason. It's medium-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 engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Suspicious Bank Accounts interview FAQ

Is Suspicious Bank Accounts actually asked at J.P. Morgan?+

Yes. It's in their database problem rotation. With a 45% pass rate across all attempts, it's considered mid-difficulty. J.P. Morgan uses it to filter for SQL competence and understanding of financial data logic, so expect it if you're in their pipeline.

What's the trick that catches most candidates?+

Incorrect join order or filtering logic. Many candidates join tables first and then try to filter, which creates duplicate rows and wrong aggregate counts. The pattern that works: aggregate and filter first using GROUP BY and HAVING, then join to fetch full account details. Test your logic on small datasets before submitting.

How does this relate to real database work?+

It mirrors actual anti-fraud queries. Banks run queries like this to flag accounts for review. You're writing production-grade SQL that touches real business logic. That's why the thresholds and edge cases matter so much. Careless aggregation can miss fraud or flag legitimate customers.

Do I need window functions for this problem?+

Probably not required, but they can simplify certain approaches. Most clean solutions use GROUP BY, HAVING, and joins. Window functions can help if you need ranked or running totals, but they add complexity. Stick with the fundamentals unless the problem explicitly requires time-series analysis.

What happens if an account has no transactions in the period?+

It shouldn't appear in your result set. If you're counting transactions and the threshold is 'more than 5', an account with zero transactions won't have a row in the aggregated table and won't join to your output. Be deliberate about INNER vs LEFT JOIN based on the problem's exact wording.

Want the actual problem statement? View "Suspicious Bank Accounts" 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.