PwC interview question

How to avoid duplicates in creating record?