MICROSOFT
F2F-1 Q1. A Water Jug Problem: You are given two jugs, a 4-gallon one and a 3-gallon one, a pump which has unlimited water which you can use to fill the jug, and the ground on which water may be poured. Neither jug has any measuring markings on it. How can you get exactly 2 gallons of water in the 4-gallon jug? Now make it M gallon and N gallon jugs and you have to get K gallon output. Given a triplet (M,N,K) come up with instructions (like the shell commands) to get K gallon water.
F2F-2 Q1. Given a M X N grid of 1's and 0's. Find the size and location of the maximum size square submatrix containing all 1's. Q2. Given a M X N grid containing numbers. Print the numbers in diagonal order. Ex- M = 2, N = 5 grid = [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]] output = 6, 1, 7, 2, 8, 3, 8, 4, 10, 5.. Q3. Given N nuts and N bolts in shuffled order but for every nut there is a bolt which matches it. How will you find all the nut bolt matches ? you can pick a nut and a bolt and test if it matches or not.
F2F-3 Q1. Given a number find the next greater number by shuffling the digits of the number. Ex 31457 becomes 31475. Q2. Celebrity Problem Q3. Your compute has a single timer which can record time intervals. How can you use this to get several custom timers for several processes running on the machine.
F2F- Q1. A File has some numbers with space in between them. Read the file and add 1 to all numbers. Q2. Data streams are arriving at a central server from 4 cities. How will you maintain a log file which should be sorted based on timestamp. Asked about Distributed sorting, threads, processes and synchronization (mutex locks and semaphores), Interprocess communication.