Does your code need to execute (and pass all tests) in a (Google) interview?

Microsoft / Eng
lickinGood

Go to company page Microsoft Eng

lickinGood
Apr 29 6 Comments

Since Google technical interviews are just writing code in a Google doc, I suppose that nobody tries executing the code, and therefore it's only really about the main idea/algorithm, right?

I'm asking this because while LeetCoding, I pretty much always get the algorithm right, just somehow end up making some mistakes in the code, and so only some tests pass.
So is this something that I can safely ignore, as long as I get the algorithm and time-space complexity right?

I'm asking primarily for Google interviews, but if there are other big tech companies where they don't try executing your code, that'd be good to know.

Thanks!

YoE: 3
TC: 160k

#google #interview

comments

Want to comment? LOG IN or SIGN UP
TOP 6 Comments
  • Qualcomm
    nomorelc🙏

    Go to company page Qualcomm

    nomorelc🙏
    🥜 is such a cop out.
    Apr 29 1
  • Google / Eng
    Otto 🦦

    Go to company page Google Eng

    Otto 🦦
    We dont need it to compile, so syntax errors are fine. But it seems like your code compiles since you said it just doesn’t pass “all” test cases.

    We care about sound algos. If you’re missing test cases, you’re missing edge cases. I’d practice more
    Apr 29 2
    • Microsoft / Eng
      lickinGood

      Go to company page Microsoft Eng

      lickinGood
      OP
      Yeah, it's not syntax errors, usually just some subtle issue with the implementation... but I just feel like the interviewer would let that fly if the algorithm that I am describing to him does make sense... 'cause in real-world scenario I'd just debug the code by running it and would quickly find the issue ¯\_(ツ)_/¯
      Apr 29
    • Google / Eng
      Otto 🦦

      Go to company page Google Eng

      Otto 🦦
      1) subtle issues are very important. They are usually the entire point behind a coding interview. It’s to see if you understand the edge cases

      2) why’d you even ask this question? I literally do interviews for google, and I told you the way we view it. But you’re disagreeing with me? lol
      Apr 29
  • New
    d.watcher

    New

    d.watcher
    You’re tested for Communication, Coding, Problem solving and verification.
    You should be able to run through your code with diff edge cases to verify your algorithm - Very crucial
    Apr 29 0