PhonePe Machine Coding Round | 2 YOE
Company: PhonePe
\nRole: software engineer 1
\nInterview Stage: Phone Screen
\nLocation: unknown
\nYear: unknown
Original Post Content:
\nYOE: 2
\nPrevious Experience: 2 Product Based companies
\nProfile: SDE 1
I recently got a chance to interview with PhonePe and this was the problem statement I was asked as the first round of my interview. However, the interview did not go very well for me, I'm happy to share this with you guys :)
\nOverview:
\nA document manager is an application that can be used to create, share and manage text documents. It provides an interface to easily save and retrieve documents.
Design a document management application which can be used to create, update, view, and delete documents. It should maintain all the versions of the updates and also have the functionality to revert the document to a previous version.
\nFor the scope of this problem you can assume a document to be a page with only text data.
\nHistory of changes to a document to be maintained.
\nA document can be reverted to a previous version.
\nOnly the user who created the document can edit, revert or delete the document. Anyone can view the document.
\nMandatory Functionality:
User Management:
\n* Registration and login
\nDocument:
\n* Create new document
\n* Update the document
\n* Delete a document
\n* Get latest active version of a document
\n* Revert to a previous version
\n* Access management:
\n* Only the author can make changes to the document
\n* Anyone can view
\nFunctions to help you think:
\nYou can use this section to help you think, but not limited to implementing just these
createUser(): This can be used to create a new user in the system.
\nloginUser(): This can be used to login a user, using some id and password.
\ngetDocument(): Gets a document to view
\ncreateDocument(): Add a fresh document.
\nupdateDocument(): Update an existing document, creating a new version.
\nrevertToVersion(): Revert a document to a previous version.
Additional Functionalities to implement if you have time:
\nSharing edit access between multiple users
\nPrivate access - only the people with access to the document can view it.
\nState Management - Document can be in DRAFT, PUBLISHED states.