Reported July 2026
Hudson River Tradingstring

Backtick Identifier Converter

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

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

Hudson River Trading reported this one in July 2026, and it looks easier than it is. The naive version splits on underscores and capitalizes, then falls over on an unmatched backtick or a constant like MAX_RETRY_COUNT. It's a single-pass string scan with a few rules you have to get exactly right. If you've got an OA invite, this is a parsing problem, not a clever algorithm. StealthCoder sits invisibly on your screen as a safety net if you blank on the edge cases mid-assessment.

The problem

You are given a string text. Some identifiers in the string are wrapped in backticks, such as `user_id`.
For every backtick-wrapped identifier:
If the identifier is an all-uppercase constant, leave it unchanged.
Otherwise, treat it as a snake_case function or variable name and convert it to camelCase.
Return the full string after converting only the text inside complete backtick pairs. Preserve the backticks and all text outside them.
An identifier is treated as an all-uppercase constant when it contains at least one letter and every letter in it is uppercase. Underscores and digits do not affect this check.

Function
convertIdentifiers(text: String) → String
Complete convertIdentifiers.
String text: the text to transform
Returns String: the transformed text.

Examples
Example 1
text = "Call `get_user_name` before reading `MAX_RETRY_COUNT`."
return = "Call `getUserName` before reading `MAX_RETRY_COUNT`."
get_user_name is converted to camelCase, while the uppercase constant is unchanged.
Example 2
text = "Use `parse_http_response` and `user_id` now."
return = "Use `parseHttpResponse` and `userId` now."
Both snake_case identifiers inside backticks are converted and the rest of the text is preserved.

Constraints
1 <= text.length <= 10^5
text contains printable ASCII characters.
Backtick-wrapped identifiers contain letters, digits, and underscores.

Reported by candidates. Source: FastPrep

Pattern and pitfall

Scan the string once. Find an opening backtick, then look for the next backtick. If there's no closing one, the rest of the text stays untouched, since only complete pairs convert. Inside a complete pair, check the constant rule: at least one letter and no lowercase letters. If it's a constant, copy it as is. Otherwise convert snake_case to camelCase by dropping each underscore and uppercasing the next character. The pitfalls are real. An identifier with no letters, like `123_456`, isn't a constant by the definition, so it goes through conversion. Digits after underscores shouldn't break anything. Leading and trailing underscores and doubled underscores need a decision, so handle them without crashing. Build output with a list or builder, never repeated string concatenation, because length hits 10^5. If you blank on the pairing logic live, StealthCoder is the hedge that reads the problem and hands you a working scan.

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 Backtick Identifier Converter 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 Hudson River Trading's OA.

Hudson River Trading 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.

Backtick Identifier Converter FAQ

What's the trick in the Backtick Identifier Converter?+

It's careful parsing, not a data structure. Pair backticks left to right, ignore a trailing unmatched backtick, then apply the constant check before converting. Most failures come from the constant definition and the unmatched backtick, not the camelCase conversion itself.

How do I decide if an identifier is a constant?+

It needs at least one letter, and every letter must be uppercase. Underscores and digits are ignored. So MAX_RETRY_COUNT and API2 are constants, but user_id isn't, and a digits-only identifier has no letters, so it isn't a constant either.

What edge cases should I test before submitting?+

Test an unmatched final backtick, empty backticks, a digits-only identifier, a mixed-case name like getUser_id, leading or trailing underscores, and consecutive underscores. Also test text with no backticks at all. Each one breaks a sloppy implementation in a different way.

What complexity does Hudson River Trading expect here?+

Linear time in the length of text, with up to 10^5 characters. Do one pass and build the result in a list, then join it. Quadratic string concatenation or repeated slicing can be slow at that size, so avoid it.

How do I prepare for this in 48 hours?+

Write the scanner from scratch twice. Focus on pairing delimiters, a helper that checks the constant rule, and a helper that converts snake_case. Then run your own tricky inputs. This is a pattern of string parsing with rules, so practicing similar delimiter problems helps more than anything advanced.

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

OA at Hudson River Trading?
Invisible during screen share
Get it