I actually ran the interview on some coworkers for fun (they volunteered) and it was interesting to see the more senior (& IMO brighter) folks quickly recognize code reuse.
!@! SPOILER BELOW !@!
!@! SPOILER BELOW !@!
high card -> sort cards by value return cards[4]
Count cards (map[value]->int) --> Pair, pairs, triples, four of a kind
For each card is first token match? --> flush
sort cards , card[0] == card[4] + 4? --> straight
straight flush --> straight && flush
royal flush --> highcard == A && straight && flush
!@! SPOILER BELOW !@!
!@! SPOILER BELOW !@!
high card -> sort cards by value return cards[4]
Count cards (map[value]->int) --> Pair, pairs, triples, four of a kind
For each card is first token match? --> flush
sort cards , card[0] == card[4] + 4? --> straight
straight flush --> straight && flush
royal flush --> highcard == A && straight && flush