← Back
00:00

Poker Hand Validator

Scale AI interview questions · Medium · Coding round · 7 tests

Your input is a poker hand holding exactly 5 cards, all taken from an ordinary 52-card deck. Every card is written as "<RANK> of <SUIT>". The rank part may be any of 2-10, J, Q, K or A, while the suit part must be hearts, diamonds, clubs or spades.

Your function should answer true when the cards satisfy one or more of the poker combinations listed below, and false when none of them apply. A card that cannot be parsed, or a card that shows up twice, makes the hand invalid.

Winning patterns

Idle