PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Walmart Labs

Find first non-repeating character

Last updated: Mar 29, 2026

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.

Related Interview Questions

  • Implement lexicographically smallest Two Sum - Walmart Labs (medium)
  • Check whether brackets are balanced - Walmart Labs (medium)
  • Compute days until plants stop dying - Walmart Labs (medium)
  • Count ways to make change (DP) - Walmart Labs (medium)
  • Find shared courses between student pairs - Walmart Labs (medium)
Walmart Labs logo
Walmart Labs
Dec 7, 2025, 12:00 AM
Machine Learning Engineer
Onsite
Coding & Algorithms
2
0
Loading...

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).

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Walmart Labs•More Machine Learning Engineer•Walmart Labs Machine Learning Engineer•Walmart Labs Coding & Algorithms•Machine Learning Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ 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
  • Compare Platforms
  • Discord Community

Support

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

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.