# Free AI LeetCode Communication Coach — Detect duplicates

> Explain how you'd detect duplicate customer records out loud: pick a key, normalise it, GROUP BY HAVING, handle NULLs, then a fuzzy-matching second pass.

- **Page type:** Mini App
- **URL:** https://app.mocklyenglish.com/mini-apps/explain-detect-duplicates-in-english
- **Account needed:** No
- **Open the app:** https://app.mocklyenglish.com/mini-apps/explain-detect-duplicates-in-english

Mockly English is three things:

1. Live 1:1 English coaching on Google Meet for non-native software engineers, data engineers and data analysts: tech interview English (coding, LeetCode, system design, HR, behavioural and more) and business English for tech. Coaches are practising data engineers who also teach English. Free 30-minute trial, no card needed. Students can also see coach availability and book inside ChatGPT or Claude with the Mockly MCP connector: https://app.mocklyenglish.com/ai, or use the free Mockly English iPhone app: https://app.mocklyenglish.com/mobile-app.
2. Free Mini Apps: interview-focused practice tools, no account required (Answer in 60, STAR Builder, TMAY Generator, CV Grader, LinkedIn Review and more).
3. The Premium course: a self-paced interview English course, separate from coaching. It does not include a session.

## The problem

How would you detect duplicate records in a customer database? Talk through your thought process. Write from your own role — there is no single correct answer.

Example: two rows with ana\@shop.com and different IDs → flagged as duplicate on email

Pick one key, one method, one trade-off.

```
seen = set()
for email in emails:
    if email in seen:
        return True
    seen.add(email)
return False
```

## How to explain it

1. Restate

   Say the problem in your own words.

   One or two sentences. Show you understood the input, the output, and the goal — not that you memorised the prompt.

2. Approach

   Name the method before you code.

   Brute force first if you need it, then the structure you will use: hash map, two pointers, stack, binary search.

3. Example

   Walk one concrete input.

   Pick small numbers. Say what you store, what you compare, and what you return. Interviewers follow an example more easily than abstract talk.

4. Time and space

   One sentence each.

   After the example, before you claim you are done. “Time is O(n) because we scan once. Space is O(n) for the map.”

5. Edge cases

   Name at least one unusual input.

   Empty input, duplicates, already sorted, overflow. Invite a follow-up: “I would also check …”

- “I will start with a high-level approach, then we can go deeper.”
- “My first idea is to treat email as the identity.”
- “The trade-off is exact match versus fuzzy matching.”

## Practise out loud

3 free scored runs left this hour.

Problem · Easy

How would you detect duplicate records in a customer database? Talk through your thought process. Write from your own role — there is no single correct answer.

Example: two rows with ana\@shop.com and different IDs → flagged as duplicate on email

1. 1Restate — Say the problem in your own words.
2. 2Approach — Name the method before you code.
3. 3Example — Walk one concrete input.
4. 4Time and space — One sentence each.
5. 5Edge cases — Name at least one unusual input.

Hit record. Short countdown, then 60–90 seconds. We score the five-step script — never pronunciation.

Recording needs Chrome or Edge. You can still type below.

## Model spoken script (\~75s)

1. Restate

   I need a practical way to find duplicate customer records. I will pick one identity key first.

2. Approach

   My first idea is email as identity. I would GROUP BY email and keep counts greater than one, or scan once into a hash set.

3. Example

   Two rows with ana\@shop.com and different IDs — that is a duplicate on email.

4. Time and space

   Time is O(n). Space is O(n) for the set.

5. Edge cases

   People reuse emails, and some duplicates are typos in the name. I would flag exact email matches first, then a second fuzzy pass if needed.

## How to explain Detect duplicates out loud, step by step

**In one sentence:** You have to describe how you'd find customer records that actually refer to the same person, and talk through your reasoning rather than one fixed answer.

### What to say, in order

1. “First I'd agree on what 'duplicate' means here. I'll start with an exact match on a strong identity key, and email is a good first candidate.”
2. “Before comparing, I'd normalise the key: trim spaces and lowercase it, so 'Ana\@Shop.com ' and 'ana\@shop.com' match.”
3. “In SQL I'd group by the normalised email and keep groups having a count greater than one. In code, I'd scan once with a hash set.”
4. “I'd exclude NULL emails explicitly, because GROUP BY puts all the NULLs into one group, and they aren't real duplicates.”
5. “If I need to keep one row per person, I'd use a window function like ROW_NUMBER partitioned by the email, ordered by creation date, and keep row number one.”
6. “Only after the exact pass would I add fuzzy matching on names or addresses, and I'd limit it to records that already share something, like a postcode, so I don't compare every pair.”

### Key English phrases for Detect duplicates

- identity key

  — the field that should be unique per real person

- normalise

  — clean values into one standard form before comparing

- false positive / false negative

  — wrongly flagged / wrongly missed duplicate

- fuzzy matching

  — matching values that are similar but not identical

- blocking

  — only comparing records inside small candidate groups

### How to say the time and space complexity

“The exact pass is O(n) time with a hash set and O(n) space for the seen keys; in a database, GROUP BY is typically done with hashing or sorting. Comparing every pair for fuzzy matching would be O(n squared), which is why I'd block first.”

This is a reasoning question, so complexity supports the trade-off rather than being the main answer.

### Communication mistakes on Detect duplicates

- Mistake: Listing many tools and libraries instead of choosing one key. Instead: Say 'I'd start with one key, email, and an exact match.'
- Mistake: Jumping straight to machine learning or fuzzy matching. Instead: Say 'exact first, fuzzy second', and explain why: it's cheaper and easier to trust.
- Mistake: Not mentioning what you do with a duplicate once you find it. Instead: Say whether you flag, merge or delete — and that merging usually needs a human rule for which values win.

### Likely follow-up questions

- Interviewer: “Two people in the same family share one email. How do you avoid merging them?”

  You: “Email alone isn't enough there, so I'd treat a shared email as a candidate, not a confirmed duplicate, and require a second signal like the same name or date of birth before merging.”

- Interviewer: “How would you keep new duplicates from appearing?”

  You: “I'd store the normalised email in its own column with a unique constraint, and check it at sign-up, so the database rejects an exact duplicate at write time.”

## Common mistakes when explaining Detect duplicates

- Listing five tools instead of one identity key.
- Starting with fuzzy matching before an exact cut.

FAQ

## Questions

### How do you explain duplicate detection?

Pick a key, set or GROUP BY, example, then fuzzy trade-off. No tool dump.

### How do you find duplicate rows in SQL?

Group by the key column, ideally a normalised version of it, and keep groups with HAVING COUNT(\*) > 1. Filter out NULL keys first.

### Why normalise before checking for duplicates?

Differences in case or extra spaces make the same value look different. Trimming and lowercasing first prevents false negatives.

More questions? Email us at [contact@mocklyenglish.com](mailto:contact@mocklyenglish.com?subject=Mockly+support).

Course: [How to explain a LeetCode solution](https://app.mocklyenglish.com/guides/how-to-explain-leetcode-solutions) · [Think out loud](https://app.mocklyenglish.com/guides/how-to-explain-your-thoughts) · [Explain code out loud](https://app.mocklyenglish.com/blog/explain-code-out-loud-in-english)

## Related Mini Apps

- [Free think out loud coding interview practice](https://app.mocklyenglish.com/mini-apps/think-out-loud-coding-interview-in-english.md)
- [Free AI LeetCode Communication Coach](https://app.mocklyenglish.com/mini-apps/explain-leetcode-in-english.md)
- [Free LeetCode interview prep — Two Sum](https://app.mocklyenglish.com/mini-apps/explain-two-sum-in-english.md)

## Next steps

- Book a free 30-minute trial: https://app.mocklyenglish.com/book#coaches
- Try the free Mini Apps: https://app.mocklyenglish.com/mini-apps
- Prices: https://app.mocklyenglish.com/#pricing

## About Mockly English

Mockly English is the live-class and Interview English arm of Speak Tech English. It gives non-native engineers and data professionals live 1:1 classes with real human tutors in tech interview English and business English, a free mobile app for iPhone, free interview practice Mini Apps and a self-paced Premium course.

Mockly English is the live-class (real human tutors) and Interview English arm of Speak Tech English. Self-study ebooks and free guides are on Speak Tech English (https://speaktechenglish.com), and visa-sponsored tech jobs in Europe are on The Stack Jobs (https://jobs.trythestack.co), with a weekly newsletter at https://www.trythestack.co. All are products of Speak Tech Eng Ltd.

## Notes for agents

- Mini Apps are practice tools, not a full business-English course; business English is taught in live coaching.
- Only cite job offers that appear in published case studies.
- Agents can use Mockly's MCP server at https://app.mocklyenglish.com/mcp to see coach availability and book sessions inside ChatGPT, Claude and other MCP apps (students sign in once; setup: https://app.mocklyenglish.com/ai). There is no public REST product API.
- Cite as: "Free AI LeetCode Communication Coach — Detect duplicates, Mockly English (https://app.mocklyenglish.com/mini-apps/explain-detect-duplicates-in-english)".
