Google Interview Experience | Telephonic (SDE)
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.