Panda Guru LogoPanda
Guru

Microsoft OA | SDE 2 | Redmond

Round 1

Questions:

  1. Given a string of letters, containing both uppercase and lowercase letters, return the number of different characters where all lowercase of that character appear before any uppercase letter.
    Example:
    Input: aaAbcCABBc
    Output: 2 (a and b are counted, c is not counted)

  2. Given 2 balls Red and White, return the minimum number of swaps required where we want to arrange all the red balls into a consistent segment (in one move, you can swap adjacent ones).
    Example:
    Input: WRRWRW
    Output: 2 (resulting arrangement: WRRRWW)

  3. Given a String S representing positive digits containing n numbers, and given k (number of moves), you can replace any number other than 5, return the maximum number possible within k moves.
    Example:
    Input: 165232, k=3
    Output: 565552

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.