Search a bit pattern in a potentially infinite bit stream
Filed under Arista Networks
The question
Given a small pattern of bits to search within a potentially infinite, continuous stream of bits that cannot be stored, describe an algorithm to find the pattern as bits arrive one by one. A follow-up asked how to achieve O(n) time if the pattern length is between 500 and 12000 bits by treating the pattern as an integer.
No write-up yet. Related questions below have one.
Related Arista Networks questions
Collected from public candidate posts and coding forums. Updated Nov 2026.