Pregunta de entrevista de Qualcomm

Write strstr() code. Solutions to avoid race condition?