Skip to main content
All Questions

Build an iOS app that simulates a 2-over cricket match between two teams.

Unlock detailed company stats for this questionUpgrade

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

No answers contributed by the community yet.

Related courses

Course

Behavioral Interviews: A Practical Guide for Engineers

Get offers at the level you deserve. Prep for senior+ behavioral interviews at FAANG and Tier-1 companies. Made with staff and principal engineers from Meta, Netflix, Google, and more. Avoid downleveling, elevate past projects, and stop sounding like a robot.

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.