MEDIUMasked at 1 company

Count Unhappy Friends

A medium-tier problem at 62% community acceptance, tagged with Array, Simulation. Reported in interviews at Bloomberg and 0 others.

Founder's read

Count Unhappy Friends is a medium-level simulation problem that Bloomberg has asked. You're given arrays representing friendships and happiness thresholds, and you need to count how many people don't meet their satisfaction bar. It's not a hard algorithmic problem, but the implementation is error-prone: you have to track bidirectional relationships, check multiple conditions per person, and avoid off-by-one bugs. If this hits your live assessment and you freeze on the logic, StealthCoder surfaces a clean solution invisible to the proctor.

Companies asking
1
Difficulty
MEDIUM
Acceptance
62%

Companies that ask "Count Unhappy Friends"

If this hits your live OA

Count Unhappy Friends 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 used it to pass JPMorgan's OA and system design loop.

Get StealthCoder
What this means

The trap is treating this like a graph problem when it's really a simulation. You iterate through each person, check if they're unhappy by comparing their actual friends to their happiness requirement, and count mismatches. Common failures: forgetting that friendships are bidirectional, misunderstanding the happiness condition (do they need X friends or friends with combined score X), or iterating inefficiently and timing out. The straightforward approach is O(n*m) where n is people and m is friends per person. StealthCoder is your safety net on test day if the wording trips you up or you blank on edge cases.

Pattern tags

The honest play

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

Count Unhappy Friends 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 Amazon engineer who used it to pass JPMorgan's OA and system design loop. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Count Unhappy Friends interview FAQ

What's the actual trick in Count Unhappy Friends?+

There isn't one. It's pure simulation and careful bookkeeping. Build a set or list of friends for each person, iterate through everyone, count how many don't meet their happiness threshold. The difficulty comes from not misreading the happiness condition or forgetting bidirectional edges, not from a clever algorithm.

Is Bloomberg still asking this problem?+

Bloomberg is listed as the company that's asked it. One company reporting doesn't mean high frequency across finance, but Bloomberg's known for simulation and array problems. Worth drilling if you have a Bloomberg OA coming.

How does this compare to other Array and Simulation problems?+

Simulation problems test implementation discipline and edge-case thinking more than algorithm knowledge. Array-based simulations like this are common at Bloomberg. If you're solid on two-pointer and greedy array work, this is a step down in conceptual difficulty but requires clean code.

What's the acceptance rate telling me?+

62% acceptance is above average for medium problems. Most candidates who attempt it pass, which means the problem is testing implementation and careful reading, not algorithmic insight. Your risk isn't the algorithm, it's rushing and misreading the happiness condition.

How do I avoid the most common mistakes?+

Trace through the sample input by hand first. Double-check that friendship is bidirectional and that you understand the exact happiness threshold. Write out the unhappy condition explicitly. Most fails are careless implementation, not logic flaws, so slow down on the problem statement.

Want the actual problem statement? View "Count Unhappy Friends" 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.