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
Coding & Algorithms
Software Engineer
Accenture
November 29, 2026
Software Engineer
Online Assessment
Coding & Algorithms
Easy

0

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
String parsing
Data cleansing
Hash set de-duplication
Input validation
Order preservation
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. 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 Problems
Sample 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...


Submit Your Answer
Markdown supported

Related Questions