I was contacted by Microsoft based on my applications submitted through their career portal.
Question 1:
You are given a String S and a two-dimensional array of characters of size NXN named grid. Each field in the grid is either empty (denoted by a dot ".") or contains an uppercase English letter. Each particular letter may appear at most twice in the grid. Your task is to reconstruct the string S by visiting fields of the grid. You start the reconstruction with an empty string. You can choose the field in which you want to start. In one move you can change the current field to an adjacent one (up, down, left or right). If you visit a field containing a letter, you may append this letter to the end of the reconstructed string. Appending a letter is not counted as a move. Each field can be visited and each letter can be used multiple times during the reconstruction process. What is the minimum number of moves needed to reconstruct string S?
Write a function
class Solution { public int solution(String S, String[] grid); }
that, given a string S and an array grid, returns the minimum number of moves needed to reconstruct S. If it is not possible to reconstruct S, return -1.
Question 2: I don't remember the question exactly, but it was a direct derivation from the Longest Arithmetic Subsequence question.
I passed the assessment; the criteria is 50% score, essentially passing at least one question out of two accurately.
I had around 10 days to prepare and received an email outlining three proposed rounds: Round 1 at 9:15 AM, Round 2 at 12:15 PM, and Round 3 (based on feedback).
My round started with a formal introduction. I had two questions in this round:
Question 1: It was a Stock buy and sell question, starting with one buy one sell, and then, upon discussion, it progressed to two buys two sells. I wrote working and clean code, with good comments and indentations.
Question 2: I was given an N-queens problem; given N as input, the code needs to output a matrix (representing an N-sized chessboard) with all indices filled with a 'q' where a queen can be placed. We had a thorough discussion; the interviewer was happy with my approach, and I coded it accordingly. The program initially produced wrong output for some cases, and the interviewer observed how I approached such situations. I wrote a few log statements, did some basic tests, and found a small bug, and then it worked fine. He was happy with my approach.
At the end of the round, I asked a few questions about the organization, role, proposed project plans, and similar relevant questions.
This round wasn't strictly dedicated to System Design or DSA. I had two interviewers (one observing). Question 1: Design a Stock Market Application. I listed several agents (Buyer, Seller, Broker, Manager) and services (Buy, Sell, Place orders, execute orders, market price manager, loggers, anti-cheat service, etc.). The interviewer then focused on the order execution service, exploring concurrent order placement and execution, fulfilling buy and sell orders, and maintaining the market price. I proposed a heap-based approach with a multi-threaded structure, discussing locks, synchronization, Message Brokers, and distributed system fundamentals.
Question 2:
We had a discussion on the statement while(1), covering compilation, parsers, CPU execution, multi-threaded, multi-processing, and single-processing CPUs, kernel and user processes, and synchronization.
I was interviewed by a Senior Manager. We discussed my current project and then moved on to a question:
Question 1: Build a Sudoku game with a Reload button that generates a new Sudoku puzzle. I presented an approach, and we had a detailed discussion. We also discussed data storage and user experience.
Round 4 (AA Round) I had a conversation with a senior-level interviewer. We discussed my current project, my role, how I handled technical challenges, and behavioral questions about conflict resolution and career achievements.
My recruiter shared positive feedback from all four rounds and sent an email requesting document submission. I received a verbal offer from the recruiter after 16 days.