- Published on
Microsoft | L62 | Hyderabad | Jul 2024 [Offer]
- Author
- Shared Anonymously
YOE 6+
Exp: Worked with a US based startup (acquired by an MNC later)
Currently Laid off from last org.
Started focused preparation in May 2024
After many referrals, recruiter finally contacted me for a L62 position. This followed elaborate rounds of interviews over a span of two weeks.
Round-1: Duration: 60mins | DSA + LLD
Started with brief introduction followed by a small discussion on previous work.
This was followed by a DSA question on Graph. It was a levelled-up Course Schedule-2 problem - https://leetcode.com/problems/course-schedule-ii/
Approach I followed was Topological Sort using DFS.
This was followed by a discussion on how would I approach a problem similar to https://leetcode.com/problems/meeting-rooms-ii/ - Only the approach was asked, which was followed by a LLD on what kind of class structure and DB structure would I use. This was more conversational in nature with the interviewer.
Self-assessment: Strong Yes
Round-2: Duration: 1hr 15min | DSA + LLD
DSA question:
https://leetcode.com/problems/insert-delete-getrandom-o1/description/
LLD question:
Design a terminal based prompt for creation/updation of files and directories. Basically design to support mkdir, cd and touch commands.
My approach:
File class representing File/Folder
Driver class to drive commands
Challenge was to handle folder names with absolute, relative and paths starting with ~.
I took the Chain of Responsibility approach for this.
Self-assessment: Strong Yes
Round-3: Duration: 1hr 15mins | LLD + HLD
Build a windows search functionality with following requirements
Requirements:
- search based on a string pattern
- result of pattern matching against all file. Folder names and file contents(if they are text based)
- Ordering should be based on any heuritstic logic.
For LLD, the focus was on class design and search logic. Following was the gist of things I mentioned
class Driver:
- search("searchTerm"):
return Index.searchIndex("searchTerm")
- handleAFile():
FileSystem.handle()
class FileSystem:
- handling the creation/ updation and deletion of File
- createAFile(docName, text):
- Index.updateOrBuildindex(document)
- updateAFile
- deleteAFile
class File:
- path
- content
class Index:
- invertedIndex:
{
"search_term" : [File, Position(-1 in case of folder name), frequency]
}
- searchIndex("term"):
return map[term]
- updateOrBuildindex():
This was followed by HLD discussion of the same requirement. I discussed the following
Discussed about:
Building an Inverted index
Updating the index via a daemon process asynchronously in the background based on creation/updation/deletion of folders/files.
Search the above built index.
Self-assessment: Average/Below-average ( I was not able to justify my approach in HLD properly, and interviewer seemed not satisfied)
Round-4: Duration: 1hr 30mins | LLD + HLD
Discussion about LRU cache and LFU cache - Code was not expected, but the approach was expected, so the discussion surrounded around data structures I use. I previously solved LRU, so was comfortable with that, but never solved LFU previously, so took many iterations to reach an acceptable solution.
This was followed by a short discussion on LLD of the same. Interviewer wax expecting me to come up with an Abstract class by taking out the common elements of both.
HLD question:
Usecase similar to Unicommerce.
Design a notification system so that a seller in Amazon gets notified whenever the price of the same product is changed by the competitors in Flipkart. Assume there is no API provided by Flipkart.
My Approach:
Discussed about Scraping as an approach to capture prices of products (/small discussion about robots.txt etc)
Simple SQL DB design to store prices of products for each competitors. And when latest scraped data doesnt match with existing, create a notification and send it to notification engine
The discssion was more about what's the best DB design for the same, I was inclined towards storing the price against each seller, but interviewer was inclined more towards not storing any seller information as it is dicated by a third party, rather simply store prices of all sellers in a simple List format. It was a healthy discussion and in the end we came to an agreement.
Self-assessment: Strong Hire
Round-5: Duration: 30mins | HM round with simple HLD
First 15 minutes I was given chance to ask any questions I have, after he answered all of them, the HLD question was how to design a distributed logging system. The answer he was looking for was that logs need to be handled asychronously.
Self-assessment: Hire
Note on my observations:
All the interviewers were very friendly and are more focused on the approach and thought process than the actual solution.
My preparation strategy:
For DSA:
I code in Python, I have followed two main resources:
- Neetcode 150 list - only for the list of questions. Try to cover questions from all topics parallely, rather than going sequentially.
- Greg Hogg python solutions, Greg has a unique approach to most questions and I liked those.
I also purchased LC premium, for some questions Editorials really helped.
Strategy:
Revision is crucial before a DSA interview, the two pronged approach I followed was to document all my LC solutions in a github repo, which stands as my wiki. Then I maintained a shorter notes where I made notes for approaches that I tend to forget or are complex or are something new that I have recently learnt.
For LLD:
Basics are very important, OOPS concepts, SOLID principles etc.
Good resource I followed for Design patterns in python - Design patterns from Python wife website
I always kept a printed version of the cheat sheet for design patterns handy.
For HLD:
It's crucial to get the basics right when it comes to HLD.
Resources:
- For basics on Databases - Deep Dive into the Internals of the Database course on educative.
- For System design questions - Grokking Modern System Design Interview for Engineers & Managers on educative.
- Jordan has no life YT channel - his playlist also covers comparision of design and DB choices
I have made a comprehensive notes from all three above resources. And since then my notes stood as my revision material. My suggestion is to dedicate a week or two for HLD, prepare your notes, dont touch the resources again as they are extensive and you cant revise easily. Revision is the key before any HLD interview.
It's easy to get distracted and deviated in this job market. Stay positive, focused and work on your weakness, as the interviewer doesnt leave any scope for mistake. All the best!
Leetcode community has helped me a lot and it's my time to give back. Hope this post helps.