PracHub
QuestionsLearningGuidesInterview Prep

Quick Overview

Convert a valid lowercase snake-case identifier to lower camel case. Remove separators, capitalize each later word's first letter, and support both single-word names and inputs up to one hundred thousand characters.

  • hard
  • Google
  • Coding & Algorithms
  • Software Engineer

Convert Valid Snake Case to Lower Camel Case

Company: Google

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Technical Screen

# Convert Valid Snake Case to Lower Camel Case Given a valid snake-case identifier, convert it to lower camel case. The input consists of one or more lowercase ASCII words separated by single underscores. There is no leading underscore, trailing underscore, or pair of adjacent underscores. The output keeps the first word lowercase, removes each underscore, and capitalizes the first letter of every later word. Implement: ```python def solve(name: str) -> str: ... ``` ## Constraints - `1 <= len(name) <= 100_000` - `name` matches `[a-z]+(?:_[a-z]+)*` ## Examples ```text "foo_bar" -> "fooBar" "already" -> "already" "http_api_name" -> "httpApiName" ```

Quick Answer: Convert a valid lowercase snake-case identifier to lower camel case. Remove separators, capitalize each later word's first letter, and support both single-word names and inputs up to one hundred thousand characters.

Implement solve(name). The valid snake-case input contains lowercase ASCII words separated by single underscores. Keep the first word lowercase, remove underscores, and capitalize the first letter of each later word.

Constraints

  • 1 <= len(name) <= 100,000
  • name matches [a-z]+(?:_[a-z]+)*.

Examples

Input: ('a',)

Expected Output: 'a'

Explanation: Checks one or several valid snake-case words.

Input: ('already',)

Expected Output: 'already'

Explanation: Checks one or several valid snake-case words.

Hints

  1. An underscore signals that the next letter should be capitalized.
  2. The input validity guarantee removes empty-word edge cases.
Last updated: Jul 18, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Count Overlapping Rectangle Updates on a Grid - Google (hard)
  • Find A Threshold-Limited Path With Minimum Required Safety - Google (medium)
  • Filter Repeated Robot Status Messages - Google (medium)
  • Minimize Direction Violations in a Directed Road Network - Google (medium)
  • Find the Largest Monotone Increasing Number - Google (medium)