PwC Interview Question

How to avoid duplicates in creating record?