Preparing for an interview? Check out Cracking the Coding Interview
Published on

Microsoft | SWE | April 2024

Author
  • Shared Anonymously

Recruiter reached out on linkedIn and sent OA link on the same day, to be completed in max 2 days.
It was 30 mins test with 2 easy coding question and 15 MCQs.

Then 2 rounds were scheduled on same day .
First round -Implementation question related to Graph.Used BFS to solve.
Second round-Data structures question-Given input logs with ("country","state","region",count) write apis to store them and retreive couunt

Sample( "USA", "California", "Los Angeles", 100);
("USA", "California", "San Francisco", 50);
("India", "TN", "Kerala", 75);
if retrieve count for USA,California it should be 100+50

What will be optimal data structure that can be used here?

Got rejected in round 2 ,as could not come up with optimal solution
Can anyone help me with how this problem can be approached?

ReportMark as Helpful