I received a referral from an employee of Google and then submitted by resume to Google for the role of software developer.
Initially, I was told there will be 2 rounds of phone interviews followed by on-site interviews if I get selected.
The interviewer was friendly.
Question : Basically, the question was that you are given a phone screen with height H and certain width W. You have to fit some text into the screen. Give the maximum size of letters that one can have such that the text fits into the screen.
My Approach : I gave a brute force approach where in we run a loop from smallest font possible to largest font possible and fit as many letters as possible in one line of the phone screen and give the best result.
When asked to further improve my approach, I suggested a binary search based solution where I took a mid value for font and see if the text fits or not. If it does then I iterate for a higher half and if it doesn’t then I iterate for the lower half.
At last I was asked the time complexity of each solution.
Since my first round of phone interview went well, I was directly selected for on-site interviews.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon and Microsoft Test Serieses.