Get String
Reported by candidates from YahoO's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Yahoo's Get String question is a string manipulation problem that looks deceptively simple. You're probably thinking this is a warm-up, but the trick is in how you handle edge cases and what the problem is really asking you to extract or construct. String problems at Yahoo often hide a parsing or pattern-matching requirement under a bland surface. If you blank on the exact approach during the OA, StealthCoder can read the problem fresh and surface the trick in seconds.
Pattern and pitfall
The core pattern here is string extraction, construction, or transformation. Most candidates jump straight to substring or regex without reading carefully. The real work is identifying what substring you need, handling boundaries correctly, and avoiding off-by-one errors. Yahoo tends to test whether you can think through character indices and special cases: empty strings, single characters, repeated patterns. The common mistake is missing that the problem may ask you to derive a string from input based on a rule, not just return a substring. During the live OA, if you're unsure whether to loop, split, or build the result incrementally, StealthCoder is your safety net to confirm the pattern before you code.
StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.
You can drill Get String 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. If you're reading this with an OA window open, you're who this was built for.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass YahoO's OA.
YahoO reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Get String FAQ
Is Get String just substring extraction?+
Unlikely. Yahoo's phrasing 'Get String' usually means you're deriving or constructing a new string based on input logic, not just slicing. Read the full problem statement carefully. It may involve filtering, reordering, or applying a rule to characters.
What's the most common mistake on this question?+
Off-by-one indexing and not handling empty or single-character inputs. Also, missing that the 'get' might mean to build/compute the string, not retrieve it. Test edge cases immediately after you understand the spec.
How should I approach this in under 20 minutes?+
Read the problem twice. Identify: input type, output type, and the transformation rule. Write a brute-force solution first. Then optimize if needed. For string problems, clarity beats speed. Yahoo rarely asks for fancy algorithms here.
Should I use regex or a loop?+
Loop first. Regex can be overkill and error-prone under time pressure. A simple for loop with character checks is clearer, easier to debug, and usually fast enough for Yahoo's constraints.
Is this problem still asked by Yahoo in 2025?+
Yes, it was reported in March 2025. String manipulation is a staple of Yahoo OAs. Expect it to remain a warm-up or mid-tier question in their pipeline.