Solve three scheduling and array problems | Microsoft Interview Question