Loading...
The First Encounter
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- junior, mid
Problem
Your team is building a data quality tool that needs to track the first time each unique value appears in a sequence. Given a string, return a dictionary mapping each character to the index of its first occurrence. Characters that appear multiple times should only record the first position.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.