Normalize Employee IDs From a Legacy Mainframe Export
Last updated: November 29, 2026
Quick Overview
A client's HR mainframe exports employee IDs in inconsistent forms (lowercase prefixes, dashes, spaces, missing zero padding). Write a function that returns the distinct valid IDs in canonical form ACN plus 8 digits, preserving first-seen order and dropping invalid entries.
Accenture
November 29, 20260
0
0 solved
A client's HR mainframe exports employee IDs in inconsistent forms (lowercase prefixes, dashes, spaces, missing zero padding). Write a function that returns the distinct valid IDs in canonical form ACN plus 8 digits, preserving first-seen order and dropping invalid entries.
Entry-level Accenture loops often open with an online coding assessment, and data cleansing tasks like this mirror the first weeks of a legacy-to-cloud migration engagement. The grader checks careful string handling, explicit validation rules and stable de-duplication rather than clever algorithms.
What the Interviewer Expects
- States the canonical format and validation rules before coding
- Strips whitespace, case-folds and removes separators consistently
- Rejects non-numeric or over-long IDs instead of truncating them
- De-duplicates on the normalized value while preserving first-seen order
- Runs in linear time over the input
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you report the rejected rows back to the client data owner?
- What changes if two different raw IDs normalize to the same value but belong to different people?
- How would you run this over a 200 million row export?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input is a list of raw strings. Output is a list of canonical IDs ACN + 8 digits. Rules: trim, uppercase, optional ACN prefix, ignore dashes and spaces, digits only, at most 8 significant digits, ...
High-Level Design
One pass. For each raw value: normalize into a digit string, validate, rebuild the canonical form, then check a seen set. A set gives O(1) membership and a separate list keeps order. Normalizing bef...