Reported May 2024
Goldman Sachsstring

Encode or Decode Message

Reported by candidates from Goldman Sachs's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Goldman Sachs OA. Under 2s to a working solution.
Founder's read

Goldman Sachs sent you an encoding/decoding problem in May 2024, and you've got less than 72 hours to lock it down. This is a classic string manipulation task that catches candidates who overthink it. The OA is testing whether you can parse a rule, apply it consistently, and handle edge cases without crashing. It's not about complex algorithms. It's about reading comprehension and clean implementation. StealthCoder sits invisible during your session and can feed you the pattern the moment you freeze.

Pattern and pitfall

The trick here is that the problem statement itself is the specification. You're either encoding plaintext into ciphertext or decoding ciphertext back. The most common variant is a simple character-mapping rule: shift, substitution, or positional transformation. Candidates usually fail by hardcoding assumptions about which direction they need to implement, or by forgetting that encode and decode must be inverses. The pitfall is writing one function and assuming it works bidirectionally when it doesn't. Test both directions explicitly. StealthCoder can surface the exact encoding rule from the problem text in real time if you blank on the logic, so you stay unblocked while the proctor sees nothing.

The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.

If this hits your live OA

You can drill Encode or Decode Message 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 StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Goldman Sachs's OA.

Goldman Sachs 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.

Encode or Decode Message FAQ

Is this a Caesar cipher or something more complex?+

Goldman Sachs OAs usually don't assume Caesar. Read the problem statement carefully for the exact rule. It could be any systematic character mapping. Once you extract the rule, implement it literally. Don't invent complexity.

Do I need to handle both encode and decode in one function?+

Almost certainly yes. Write a single function that takes a direction parameter or two separate functions that are true inverses of each other. Test both ways before submitting. Most failures happen when only one direction works.

What edge cases trip people up?+

Empty strings, special characters, spaces, case sensitivity. Check whether your mapping preserves or transforms non-alphabetic characters. Test the examples they give you, then test edge cases they don't mention.

How long does Goldman Sachs usually give for this?+

Typically 15-25 minutes for a single encoding/decoding problem. That's enough time to code, test, and debug if you don't second-guess the problem statement. Spend the first 2 minutes parsing the rule exactly.

Should I use a lookup table or compute the mapping?+

A lookup table (hash map or dictionary) is cleaner and faster if the mapping is arbitrary. If it's positional or mathematical, compute it. Either works. Pick whichever makes the code shorter and clearer.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Goldman Sachs.

OA at Goldman Sachs?
Invisible during screen share
Get it