Background: Worked in different companies for about 8 years as a mobile software engineer. I have been doing LeetCode regularly for about a year now, where I also participated in quite a few contests.
Position: Software Engineer, Mobile Applications
Location: Sydney
Date: January 2020
1st phone interview:
N-ary trees question about monarchies, I would describe it here but it's basically this: https://leetcode.com/discuss/interview-question/302164/google-phone-screen-monarchy
I gave a solution that worked and the feedback was positive, but since I didn't come up with the most performant solution they wanted me to have a second phone interview.
2nd phone interview:
Guess the word: https://leetcode.com/problems/guess-the-word/
I was actually first asked to implement the Master's API func guess(word: String) -> Int and then the method to solve it func findSecretWord(list: [String]) using that API. I again gave a solution that worked in both cases but I realised later that for the findSecretWord method it wasn't (again :/) the most efficient solution. Anyway, the feedback was positive and this time they seemed convinced to invite me onsite.
Onsite:
1st interview
Graphs problem: given a start and finish position in a maze which contains empty spaces and walls, find the minimum distance between start and finish. You can move up, down, right and left but once you pick a move you won't stop until you hit a wall (or a border). Looks like it's pretty much this problem: https://leetcode.com/problems/the-maze-ii/
Follow-up: what if we also include a single moving block that moves into the same direction and the same speed as we move?
2nd interview
Behavioural interview: pretty standard questions, no big surprises here. If you prepare for this interview properly this should normally be the easy one (my personal tip: prepare for it using the Amazon leadership principles i.e as if it was for an Amazon interview).
Lunch
Just casual chat with an employee while having lunch. Good opportunity to relax and ask as many questions as you want about the company.
3rd interview
N-ary tree problem (I am not sure I have seen this problem around here before): given an N-ary tree structure where some leaves are bushes and some are not:
- Define the node class
- Give the total number of bushes given a root node
- Knowing that a tree starts burning at it's deepest level if and only if there's only two bushes or more on that level and from there goes up each level, find out if, given a root node, this tree will completely burn and how much time would it take for it to completely burn (each level counts as 1 second).
- There was a last follow up question but the interviewer was only interested in the discussion and didn't ask me to code. I honestly forgot what was it, will update this if I remember.
4th interview
- Some questions regarding iOS development and
UICollectionViews
- Define the interface for a
Person class which will be used in the context of a booking application. How would you implement this class so that we can hash instances of it (i.e use it as a dictionary key or add it to a set)? Which are the advantages and disadvantages of your implementation?
- Suppose we have a database with venue ids and their coordinates. Implement a request method that given a location, returns the centred coordinate of the 10 closest venues to it.
5th interview
Where the number of - represents the depth of that level.
My takeaways
- Google is definitely a bit more inclined into trees and graphs questions at the moment. Specially N-ary trees, I got them on 3 out of 6 technical interviews. Don't overlook at trees problems in LeetCode (I am guilty for that too), even if they normally seem simple enough some of them can bite you pretty easily.
- Stay positive during your interview and maintain a good vibe with you interviewer regardless of your technical performance. This is really crucial and I would say as important as being able to show good technical skills (in my opinion).
For instance, at my last interview, I was really mentally exhausted and I wasn't able to properly implement the whole question (got a bit stuck in the decoding part). I always maintained a really positive vibe with my interviewer and that still kept me comfortable on that situation and I was still able to explain them how would I finish my implementation even if I ran out of time to properly implement it. They seemed completely happy with that.
- Where are all those DP questions? Seriously, I see thousands of DP questions and study guides on LeetCode (I myself have been preparing quite hard for them) but I barely got asked one of them, even when interviewing for other companies (and if so, a straightforward recursion + memoization solution would be more than enough to pass the interview, definitely no need to go crazy). I feel like LeetCode should focus more on BTs, BSTs, N-ary trees and Tries (definitely they appear much more than DP!) right now and let go of that little obsession with DP, especially in the weekly contests.
- Take advantage of LeetCode weekly contests, I can't stress this enough! They give you the perfect context for a really extreme situation where your brain has to do pattern matching really quickly and you have to be able to validate your assumptions about a problem also really fast.
I was only able to fully complete a contest twice, normally finishing 3 questions (sometimes even only 2). That's totally fine! Again this is a really extreme situation where you are highly time-constrained and you are training your brain on how to recognise patterns and match them quickly. A real interview it's always gonna be a way more relaxed situation and plus you are going to have an interviewer who actually wants to help you get there - if you have been already training for a much more stressful situation that means you will be more comfortable on the real scenario.
- (this is more like a cliche but it really is true) follow the process. Failing (many times!) is also part of it. Don't take anything too personal, just learn from it, make yourself stronger and go for the next one. We are lucky to be in an industry where we can keep trying until we get it.