Pregunta de entrevista de PwC

How to avoid duplicates in creating record?