Microsoft Microsoft OA interview experience sharing|HackerRank 75min two questions actual test

44 Views
No Comment

Share a set of the latest Microsoft Microsoft Oa, this is on the hackerrank platform, 2 questions in 75 minutes, the difficulty is generally around medium. Below is a complete review of the structure, test points and problem solving ideas of this set of questions, as a reference for students preparing for Microsoft OA.

Microsoft OA Question 1

The first question can be converted into counting the number of expandable times: scan the string from left to right, use double pointers to find segments with the same consecutive characters, and record the segment length. If the current segment length ≥ 2, then all distinct characters to the right of it can be progressively replaced with the current character, counting once for each replacement. The final answer is the sum of all position contributions that satisfy "the length of the previous paragraph ≥ 2" and "the characters of the following paragraph are different".

Microsoft OA Question 2

The second question simulates session management with expiration time: use a hash table to store the expiration time of each token, and use a minimum heap to maintain the expiration time of all current tokens. Before each operation, the expired tokens (expiration time ≤ current time) are removed from the heap and the hash table status is updated at the same time. Then generate, renew or count the number of valid tokens according to the operation type. Renewal needs to check whether the token exists and has not expired.

Finally I want to say

The difficulty of this Microsoft OA is average. Two questions can be solved in about 10 minutes. We have been assisting written examinations and interviews for major manufacturers for a long time. We have a systematic summary of common OA question types, time allocation and high-frequency test points. If you are also preparing for OA from Microsoft or other major North American manufacturers and want to improve your pass rate, you can Contact us , has helped hundreds of students get offers from major companies.

author avatar
Jory Wang Amazon Senior Software Development Engineer
Amazon senior engineer, focusing on the research and development of infrastructure core systems, with rich practical experience in system scalability, reliability and cost optimization. Currently focusing on FAANG SDE interview coaching, helping 30+ candidates successfully obtain L5/L6 Offers within one year.
END
 0