Pergunta de entrevista da empresa Microsoft

The interviewer discussed coding experiences and how I handled them, personal projects that I've worked on, and a C coding question: Implement the char *strstr(const char *haystack, const char *needle) function.

Resposta da entrevista

Sigiloso

19 de mar. de 2015

I looped through the haystack buffer until I found a match to the first character of the needle. At this point, I looped through until finding a mismatch, at which point I would continue. If there were no mismatch, I broke out and returned the index of the match.