Coding Round 1: Longest Common Prefix Pow(x, n)
Coding Round 2: Find Largest Value in Each Tree Row Given an array of numbers, check if there exists a triple (a, b, c) which satisfies a^2 + b^2 = c^2
System Design: Design Facebook newsfeed. I followed a common system design template. I discussed tradeoffs for MVC/MVP/MVVM architectures and Flows/LiveData/RxJava for data propagation. My design included use cases, offline support, and an in-memory cache for faster access.
Behavioral: Conflict Resolution Negative feedback from manager Change in architecture in the middle of a project
Follow-up Coding Round: Valid Palindrome II Given a 2D grid representing the height of land at each cell, a path exists if you can travel from position (0,0) to (m,n) (only allowed 4 directions). You can travel to a cell if the value at that cell is higher than the water level. Find the lowest water level at which a path is not possible. Example: [[S, 6, 1, 2], [5, 2, 1, 4], [3, 9, 4, E]]
water level: 1 - path exists [[S, 6, X, 2], [5, 2, X, 4], [3, 9, 4, E]]
water level: 2 - path exists [[S, 6, X, X], [5, X, X, 4], [3, 9, 4, E]]
water level: 3 - No path [[S, 6, X, X], [5, X, X, 4], [X, 9, 4, E]]
Output: 3
Result: Received an offer.