Arranging Coins
A easy-tier problem at 47% community acceptance, tagged with Math, Binary Search. Reported in interviews at GoDaddy and 0 others.
Arranging Coins is a deceptively simple problem that trips up candidates who overthink it. You're given n coins and need to build a staircase where the k-th row has exactly k coins. How many complete rows can you build. The 47% acceptance rate hints that the obvious loop solution isn't what interviewers want to see. GoDaddy has asked this. The trick is recognizing that you're solving a mathematical equation, not simulating rows. If you blank on the pattern during the live assessment, StealthCoder surfaces the optimal approach in seconds, invisible to the proctor.
Companies that ask "Arranging Coins"
Arranging Coins 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 an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too.
Get StealthCoderMost candidates start by simulating: subtract 1, then 2, then 3, and so on until coins run out. It works, but it's O(sqrt(n)) in a loop. The real move is jumping straight to math. You're looking for the largest k where k*(k+1)/2 <= n. This is a quadratic equation. You can solve it algebraically (k = (-1 + sqrt(1 + 8n)) / 2, then floor it) or binary search for k. Both beat the simulation. Binary search is safer if you're shaky on algebra. The binary search version is also a clean demo of the topic, so expect that to impress more. StealthCoder handles both patterns, but understanding why the math works is the real interview signal here.
Pattern tags
You know the problem.
Make sure you actually pass it.
Arranging Coins 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 an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Arranging Coins interview FAQ
Is Arranging Coins actually asked at GoDaddy and similar companies?+
Yes. GoDaddy has confirmed reports of this problem. It's an Easy, so it usually appears early in a loop or as a warm-up. The low acceptance rate suggests candidates either oversimplify or second-guess themselves under pressure.
What's the trick most people miss?+
Treating it as a simulation problem instead of recognizing the math. You're not actually building stairs. You're finding the largest k where the sum 1+2+3+...+k doesn't exceed n. Once you see that, the quadratic formula or binary search falls into place immediately.
Should I use the math formula or binary search?+
Both are O(1) and O(log n) respectively, fast enough here. If you're confident in algebra, the formula is shorter. If you're not, binary search is safer and shows algorithmic thinking. Either answer is solid. Pick whichever you can code without hesitation.
How does this relate to the Binary Search topic listed?+
The problem can be solved with binary search on k in the range [0, n]. Some interviewers specifically want to see binary search to test that skill. Check the problem statement or ask your interviewer which approach they prefer before coding.
Can the loop solution pass?+
Yes, it'll pass all test cases. But it's slower and weaker on interview signal. Interviewers ask this problem to see if you recognize the underlying math or algorithmic pattern, not to see if you can count.
Want the actual problem statement? View "Arranging Coins" on LeetCode →