Recently I appeared for a Machine Coding Round at Flipkart for an iOS Developer role. The task was to build a small iOS application that simulates a 2-over cricket match between two teams. The focus of the round was mainly on clean architecture, readable code, correct logic, and modular design, rather than polished UI.
The application had two main screens.
Display a list of cricket teams along with their flags.
Team data was provided through a JSON file:
https://jsonkeeper.com/b/ZPFG
The JSON file could be downloaded and bundled locally in the app (no network call required).
Each list item shows:
The user must select two teams to proceed to the match screen.
Any open-source image library could be used for loading the flag images.
This screen simulates the actual cricket match.
Both teams bat one after the other.
Each innings consists of 2 overs (12 balls).
Maximum 3 wickets per team.
A "Next Ball" button triggers the next delivery.
When the button is pressed:
Each ball can result in one of the following:
First Innings ends when:
Second Innings ends when:
The team with the higher score at the end wins the match.
Some additional features suggested were:
Wide ball
No ball
Weighted probabilities
The interviewer emphasized:
UI design was not heavily evaluated, but the application should function correctly and follow the expected flow.

