During the Job Interview Challenge Series we are running here at Dev102.com, we usually get some comments from readers who think that the quality of a specific question is not good. Here are some of those comments:
On the other hand, many readers provided answers to the questions and enjoyed participating in those challenges. Some thought that the questions are very good:
That’s it, the 9th post of the series of programming job interview challenge is out and alive. 19 readers provided answers to job interview challenge #8, Pieter G was the first to provide a correct answer:
The fastest way I can come up with is to generate a finite state machine at initialization. The transitions between states would be defined by the records you look for in the pattern and one transition for an unmatched record. When the machine enters the goal state is should send the notification (how to most quickly do that I leave to someone else). When reaching the goal state the machine should not terminate but continue (else we may miss a occurrence).
You can see more details about the solution in those blog entries: