InterviewDB Question

Pattern Finding: Identify Repeating Structural Patterns in Sequences and Predict Next Elements

Question Details

Problem Given a sequence of integers, determine if it has a repeating pattern of period p (for any p from 1 to n/2). If yes, return the shortest repeating unit and the next k predicted elements. If no pattern exists, return an empty list. Follow-ups How do you verify a candidate period p? What is the time complexity of checking all periods? What if the sequence is only approximately periodic (some elements differ by at most 1)? How do you define "close enough"? Can you use the KMP failure functi…

Full Details

🔒

Unlock all Instacart questions

Full insider details, leaked discussions, and candidate experiences.

or every company, $100/year →

About This Question

This is a reported interview question from a instacart interview during the phone round.

It covers the following topics: Coding, Onsite, Phone .