Microsoft | OA | March 2022
Anonymous User
3640

Hello Leetcoders,

After completing my job hunt phase.. I would like to contribute back.
I have started writing my interview details... Hope it helps.

Online Assessment : 90mins, 3 questions
Question 1 : Write a function solution that, given a string S consisting of N letters 'a'
and/or "b' returns true when all occurrences of letter 'a' are before all
occurrences of letter "b' and returns false otherwise,
Examples:

  1. Given S = "aabbb", the function should return true.
  2. Given S = "ba", the function should return false
  3. Given S = "aaa", the function should return true. Note that "b' does not
    need to occur in S.
  4. Given S = "b", the function should return true. Note that 'a' does not
    need to occur in S.
  5. Given S = "abba", the function should return false.
    Write an efficient algorithm for the following assumptions:
    N is an integer within the range [1..300,000];
    • string S consists only of the characters 'a' and/or "b'.

Question 2 : Write a function
class Solution ( public int|] solution(int N); }
that, given an integer N (1 ≤ N ≤ 100), returns an array containing N
unique integers that sum up to 0. The function can return any such array.
For example, given N = 4, the function could return [1, 0, -3, 2] or [-2, 1, -4,
5]. The answer [1, -1, 1, 3] would be incorrect (because value 1 occurs
twice). For N = 3 one of the possible answers is [-1, 0, 1] (but there are
many more correct answers).

Question 3 : Apologies... dont remember!!

The test was easy, I could solve it in 25mins.
Only unique thing here was that you do not have test cases to pass. You write the code... have few basic test cases, you can add custom and submit.

Once submitted you cannot change it.

Result : Got call for interview.

Comments (6)