Build an iOS app that simulates a 2-over cricket match between two teams.
Two screens. Teams List: show cricket teams with name and flag from a JSON file (https://jsonkeeper.com/b/ZPFG, may be bundled locally, no network call needed); the user must select two teams to proceed; any open-source image library may load the flags. Match Centre: both teams bat one after the other; each innings is 2 overs (12 balls) with a maximum of 3 wickets; a 'Next Ball' button generates a random outcome (0, 1, 2, 3, 4, 6 or out), updates runs/wickets and the scoreboard. First innings ends after 12 balls or 3 wickets; second innings ends when the chasing team surpasses the target, 12 balls are done or 3 wickets fall. Higher score wins.
Optional extensions: wide ball (+1 run, extra ball), no ball (+1 run, extra ball, batter cannot be out), and weighted probabilities so sixes and wickets are rarer than singles and dot balls.
Evaluated on clean modular code, separation of concerns (e.g. MVVM), readability and naming, correct match logic and extensibility for new rules; UI design was not heavily evaluated.
Expect follow-ups like
- Add wide ball and no ball support (+1 run, extra ball, no dismissal on a no ball).
- Add weighted probabilities so big outcomes are rarer.
Format · Flipkart SDE-2 iOS machine coding round.
Community answers
Related courses


