Google code review interview

Aug 28, 2020 32 Comments

I have an upcoming interview with google for an EM position. I selected code review over coding, as I have not coded in a while. What to expect from this interview and how to prepare?

I expect the interviewer is going to present a broken code to review.

What I am not clear on are they looking for me to spot general coding errors? Variable initialization, typos, general testability, and structure of the code a.k.a readability/maintainability, logical errors, efficiency, data structures?

How do they choose the code fragments? google code base or leetcode?

Can anyone who has done Java code review share their thoughts?

comments

Want to comment? LOG IN or SIGN UP
TOP 32 Comments
  • Uber
    AFNW02

    Go to company page Uber

    AFNW02
    I recently did the Code Review interview for L6/L7 manager role and got an offer. The question itself was very straightforward probably from Leetcode Easy level. It was shared in a tool that looked like Google docs. Interviewer asked me to treat as if it were a real code review and leave comments as I walk through the code. They hinted me to look for variable naming, errors in the code and not to focus solely on the algorithm itself. Here's the format I followed:
    - clarified requirements about potential inputs, nulls expected, single threaded vs multi threaded etc
    - walked through the code and wrote comments as I attempted to understand the algo. Checked correctness of the algo
    - checked if boundary conditions were handled correctly
    - suggested better naming of variables
    - fixed some minor errors and suggested better data structures to store data (nothing fancy here, a Set instead of a List)
    - added Nullable and Nonnull annotations
    - looked for any method or variable declarations to fix but didn't find any issues
    - wrote down time and space complexity
    - finally suggested a algo with better time complexity. Didn't have to implement it though.
    - we had 5mins left and the interviewer asked me to about test cases. I shared a few edge cases that we should look for.

    Of course, not every CR interview may have issues in all of the above areas, but be prepared with a list of various types of issues you'll watch out for before going into the interview.

    My 2 cents is to pick Code review round even if you have been coding in your role. The chances of providing meaningful feedback on a piece of code is better than facing a random coding question where you can mostly come up with an optimal answer only if you've seen some flavor of that question before.
    Feb 3, 2021 11
  • Cisco
    mortgage$

    Go to company page Cisco

    mortgage$
    Pls search for post by uber, followed that, went well
    Jun 19, 2021 3
  • Amazon
    amzeee

    Go to company page Amazon

    amzeee
    OP can you please share your experience and tips ?
    Jun 19, 2021 0
  • New
    838388

    New

    838388
    For the Code Review round, did they use google doc? How did you post comments on the code?
    Aug 23, 2021 2
  • Amazon
    amzeee

    Go to company page Amazon

    amzeee
    @jdud7 can you also please share your experience from the CR interview ?
    Jun 10, 2021 0