My first instinct was to just do itertools-style combination generation and filter by hand type.
Start by clarifying the hand category and whether order matters, then outline a combinatorial generation strategy using nested loops or recursion with pruning. Discuss complexity in terms of the number of combinations and how to avoid duplicates by enforcing ordering constraints. Finally, cover edge cases and propose a testing plan including unit tests for known counts and validation of hand properties.
Pro tip: Mention that you can precompute all possible hands of a given category once and cache them, since the deck is fixed; this shows awareness of performance in a real system. Also, explicitly state that you will validate each generated hand against the category definition to catch logic errors.
Ask whether the hand category is fixed (e.g., flush, straight) and if the output should be all combinations or just count. Confirm if order of cards within a hand matters (usually not) and if suits/ranks have any special ordering.
Choose an approach: nested loops for fixed-size hands (e.g., 5 cards) with pruning based on category rules, or recursive backtracking. Enforce a canonical order (e.g., increasing card indices) to avoid duplicates.
Discuss time complexity in terms of the number of valid hands and the pruning efficiency. Explain that deduplication is handled by generating each combination in a unique order (e.g., lexicographic) and never revisiting earlier choices.
Consider edge cases: ace-low straights (A-2-3-4-5), ace-high straights (10-J-Q-K-A), flushes with 5+ cards (if category allows), and hands with multiple suits. Also, ensure the algorithm works for any hand size if the category is parameterized.
Propose tests: verify total count for a known category (e.g., 4,047,644 for 5-card poker hands? Actually 2,598,960 total; for flush: 5,108). Test that each generated hand satisfies the category definition. Test edge cases like ace-low straight and ensure no duplicates.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.