Reported interview periodDec 2025–Aug 2026
Turn-Based Creature Battle
Implement a deterministic battle between two teams of creatures. Team A acts first. On each turn, the first living creature on the active team attacks the first living creature on the opposing team.
Practice focusRequirements - Damage reduces health; a creature with health <= 0 is knocked out and cannot act. - Alternate teams after every attack, skipping a side only if it has no living creature—at which point the battle ends. - Log every attack, knockout, and final winner in a deterministic format agreed before coding. - Do not mutate caller-owned teams unless the API explicitly documents it. - Validate empty teams, non-positive attack values, and battles that cannot make progress. Follow-ups 1. Order turns by speed rather than alternating teams. 2.…