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?
Want to see the real deal?
More inside scoop? View in App
More inside scoop? View in App
blind
SUPPORT
FOLLOW US
DOWNLOAD THE APP:
FOLLOWING
Industries
Job Groups
- Software Engineering
- Product Management
- Information Technology
- Data Science & Analytics
- Management Consulting
- Hardware Engineering
- Design
- Sales
- Security
- Investment Banking & Sell Side
- Marketing
- Private Equity & Buy Side
- Corporate Finance
- Supply Chain
- Business Development
- Human Resources
- Operations
- Legal
- Admin
- Customer Service
- Communications
Return to Office
Work From Home
COVID-19
Layoffs
Investments & Money
Work Visa
Housing
Referrals
Job Openings
Startups
Office Life
Mental Health
HR Issues
Blockchain & Crypto
Fitness & Nutrition
Travel
Health Care & Insurance
Tax
Hobbies & Entertainment
Working Parents
Food & Dining
IPO
Side Jobs
Show more
SUPPORT
FOLLOW US
DOWNLOAD THE APP:
comments
- 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.