Stage 1 of 3: Fix the move-validation bug
Background. A single-player card game on a 3×4 grid dealt from a 36-card deck (values 1–9, four suits). A move picks three positions whose card values sum to 15; the chosen cards are removed and the grid refills from the deck. The game ends when no legal move remains.
game.py defines Game and enforces the move rules.
The starter has a bug. Two tests in tests/test_part1_validation.py fail.
Find it and fix it. Don't change the public interface.
Done when Submit goes green.
Constraints
- Python 3.12+ standard library only
- Time limit: 15 seconds per test
- Editable:
game.py,player.py - Read-only: all
tests/test_*.pyfiles - Card values are integers; suits are decorative for distinguishing same-value cards
What comes after stage 1
The next stages open once the tests for the one before them pass. Each raises the bar, the way an interviewer does in the room.
- Stage 2: Implement the player. Pick legal triples and play the game out; any correct player passes.
- Stage 3: Optimize for the bigger board. A 10×10 board with no refill: the order you take triples decides how long you last.
The files you get
- Yours to edit: game.py, player.py.
- Read-only: cards.py, tests/__init__.py.
- Tests you can read and run: tests/test_part1_validation.py. Hidden tests run on Submit.
The round: an agent in the editor
The assistant here works like the one in the interview IDE. It reads your files, runs code and proposes changes, and you accept or reject each one. It doesn't volunteer ideas, so what gets built is what you asked for. Along the way the interviewer asks about your decisions, and at the end the report says what you checked and what you accepted unread.
Frequently asked, briefly answered
Is Card Game Strategy free?
It is a Pro problem. Free plan includes one complete problem, plus the first stage of several more, so you can see how a round works before you pay.
Which company asks something like this?
Meta. It is modelled on Meta's round: CoderPad with integrated AI assistant (GPT-4o mini, Claude Sonnet/Haiku, Gemini 2.5 Pro, Llama 4).
Do I bring my own AI tool?
No. The assistant is in the editor, same as in the interview IDEs at Meta, Stripe and Amazon. What you choose at Begin is the format: an agent that proposes changes you accept or reject, an answer-only assistant that can't write code, or no assistant at all.
What does the interviewer ask?
4 questions along the way about your own code, and one at the end about the whole session. A weak answer gets one follow up. The answers go into the report, which ends with a hire or no hire verdict.
Start the problem
Sign in and the problem opens where you left it. New here? An account takes a minute to create, and the Pro plan starts at the first stage of this problem.
More like it: every practice problem, how Meta runs its AI round, the AI coding interview guide.