PhonePe | Machine coding Round | LLD
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2025-04-17Added By Anonymous
Source: Link
🧭 Experience: Gave machine coding round.
🏢 Company: PhonePe
I recently gave the machine coding round of PhonePe. It was hosted on CodeSignal and I had to code the solution from scratch. Would love to learn from experienced design engineers as to how they would go about coding this problem.
App-Version Management LLD: Every smartphone user these days has lots of apps installed. These apps go through multiple iterations, ranging from fresh installs to updates of an existing app.
Install happens when the app isn't previously installed. Update is triggered when the app exists but a new feature/version is rolled out.
You need to design an app version management system for a mobile app like PhonePe.
We assume there’s no Play Store / App Store — the app owner can directly interact with target devices (Android/iOS).
Consumers can install apps directly via an online installer from the website.
Real-world examples:
Install: A user buys a new phone and installs PhonePe. The latest supported version is installed via the website.
Update: The user already has the app installed. A new feature like dark mode is released. PhonePe updates the app directly on the user’s device.
System Components:
App and App Versions: * App will have a list of versions * Each version includes metadata (e.g., min OS version)
Rollout: * Admin can roll out a version via the backend * Install: fresh install on device * Update: diff is calculated between installed and latest version
Rollout Strategies: * Beta rollout: only specific devices * Percentage rollout: rollout to a % of devices
Requirements: Implement the following core functionalities:
uploadNewVersion(…): Store a new version and its byte stream
createUpdatePatch(app, fromVersion, toVersion): Create a diff between source and target versions
releaseVersion(…): Release a version using a given rollout strategy
isAppVersionSupported(…): Check if a version supports a target device (using device OS, rollout strategy, etc.)
checkForInstall(…): Check if a device supports the app
checkForUpdates(…): Check if an update is available for the device
executeTask(…): Create and run an install/update task
Available Capabilities: You may assume the following helper methods exist: * installApp: Installs app on device * updateApp: Applies diff to existing version * createDiffPack: Creates diff between two app files * uploadFile(fileContent): Uploads and returns file URL * getFile(fileUrl): Retrieves file content to flash via install/update
Code Expectations: * In-memory implementation only * Use any programming language * Simple function-based entry points — no need for REST APIs * Focus on logic, not boilerplate
Evaluation Criteria: * Working code * Readability * OOP/OOD principles (Separation of concerns) * Testable design (TDD-like) * Language proficiency
I recently gave the machine coding round of PhonePe. It was hosted on CodeSignal and I had to code the solution from scratch. Would love to learn from experienced design engineers as to how they would go about coding this problem.
App-Version Management LLD: Every smartphone user these days has lots of apps installed. These apps go through multiple iterations, ranging from fresh installs to updates of an existing app.
Install happens when the app isn't previously installed. Update is triggered when the app exists but a new feature/version is rolled out.
You need to design an app version management system for a mobile app like PhonePe.
We assume there’s no Play Store / App Store — the app owner can directly interact with target devices (Android/iOS).
Consumers can install apps directly via an online installer from the website.
Real-world examples:
Install: A user buys a new phone and installs PhonePe. The latest supported version is installed via the website.
Update: The user already has the app installed. A new feature like dark mode is released. PhonePe updates the app directly on the user’s device.
System Components:
App and App Versions: * App will have a list of versions * Each version includes metadata (e.g., min OS version)
Rollout: * Admin can roll out a version via the backend * Install: fresh install on device * Update: diff is calculated between installed and latest version
Rollout Strategies: * Beta rollout: only specific devices * Percentage rollout: rollout to a % of devices
Requirements: Implement the following core functionalities:
uploadNewVersion(…): Store a new version and its byte stream
createUpdatePatch(app, fromVersion, toVersion): Create a diff between source and target versions
releaseVersion(…): Release a version using a given rollout strategy
isAppVersionSupported(…): Check if a version supports a target device (using device OS, rollout strategy, etc.)
checkForInstall(…): Check if a device supports the app
checkForUpdates(…): Check if an update is available for the device
executeTask(…): Create and run an install/update task
Available Capabilities: You may assume the following helper methods exist: * installApp: Installs app on device * updateApp: Applies diff to existing version * createDiffPack: Creates diff between two app files * uploadFile(fileContent): Uploads and returns file URL * getFile(fileUrl): Retrieves file content to flash via install/update
Code Expectations: * In-memory implementation only * Use any programming language * Simple function-based entry points — no need for REST APIs * Focus on logic, not boilerplate
Evaluation Criteria: * Working code * Readability * OOP/OOD principles (Separation of concerns) * Testable design (TDD-like) * Language proficiency