Reported November 2023
ZipRecruiterstring

Convert Backticked Identifiers to Camel Case

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

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

The ZipRecruiter OA reported in November 2023 hands you a docstring up to 100000 characters and asks you to rewrite snake_case names inside backticks into camelCase. Nothing outside the backticks can change. It's a string parsing problem, not a clever algorithm problem. The trap is doing it the slow way on a big input, or mangling the uppercase constants. If you blank on the parsing loop during the live OA, StealthCoder runs invisibly as a safety net and gives you a working solution while you keep typing.

The problem

Delimiter code point 96 encloses space-separated lowercase snake_case identifiers or UPPER_CASE constants. Convert eligible lowercase identifiers inside delimiters to camelCase. Preserve uppercase constants and all outside text.

Function
convertBacktickedIdentifiers(docstring: String) → String

Examples
Example 1
docstring = "Use `foo_bar MAX_VALUE` now"
return = "Use `fooBar MAX_VALUE` now"
Only eligible identifiers inside the delimited region change.
Example 2
docstring = "`one_two three` outside_name"
return = "`oneTwo three` outside_name"
Only eligible identifiers inside the delimited region change.

Constraints
0 <= docstring.length <= 100000
Delimiters are balanced.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is a single left-to-right pass. Track whether you're inside a backtick region by toggling a flag on code point 96. Outside, copy characters straight through. Inside, split on spaces into tokens and decide per token. If a token is all lowercase letters, digits and underscores, convert it. If it's UPPER_CASE, leave it alone. Conversion means dropping each underscore and uppercasing the next letter. The input size of 100000 rules out repeated string concatenation and repeated rescans, so build output in a list or StringBuilder and join once. Common pitfalls: collapsing or losing the original spaces, treating a token like MAX_VALUE as eligible because it has an underscore, and mishandling leading or trailing underscores. Pin down those edge cases before coding. If the live OA throws you off, StealthCoder is the hedge that hands you the clean single-pass version.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Convert Backticked Identifiers to Camel Case 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 by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.

Get StealthCoder

Related leaked OAs

⏵ The honest play

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

ZipRecruiter reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Convert Backticked Identifiers to Camel Case FAQ

What's the trick in the ZipRecruiter backticked identifier problem?+

One pass with an inside/outside flag toggled on the backtick. Outside the region you copy text unchanged. Inside, you process each space-separated token and only convert the lowercase snake_case ones. Build the result in a list and join once so it stays linear on 100000 characters.

How do I tell an eligible identifier from a constant?+

Check the token's letters. If it has no uppercase letters, it's a lowercase snake_case identifier and gets converted. If it's UPPER_CASE like MAX_VALUE, you leave it exactly as is. The examples only show those two kinds, so don't over-engineer mixed-case rules.

Does input size matter here?+

Yes. With docstrings up to 100000 characters, repeated string concatenation or rescanning the string per token can get slow. Keep it O(n) with one scan and a character buffer. Nothing fancy is needed beyond that.

What edge cases should I test?+

Test an empty string, text with no backticks, multiple backtick regions, and a region holding only constants. Also check that spacing is preserved exactly and that text outside the regions, like outside_name, stays untouched. Delimiters are guaranteed balanced, so you don't need unmatched-backtick handling.

How do I prepare for this in 48 hours?+

Write the camelCase conversion helper first, then the region-toggle loop, then wire them together. Run both examples by hand. This is a string-manipulation pattern, so an hour of careful practice on parsing loops covers it.

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

OA at ZipRecruiter?
Invisible during screen share
Get it