Pergunta de entrevista da empresa ActionIQ

Selecting records where same category 3 times in a row