Quant interview prep guides

Pattern Waiting Time Interview Questions

Pattern waiting time interview prep for coin and sequence prompts, including states, overlap, expected time, and recursion mistakes.

Candidates practicing state recursion and overlapping pattern questions.

Patterns need states

Waiting for a pattern usually requires states that track partial progress. The state says how much of the target pattern has already been matched by the current suffix.

Overlap changes waiting time

Patterns with the same length can have different expected waiting times because overlap differs. HH, HT, HTH, and HHT do not all reset the same way after a mismatch.

Concrete example

When waiting for HH, seeing H puts you one step away, but seeing T resets. When waiting for HT, seeing H puts you one step away, and another H keeps you in the H state. The state transitions differ.

Write equations carefully

Let each state have an expected remaining time. Add one for the next flip, then average the next states. The finished state has expected remaining time zero.

Practice variants

Start with two-letter patterns, then move to three-letter patterns with overlap. Redraw the state diagram for each variant rather than reusing an old answer.

Common mistakes

Candidates often treat pattern waiting as geometric first success. That only works when each trial is an independent full attempt with no partial-progress complication.

Practice the pattern

Use the LeetQuidity curriculum and calibration to turn this topic into a focused practice plan.