NVIDIA interview question

Implement a state machine that detects modulo 5