Flipkart SDE 2 iOS Machine Coding Round Experience
Summary
I recently appeared for a Machine Coding Round at Flipkart for an iOS Developer SDE 2 role, where I had to build an iOS application simulating a 2-over cricket match with specific rules for team selection, match progression, and scoring.
Full Experience
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.
Problem Overview
The application had two main screens.
1. Teams List Screen
- 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:
- Team name
- Team flag
- 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.
2. Match Centre Screen
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:
- A random outcome is generated
- Runs / wickets are updated
- Scoreboard updates on the screen.
Possible Ball Outcomes
Each ball can result in one of the following:
- 0 (Dot ball)
- 1 run
- 2 runs
- 3 runs
- 4 runs
- 6 runs
- Out (Wicket)
Match Ending Rules
First Innings ends when:
- 12 balls are completed, or
- 3 wickets fall.
Second Innings ends when:
- The chasing team surpasses the target, or
- 12 balls are completed, or
- 3 wickets fall.
The team with the higher score at the end wins the match.
Extensions (Optional Enhancements)
Some additional features suggested were:
- Wide ball
- +1 run
- Extra ball
- No ball
- +1 run
- Extra ball
- Batter cannot be out
- Weighted probabilities
- Events like 6 runs or wickets should occur less frequently than singles or dot balls.
Evaluation Criteria
The interviewer emphasized:
- Clean and modular code
- Proper separation of concerns (good architecture such as MVVM)
- Readability and naming conventions
- Correct implementation of match logic
- Extensible design for adding new rules like wides or no-balls
UI design was not heavily evaluated, but the application should function correctly and follow the expected flow.


Interview Questions (1)
iOS Machine Coding: 2-Over Cricket Match Simulator
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.
Problem Overview
The application had two main screens.
1. Teams List Screen
- 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:
- Team name
- Team flag
- 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.
2. Match Centre Screen
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:
- A random outcome is generated
- Runs / wickets are updated
- Scoreboard updates on the screen.
Possible Ball Outcomes
Each ball can result in one of the following:
- 0 (Dot ball)
- 1 run
- 2 runs
- 3 runs
- 4 runs
- 6 runs
- Out (Wicket)
Match Ending Rules
First Innings ends when:
- 12 balls are completed, or
- 3 wickets fall.
Second Innings ends when:
- The chasing team surpasses the target, or
- 12 balls are completed, or
- 3 wickets fall.
The team with the higher score at the end wins the match.
Extensions (Optional Enhancements)
Some additional features suggested were:
- Wide ball
- +1 run
- Extra ball
- No ball
- +1 run
- Extra ball
- Batter cannot be out
- Weighted probabilities
- Events like 6 runs or wickets should occur less frequently than singles or dot balls.

