Requirements
- Given a list of characters / values representing playing cards, reason over their ranks (and suits where relevant).
- Two variants recur:
- Straight flush detection: determine whether (or which) cards form a straight flush — five consecutive ranks in the same suit.
- Missing-card completion: given a near-complete hand, find the missing card that completes a straight. Wildcard rule: a
0may represent either an Ace or a 1, so both ends of the run must be considered.
- In at least one round the interviewer supplied the algorithm up front and asked only for a clean implementation.
- The same straight-flush prompt also appears for Ads algorithm-engineer candidates, in a 60-minute round led by an Ads technical VP. There the interviewer again outlined the approach, and the task was mainly to implement it.
Notes
- The wildcard ambiguity (
0= Ace or 1) is the main correctness trap — clarify how Aces wrap before coding. - These rounds run roughly 10-20 minutes after a long project deep dive, so a clean, bug-free pass matters more than heavy optimization.
Preparation
- Drill run / sequence detection over sorted rank arrays, grouping by suit with a hashmap.
- Write a helper that enumerates both Ace-high and Ace-low (or
0= Ace / 1) interpretations and re-checks the straight.

