Microsoft Interview Question

pattern detector - detect a pattern in an incoming stream