EASYasked at 1 company

Keep Multiplying Found Values by Two

A easy-tier problem at 71% community acceptance, tagged with Array, Hash Table, Sorting. Reported in interviews at Goldman Sachs and 0 others.

Founder's read

You're given an array and need to repeatedly find a value, multiply it by two, and keep going until you can't find the next value. Goldman Sachs has asked this. It sounds simple because it is, but the trick is picking the right data structure so you're not scanning the array over and over. Most candidates nail the logic but tank the efficiency. If this lands in your assessment and you blank on optimization, StealthCoder surfaces the working solution invisible to the proctor. It's a 70% acceptance rate problem, which means plenty of people clear it, but plenty also get caught on a detail.

Companies asking
1
Difficulty
EASY
Acceptance
71%

Companies that ask "Keep Multiplying Found Values by Two"

If this hits your live OA

Keep Multiplying Found Values by Two 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 a senior engineer who knows the OA is theater. This is the script.

Get StealthCoder
What this means

The core pattern is straightforward: start with a value, double it, check if the doubled value exists in the array, repeat until you can't find the next value. The trap is how you check for existence. A naive loop through the array for each lookup is O(n²) and will timeout on larger inputs. The smarter play is converting the array to a hash table or set first, so each lookup is O(1), bringing the whole thing down to O(n). Sorting can also work if you're clever about it, but a set is cleaner. The simulation part is just the loop logic itself. When your OA clock is ticking and you start coding the nested loop version, that's where StealthCoder steps in and shows you the hash table approach in real time.

Pattern tags

The honest play

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

Keep Multiplying Found Values by Two 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. Built by a senior engineer who knows the OA is theater. This is the script. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Keep Multiplying Found Values by Two interview FAQ

How hard is this really, and who's asking it?+

Goldman Sachs has reported asking it. It's an easy problem with 71% acceptance, so it's not a trick question. Most people solve it, but slower approaches can fail. It's a real screening question, not a warmup.

What's the actual trick?+

Use a set or hash table for O(1) lookups instead of scanning the array each time. Convert the input to a set upfront, then loop through your multiplications. That's the difference between a pass and a timeout.

Do I need to sort the array?+

Not required. Sorting adds O(n log n) overhead for no real benefit here. A set is faster and simpler. Stick with hash table unless the problem explicitly asks you to output a sorted result.

What happens if the starting value isn't in the array?+

The problem will specify what to return, usually 1 or -1 to indicate no valid sequence exists. Check the exact wording. This is more about reading carefully than algorithm logic.

Is this question still live at Goldman Sachs?+

It's in the company's known problem set. Easy problems rotate in and out, but interview patterns persist. If it appears, you'll be expected to solve it cleanly and quickly.

Want the actual problem statement? View "Keep Multiplying Found Values by Two" 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.