Microsoft L-59 HackerRank OA question || OA

microsoft logo
microsoft
Offer
August 16, 20255 reads

Summary

Had a successful interview experience at Microsoft for the L-59 HackerRank OA position. The interview focused on a challenging string manipulation problem that required careful analysis of the operations allowed.

Full Experience

I recently had the opportunity to participate in the Microsoft L-59 HackerRank OA interview. The process was quite challenging but rewarding. The main problem I encountered was about performing a series of operations on a string to maximize the number of operations that could be applied. The problem required a deep understanding of string manipulation and the conditions under which the operations could be performed.

Interview Questions (1)

Q1
Maximum Operations on a String
Data Structures & AlgorithmsHard

We are given a string s (3 <= len(s) <= 2.10^5 ) of lowercase English letters. We can repeatedly perform the following operation:

Pick three consecutive characters s[i], s[i+1], s[i+2] (1-based index) such that:

- s[i] = s[i+1]
- s[i+1] ≠ s[i+2]
- Replace s[i+2] with s[i].

We need to find the maximum number of operations that can be applied.

Preparation Tips

For the interview, I focused on practicing string manipulation problems and understanding the conditions under which certain operations can be applied. I also reviewed similar problems to build a solid foundation in algorithmic thinking.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!