Meta SWE ML Virtual Onsite Full-Loop | UPDATE
Anonymous User
564

Hi, I had my virtual onsite round for E4
My phone screen link:
https://leetcode.com/discuss/post/6587362/meta-swe-ml-phone-screen-by-anonymous_us-akas/

Coding Round 1:

  1. Return True/False if there exists a continuous sequence of numbers that sum upto target (LeetCode Subarray Sum Equals K variant)
    Gave a solution of sliding window and 2 pointers.
  • Follow up 1: Handle negative numbers - Coded another solution that uses cumulative sum and hashmap
  • Follow up 2: Return number of valid subarrays that sum to K (based on solutuon for followup 1) - Coded a third solution to return this.
  1. Return the shortest path from top left to bottom right (return the path itself, not the path length) (LeetCode Shortest Path in a Matrix variant)
    Gave BFS solution with HashMap parent that builds back the path in reverse, return path =[(coordinates of cell 1),(coordinates of cell 2), ...]
  • Follow up 1: Justify using BFS over DFS and what would happen if we chose DFS
  • Follow up 2: What if there is a co-ordinate (a,b) that must be included in the path?
    I initially misunderstood and coded out a solution that used flag to check if my shortest path passes through (a,b) and return it only in that case. But interviewer wanted any path that must pass through (a,b). I fumbled here and could not think of a solution, interviewer gave a hint to divide the problem into 2 parts.
    That helped me understand it better and I coded out another function that does BFS on given start and end. Ex. path1: (0,0) (a,b); path 2: (a,b) (m-1,n-1)
  • Follow up 3: What if there were k number of must have coordinates?
    I answered that we can split up path calculation as - start, must1; must1, must2; must2, end. Time was short so did not code.
  • Follow up 4: Does the list of must have coordinates need to be ordered?
    Answered yes. We were over time so meeting ended.

After this extremely scary and exhausting round, had my next round immediately after.

Coding round 2:

  1. Convert Binary Tree into Circular Doubly Linked List. (LeetCode Same Name)
    Gave a DFS solution to perform in order DFS and build the doubly linked list with two pointers, then doubly link first and last and return first
  • Follow up: Do not use global variables (the two pointers)
    Gave a solution that converts each subtree into its own doubly linked list -> left head, left tail; node; right head, right tail
  • Follow up 2: Can the above solution handle case of non-existence of left tail.
    Answer no, but fumbled answering a bit
  1. Candy Crush variant, except, instead of 3, remove all duplicates.
    ex. "abbba" -> ""
    ex. "ad" -> "ad"
    Gave stack solution that takes (char, freq). Every time we encounter a char!=stack[-1] -> check if freq>=2 and pop()
  • Follow up: How to optimize it for ex. "aabbccba" -> ""
    Had about 5 mins left in the interview, interviewer asked to discuss and not code. Tried playing out different approches but could not figure it out. Interviewer ended the interview.

Overall, I'm feeling pretty low after grinding Meta Tagged list and MinMer's Variant list :/

Have my behavioral and ML design round scheduled for tomorrow, wish me luck :')

Update:

Behavioral round

Interviewer was friendly and asked standard behavioral questions for conflict resolution, handling ambiguity, etc. This was a fairly easy round.

ML Design round

FB Groups - a new product, recommend groups to users on their feed in a horizontal viewport -- user can view group recommendations in a horizontal bar and if they swipe left they can view more recommendations.

I prepared by watching Exponent's youtube videos for mock ml design, Chip Huyen's Designing ML Systems, Grokking ML course for an overview on the structure and design.
I would recommend clarifying business objective and functional/non-functional requirements, then give an overview of what you would be discussing --> Data -> Features -> Metrics -> Models -> Trade-offs and online serving
Based on interviewer's input, I explained the different areas they wanted me to focus on. I used a two tower model for my design.
I think this round went well, but there's no way to know for sure.

Will update again based on what I hear back.

Comments (5)