Leetcode; how much time to invest in each problem?

Procore / Eng
Tayg55

Go to company page Procore Eng

Tayg55
May 24, 2020 6 Comments

Looking to apply at FAANG in the coming months once I get some LC practice in.

I can solve easy/medium. Although I keep time and space complexity in mind, my solution is rarely optimal based on the discussions I see in the forums. I usually just make sure it passes, then peek at the solutions/discussions.

How much time should I be investing in each problem? Should I be trying to understand the most optimal solution for each if I didn't get it? Finally, do interviewers expect optimal solutions right off the bat?

#leetcode #faang

comments

Want to comment? LOG IN or SIGN UP
TOP 6 Comments
  • Dematic
    michael25

    Go to company page Dematic

    michael25
    Let me give you an advice, most of the time it’s the same question showing up. So solve it as best as you can, see the solution. Understand it, solve it, solve it again. Solve as many times as you can until it’s engrained in your mind.

    I read this from a random guy on leetcode and he hit home

    Facebook interviews are ripped straight off of leetcode, and then they have the audacity to ask if you have seen the problem before. I’m curious if anyone out there is admitting to having seen the problem. The trick is to ask them to repeat the problem a few times as if you have no idea what they’re talking about, and then ask them to run through a quick example for you. Then just go ahead and type out the code that you already have memorized.
    May 24, 2020 0
  • Definitely always try to understand a solution with optimal time complexity.
    May 24, 2020 0
  • Google
    random829

    Go to company page Google

    random829
    Do not keep any fixed time (or keep a large deadline). Keep trying until you feel you are not making any progress. That is the correct time to stop working on a problem.
    May 24, 2020 0
  • Most interview questions are easy - medium, you should be able to do them in ~30 mins. Expect to give 10 mins as a cushion for explaining your thought process.

    Best solution at the beginning is not necessary. It's also not the end of the world to not get the most optimal time complexity by the end, but your interviewer will/should nudge you as needed and you should be observant of that. That said to be competitive you should have the most optimal time complexity solution (or at the very least verbalize it clearly if out of time), and you *absolutely* should understand the most optimal solution when practicing. Space complexity is nice to know. Don't stop the grind ✌️
    May 24, 2020 1
    • Amazon
      rGynh76c

      Go to company page Amazon

      rGynh76c
      Another thing is practice talking out loud and writing on a whiteboard with your process. It’s really hard to do that if you haven’t practiced it.
      May 24, 2020
  • Wayfair
    hdhvdu

    Go to company page Wayfair

    hdhvdu
    Don’t waste your time
    May 24, 2020 0