Given a set of four digit numbers, and two numbers A and B which are in the set, indicate if A and B are chainable. Any numbers X and Y are chainable if the last two digits of X are the first two digits of Y, with any number of chainable numbers in between. For example, given the set {8363, 6388, 8183, 5364, 8353, 8365, 9380}, A=8183, B=6388, yes, A and B are chainable (as [8183, 8363, 6388]).
Note that the problem was described quite poorly by the interviewer. He initially used the term "list" rather than a "set". Only after much prodding for different examples did he clarify that he actually meant a "set" and not a "list". He asked me to describe the solution before coding it. Although I described a perfectly accurate but somewhat inefficient solution, he went on to add a requirement that he wanted a more efficient solution. Once we decided upon the efficient solution, I had only five minutes remaining to implement it.