# Easy Problem: Find Duplicate Contacts

**Type:** Apex trigger · **Difficulty:** Easy · **Object:** Contact · **Topics:** Easy, Apex Trigger, Contact, Duplicates, Bulk

Practice this problem interactively (write and run your Apex trigger against realistic data): https://www.forcechallenges.com/problems/easy-find-duplicate-contacts

## Problem

Write a Contact trigger that stops duplicate contacts from being saved. A contact is a duplicate if its Email OR Mobile Phone matches another contact. Check both contacts coming in together and contacts already saved in the org. Show a simple error message on duplicate records. Contacts with different email addresses and mobile numbers should be allowed.

## Constraints

Use one query per trigger batch. Do not run SOQL or DML inside a loop. A non-blank matching email OR mobile phone means the contact is a duplicate.

---
Source: ForceChallenges · last updated 2026-10-12
