Pergunta de entrevista da empresa Qualcomm

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