FastPrepNon-Repeating Character
Problems/Non-Repeating Character

Non-Repeating Character

Autodesk logoAutodesk● EasyFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported as one of three short coding questions in the opening round of a three-round video interview loop for a full-time senior software engineer role at Autodesk, a role working in C++, which the candidate had applied to online. That round was mostly questions on C++ fundamentals, and the coding questions were named only by their task. This problem covers the non-repeating character one. The candidate passed and rated the interviews easy.

The report names only the task, with no function, limits or examples, so we made these choices. The function returns the leftmost character that is in the string only once, as a string holding just that character, or an empty string if there is none. The string holds 1 to 100,000 lowercase English letters, the usual limits for this task. The examples are ours. The other two coding questions, the design round and the hiring manager round are not part of this problem.

Our version is about 85% the same as the reported question.

Some characters of s show up exactly one time in it; call those non-repeating. Return the leftmost non-repeating character, the one at the smallest position in s, as a string that holds just that character.

When s has no non-repeating character, return "".

Function

firstNonRepeatingChar(s: String) → String

Examples

Example 1

s = "stress"return = "t"

The letter s is there three times. t, r and e are there once each, and t is the leftmost of those three.

Example 2

s = "pepper"return = "r"

p is there three times and e twice. That leaves r, which is there once and sits at the very end.

Example 3

s = "abba"return = ""

a and b are both there twice. Nothing is there just once, so "" is returned.

Constraints

  • 1 <= s.length <= 10^5
  • s is made of lowercase English letters, a to z

More Autodesk interview questions

  • Remove Trailing ZerosONSITE INTERVIEW · Seen Nov 2026
  • Reverse Linked ListONSITE INTERVIEW · Seen Nov 2026
  • LRU Cache with TTLONSITE INTERVIEW · Seen Oct 2026
  • Deep Merge with a Conflict ResolverONSITE INTERVIEW · Seen Mar 2026
  • Diagonal Bounce TraversalOA · Seen Oct 2026
  • Interleave Array HalvesOA · Seen Oct 2026
  • Latest Arrival to Catch a BusOA · Seen Oct 2026
  • Find Top Two TeamsOA · Seen Sep 2026
  • In-Memory Database with TTLOA · Seen Mar 2026

Similar questions at other companies

  • Container Ledger with TradesFlexport · ONSITE INTERVIEWFlexport interview questions
  • Count Adjacent Symbol Pairs for BPEAmazon · ONSITE INTERVIEW
  • Count a User's Actions in an Event LogMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Map and Accumulate Learning QueriesPalantir · ONSITE INTERVIEWPalantir interview questions
  • Filter Pins by Excluded IDsPinterest · ONSITE INTERVIEWPinterest interview questions
  • First Non-Repeating CharacterGoldman Sachs · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions
  • Longest Dictionary Word from Nine LettersGoogle · ONSITE INTERVIEWGoogle interview questions
  • Minimum Replacements to Make Two Strings AnagramsBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Logger Rate LimiterAmazon Web Services · ONSITE INTERVIEWAmazon Web Services interview questions
  • Isomorphic StringsRemitly · ONSITE INTERVIEWRemitly interview questions

Autodesk interview experiences

  • Autodesk SDE Intern OA and Interviews: 5 Experiences
All Autodesk interview questionsSee Autodesk hiring insights
Saved
class Solution {
    public String firstNonRepeatingChar(String s) {
        // Write your code here.
    }
}
Checking account…