Normalize And Deduplicate CRM Contact Emails On Import

Last updated: November 29, 2026

Quick Overview

A user imports a CSV of contacts into Zoho CRM. Return the contacts in their original order with duplicates removed, where two rows are duplicates if their email addresses match after trimming whitespace and ignoring case; rows without a usable email are dropped.

Zoho
Coding & Algorithms
Software Engineer
Zoho
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Easy

0

0

0 solved


A user imports a CSV of contacts into Zoho CRM. Return the contacts in their original order with duplicates removed, where two rows are duplicates if their email addresses match after trimming whitespace and ignoring case; rows without a usable email are dropped.

Bulk import is one of the first things a new Zoho CRM customer does, and duplicate contacts are a classic support complaint. The interviewer wants a clean single-pass solution, an explicit statement of the matching rule, and awareness that the rule is a product decision.

What the Interviewer Expects
  • State the duplicate rule before coding
  • Preserve first-seen order
  • Use a set for O(1) membership checks
  • Keep the trimmed original value for display while matching on a normalized key
  • Skip blank or invalid emails rather than crashing
Key Topics to Cover
Hashing
Data normalization
Order preservation
Import pipelines
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
  • Should the local part be case-sensitive per the email RFC, and what would you choose for a CRM?
  • How would you merge fields from duplicates instead of keeping only the first?
  • How would you dedupe against the contacts already in the account, which may be millions?
  • How would you handle Gmail-style dots and plus addressing?
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 dicts with at least an email key. Match key = trimmed, lowercased email. Keep the first occurrence, drop later ones, drop rows with no @. Output keeps the other fields untouched...

High-Level Design

One pass with a seen set of normalized keys. For each row compute the key, skip if invalid or seen, otherwise record it and append the row with the trimmed email....


Submit Your Answer
Markdown supported

Related Questions