Pergunta de entrevista da empresa COMSYS IT Partners

Give an algorithm to find the index of a pattern's first occurrence in a specified string. The pattern is also a string.