FastPrepBacktick Identifier Converter
Problems/Backtick Identifier Converter

Backtick Identifier Converter

Hudson River Trading logoHudson River Trading● EasyOA
QuestionFunctionExamplesConstraints

Problem statement

Source note: This came from a real HRT OA report. The original report shared the core backtick identifier conversion task; FastPrep filled in the runnable function format and practice examples so you can try it here. Estimated match rate: 85-90% for the core task, 65-75% for exact wording and runner details. If you find a fuller version, feel free to let us know and we will update it.

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.

More Hudson River Trading problems

  • Format a Signed Integer with CommasPHONE SCREEN · Seen Nov 2026
  • Format a Signed Integer with CommasPHONE SCREEN · Seen Nov 2026
  • Order and Batch Open-Close LifecyclePHONE SCREEN · Seen Nov 2026
All Hudson River Trading interview questionsSee Hudson River Trading hiring insights
Saved
class Solution {
    public String convertIdentifiers(String text) {
      // write your code here
    }
}
Checking account…