Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

First non-repeating character in a request id

Python data engineering interview problem. Difficulty: intermediate. Pattern: Hashing. About 15 minutes. Part of the Pro drill bank.

Request ids are short strings. An incident tool wants the first character that never repeats, which is a cheap fingerprint for 'this id looks unique'.

Return the first non-repeating character in a request id.

Requirements

  • First means leftmost in the original string.
  • A character that appears twice is never the answer.

Constraints

  • Case is significant unless the prompt lowercases.

Examples

Input: first_unique_char('aabbc') Output: 'c' This input follows the stated rules and produces this output.

Topics: lakebench, python, hash-based-problems.

More Python interview questions · All interview problems · Learn data engineering

intermediate

First non-repeating character in a request id

Interview-style drill: Return the first character in a string that does not repeat elsewhere in it.

Return the first non-repeating character in a request id.