Hello everyone,
Recently finished up the Microsoft 4 round onsite interview. This was for the entry-level position (USA). I don't know what level it is, but I will say I had a great experience. Here were the questions I got (1 coding question per interview, then a bunch of behavioral questions).
public class Solution {
public static class queue {
Stack<Integer> stack1;
Stack<Integer> stack2;
public queue() {
stack1 = new Stack<Integer>();
stack2 = new Stack<Integer>();
}
public void enQueue(int num) {
stack1.push(num);
}
public int deQueue() {
if (stack2.isEmpty() && stack1.isEmpty()) return -1;
if (stack2.isEmpty()) {
while (!stack1.isEmpty()) {
stack2.push(stack1.pop());
}
return stack2.pop();
}
return stack2.pop();
}
}Overall, super chill and fair final round.