Google Phone interview questions, how hard could it be?

Amazon / Eng
lifeisbear

Amazon Eng

PRE
Cisco
lifeisbearmore
Jul 24 26 Comments

I have a phone interview with Google. Yesterday I paid for Leetcode premium and tried the "Google Phone Interview" in the mock interview section.

Totally overwhelmed by one question in the test set. Couldn't solve the question at all. Came up with the correct idea but wasnt able to code. This is the question.
https://leetcode.com/problems/minimum-area-rectangle/description/

I've solved < 200 questions on LC, mostly feel confident solving the general LC medium questions. But this one is way more difficult for me than the other questions. How can I improve this kind of question? What kind of practice do I need to improve this area?

And if you know any other nice Google phone interview tips, please share. Cheers! 🍺🍺🍺

comments

Want to comment? LOG IN or SIGN UP
TOP 26 Comments
  • Uber UberSim
    Brute force is O(n^4) you’d have to check every possible rectangle, it’s inefficient and hard to code, but should at least be mentioned when the better solution does not come to mind

    Better solution is double for loop O(n^2) check outer loop is one corner, and inner loop is other corner, then have points also stored in hashset for fast lookup to see if other two corners exist O(n) space for the hashset

    The code for this solution is relatively simple and elegant maybe 5-10 lines, done, should take 20 minutes of discussion and coding leaving another 25 minutes for interviewer to ask their “real” question
    Jul 24 9
    • Amazon / Eng
      lifeisbear

      Amazon Eng

      PRE
      Cisco
      lifeisbearmore
      OP
      🤔🤔 hmm I am gonna cry if I got asked that question seriously
      Jul 24
    • Uber UberSim
      Funny that’s exactly what uber does we store, query and traverse billions of (x,y) coordinates at incredible speed and tps. I will make this my new interview question.
      Jul 24
    • Bose riplife
      But what is the answer lol ? Put it in a distributed key value database ?
      Jul 24
    • Uber UberSim
      That’s one way
      Jul 24
    • Uber UberSim
      At Uber scale finding the smallest rectangle in those billions and billions of rectangles becomes meaningless, especially if those rectangles are constantly changing size and location, because if I can find a rectangle that’s close enough to the smallest rectangle that is fine if it doesn’t require me to search through all O(n^2) combinations, I’d greatly prefer to estimate the smallest in O(lgn) time
      Jul 24
  • Chase / Eng 8==D~
    Try not to fixate too much on one question that you couldn’t figure out. You’ll never get to a point where you’ll never be stumped.

    Instead, enjoy a little encouragement in the fact that you are probably far more prepared than the average candidate.

    Good luck.
    Jul 24 1
    • Amazon / Eng
      lifeisbear

      Amazon Eng

      PRE
      Cisco
      lifeisbearmore
      OP
      Thanks for encouraging me. That really helps!
      Jul 24
  • Fidelis Cybersecurity / Eng
    pzhang15

    Fidelis Cybersecurity Eng

    PRE
    EchoStar
    pzhang15more
    Google like it hard
    Jul 24 2
    • Amazon / Eng
      lifeisbear

      Amazon Eng

      PRE
      Cisco
      lifeisbearmore
      OP
      Seems like it. Do you think the company specific questions on Leetcode are close to the real ones?
      Jul 24
    • Fidelis Cybersecurity / Eng
      pzhang15

      Fidelis Cybersecurity Eng

      PRE
      EchoStar
      pzhang15more
      Yes, you should sort them by frequency. Also Google sometimes won't ask the exact same questions, so you have to understand the underlying concept.
      Jul 24
  • Amazon / Eng
    lifeisbear

    Amazon Eng

    PRE
    Cisco
    lifeisbearmore
    OP
    Doing it soon! Nervous!
    Jul 26 2
    • Microsoft meanwhile
      Good luck! Be calm and joyful.
      Jul 26
    • Amazon / Eng
      lifeisbear

      Amazon Eng

      PRE
      Cisco
      lifeisbearmore
      OP
      Thanks! Ive done it. there was major audio disruption from the beginning so done the interview through typing into the doc. Really different experience, and I guess my performance was not good. Worst luck ever. :)
      Jul 26
  • Microsoft / Eng SwitchJobs
    For a person with some regular prep, this is definitely a good medium but not a hard one or may be lower hard.
    Jul 24 1
    • Amazon / Eng
      lifeisbear

      Amazon Eng

      PRE
      Cisco
      lifeisbearmore
      OP
      Retried and mastered it. Thanks! 😁
      Jul 25
  • Expedia Group / Eng hnAy18
    I had this question when i was applying for a grad position back in 2014. It really crushed my dreams at Google...
    Jul 24 2
    • Amazon / Eng
      lifeisbear

      Amazon Eng

      PRE
      Cisco
      lifeisbearmore
      OP
      😥
      Jul 24
    • AnchorFree / Eng 🍪 cookie
      lol it's not such a hard question.. ask any game developer how he does collision testing of the objects on screen :) .
      Sep 15
  • Bose riplife
    It’s not that hard to code in python , what language are you using ?
    Jul 24 2
    • Amazon / Eng
      lifeisbear

      Amazon Eng

      PRE
      Cisco
      lifeisbearmore
      OP
      C++. I couldnt turn it into a code. Probably should try again in the night.
      Jul 24
    • AnchorFree / Eng 🍪 cookie
      ouch, with C++ anything is hard
      Sep 15

Salary
Comparison

    Real time salary information from verified employees