PhonePe Software Enineer | Machine Coding round | 2025
Anonymous User
2409
Hackathon Platform
Description:
PhonePe is conducting its annual hackathon and wants to create an interactive platform to host the event. It will be a 2 day event and contestants need to maximize their score over this period by either solving more problems or more difficult problems. Design the backend to support this platform.
Mandatory Functionalities
- The system can assume a fixed set of problems. Capability to add problems to the Questions Library is optional
- Contestants should be able to register themselves with their name and their department name.
- A problem should have attributes like description, tag, difficulty level (easy, medium, hard), score.
- Contestants should be able to filter problems based on difficulty level or tags and sort them based on score (design should be extensible to other attributes )
- A contestant should be able to solve a problem as well as get the list of problems solved by him/her.
- A contestant should be able to see the number of users that have solved a given problem and average time taken to solve that problem.
- Scoring strategy for a problem could simply be to award the score assigned for the problem or could be something different like a combination of score and time.
- Display the leaderboard[Important] which can have 2 variants -
- A. Display the top ‘n’ contestants with maximum score and the problems that they have solved.
- B. Display the top ‘n’ departments which have the best scores ( Score of a department will be the sum of scores of all its employees )
Extension Problem
- On solving a problem, users should get a recommendation of top 5 problems based on relevance
- The recommendation strategy for problems could simply be similar tags or extensible to include other factors like number of users who have solved a particular problem or a combination of factors ( Design should be extensible).
- Users should be able to get curations like Top 10 most liked problems of a certain tag.
Capabilities
Below are various functions that should be supported with necessary parameters passed.
These are just suggestions, the signatures can be altered as long as the functionalities are provided.
- Registering a user - addUser()
- Fetch the list of problems - fetchProblems() - Should take as input filtering and sorting criterias and return all matching problems in the right order.
- The result should contain problem attributes like name, tag, difficulty level, score etc.
- Should also display number of users who have solved a problem and the average time taken for that problem
- Solve a problem - solve() - Marks a problem as solved
- [ For the extension problem, this function should return next 5 recommended problems ]
- Fetch solved problems for a user - fetchSolvedProblems() - Fetch the list of solved problems for a user
- Display leaderboard - displayLeaderboard() - Could take as input a flag for either user or department and return the respective leaderboard.
Guidelines
- You should store the data in-memory using a language-specific data-structure.
- Implement clear separation between your data layers and service layers.
- Simple and basic function are expected as entry point - no marks for providing fancy * restful API or framework implementation
- Because this is a machine coding round, heavy focus would be given on data modeling, code quality etc, candidate should not focus too much time on algo which compromises with implementation time
Expectations:
- Your code should cover all the mandatory functionalities explained above.
- Your code should be executable and clean.
- Your code should be properly refactored, and exceptions should be gracefully handled.
- Appropriate errors should be displayed on the console
How will you be evaluated?
- Code Should be working
- Code readability and testability
- Separation Of Concerns
- Abstraction
- Object-Oriented concepts.
- Language proficiency.
- Scalability
- Test Coverage (Bonus Points)
- [execution time limit] 5 seconds (ts)
- [memory limit] 1 GB
Other Experiences:
Flipkart: Flipkart | Machine Coding | SDE 3
Comments (3)


