Build an iOS app that simulates a 2-over cricket match between two teams.
Build an iOS app with two screens.
Teams List: show cricket teams with name and flag from a JSON file (https://jsonkeeper.com/b/ZPFG, which 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 and wickets, and updates the scoreboard. The first innings ends after 12 balls or 3 wickets. The second innings ends when the chasing team surpasses the target, 12 balls are done or 3 wickets fall. The higher score wins.
Write clean modular code with separation of concerns (e.g. MVVM), readable naming, correct match logic and extensibility for new rules.
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


