Refactor rock–paper–scissors for config and ties

Quick Overview

This question evaluates a candidate's proficiency in object-oriented design, configuration injection, extensibility, state tracking (including ties), and testability when refactoring a Rock–Paper–Scissors tournament to support configurable rounds.

Refactor rock–paper–scissors for config and ties

Company: Apple

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Refactor an existing Rock–Paper–Scissors tournament with three robot players so that the number of rounds is configurable and the system also tracks ties. Describe the class/interface changes (e.g., Game, Match, Player, Strategy, Scoreboard, Config), how configuration is injected, how results are reported (per-player wins and total ties), and how you would make the design extensible for new strategies or gestures and testable.

Quick Answer: This question evaluates a candidate's proficiency in object-oriented design, configuration injection, extensibility, state tracking (including ties), and testability when refactoring a Rock–Paper–Scissors tournament to support configurable rounds.

|Home/Coding & Algorithms/Apple
Apple logo
Apple
Sep 6, 2025, 12:00 AM
mediumSoftware EngineerOnsiteCoding & Algorithms
8
0

Refactor an existing Rock–Paper–Scissors tournament with three robot players so that the number of rounds is configurable and the system also tracks ties. Describe the class/interface changes (e.g., Game, Match, Player, Strategy, Scoreboard, Config), how configuration is injected, how results are reported (per-player wins and total ties), and how you would make the design extensible for new strategies or gestures and testable.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...