PracHub
QuestionsCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates string manipulation, frequency-counting concepts, algorithmic complexity reasoning, and attention to edge-case handling in sequence data.

  • easy
  • Walmart Labs
  • Coding & Algorithms
  • Machine Learning Engineer

Find first non-repeating character

Company: Walmart Labs

Role: Machine Learning Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Onsite

Given a string `s`, return the **first character that appears exactly once** in the string (i.e., the leftmost non-repeating character). - If no such character exists, return an empty string (or a sentinel like `""`). ### Examples - Input: `"leetcode"` → Output: `"l"` - Input: `"aabb"` → Output: `""` ### Constraints - `1 ≤ len(s) ≤ 1e5` - `s` contains standard ASCII letters/digits/punctuation (you may assume ASCII for counting).

Quick Answer: This question evaluates string manipulation, frequency-counting concepts, algorithmic complexity reasoning, and attention to edge-case handling in sequence data.

Return the leftmost character that appears exactly once, or an empty string.

Constraints

  • Inputs are Python literals matching the function signature.
  • Return a deterministic exact-match value.

Examples

Input: ('leetcode',)

Expected Output: 'l'

Explanation: l is first non-repeating.

Input: ('aabb',)

Expected Output: ''

Explanation: No non-repeating character.

Input: ('swiss',)

Expected Output: 'w'

Explanation: w is first unique.

Hints

  1. Clarify edge cases before coding.
  2. Keep the return value deterministic.
Last updated: Jun 27, 2026

Loading coding console...

PracHub

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

Product

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

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

  • Implement lexicographically smallest Two Sum - Walmart Labs (medium)
  • Count ways to make change (DP) - Walmart Labs (medium)
  • Check whether brackets are balanced - Walmart Labs (medium)
  • Compute days until plants stop dying - Walmart Labs (medium)
  • Find shared courses between student pairs - Walmart Labs (medium)