This question evaluates object-oriented design and algorithmic problem-solving within Software Engineering Fundamentals, focusing on creating modular, extensible class hierarchies and comparator logic at the design/implementation level.
Design and implement an object-oriented solution for a simplified 2-player poker-like game called Camel Cards.
9, 8, 7, 6, 5, 4, 3, 2, 1
(where
9 is highest
,
1 is lowest
).
9999
)
2332
)
9998
)
5233
)
2345
)
Note: This ordering is intentional (e.g., any two-pair beats any three-of-a-kind).
Implement:
evaluate(hand1, hand2) -> "HAND_1" | "HAND_2" | "TIE"
Where each hand can be represented as a 4-character string like "2332" or an array/list of 4 card labels.
In the future, many more hand types will be introduced. Design your solution to make it easy to add new hand types without rewriting the evaluator logic.