Circles
Reported by candidates from IBM's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
IBM's Circles problem hit the OA in February 2024, and it's a geometry trap that looks simpler than it is. The catch is recognizing when you're dealing with circle overlap, containment, or intersection math rather than brute force iteration. Most candidates blank on the geometric formula and waste time coding a naive solution. StealthCoder gives you the pattern the moment you see the problem statement, so you can skip the false starts and lock in the right approach within minutes.
Pattern and pitfall
Circles problems typically hinge on distance calculations between centers and radius comparisons. You need to determine if circles overlap, are contained, intersect at edges, or are disjoint. The core trick: compute the distance between two circle centers using the distance formula, then compare it against the sum and difference of their radii. If distance equals sum of radii, they touch externally. If distance is less than the difference of radii, one is inside the other. If distance is zero and radii are equal, they're identical. The pitfall is hardcoding a brute force check instead of using the algebraic shortcut. When you're live and your mind goes blank, StealthCoder instantly surfaces the geometric invariants so you can code the comparison logic without re-deriving it.
The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.
You can drill Circles 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 for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass IBM's OA.
IBM reuses patterns across OAs. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Circles FAQ
Is this a sorting or simulation problem?+
No. It's pure geometry. You're checking spatial relationships between circles using distance formulas and radius algebra. Sorting or iteration usually means you've taken a wrong turn. Trust the math, not loops.
What's the trick IBM is testing?+
Recognition that circle problems reduce to distance and radius comparisons, not pixel-by-pixel or brute-force checks. They want to see you think algebraically, not procedurally. One formula beats a nested loop every time.
How do I handle floating-point edge cases?+
Use epsilon comparisons for equality checks. Instead of distance == sum_of_radii, use abs(distance - sum_of_radii) < 1e-9. This catches rounding errors and keeps your logic clean in a live OA.
Should I precompute distances or calculate on demand?+
Depends on the input size. If you're checking many pairs, cache distances. If it's a small set, calculate on demand. But the real win is using the right formula first. Algorithm beats optimization here.
Is this problem still asked in 2024?+
Yes, IBM still uses geometry and spatial reasoning in their OAs. It's not a trend problem. It tests fundamentals. If you see circles, rectangles, or points, expect math, not data structure patterns.