[USA] Meta Onsite Non-AI Coding
Summary
I interviewed for a SWE Product role at Meta in the USA, facing two coding problems: a binary tree column traversal and a complex problem involving friend request logic for centaurs. I couldn't fully solve the second problem but explained my approach.
Full Experience
I recently had an onsite coding interview at Meta for the SWE Product role in the USA. The interview session included two non-AI coding challenges. The first question was a standard binary tree column traversal problem, which I found quite straightforward. The second problem was more involved: designing friend request logic for mythical creatures called centaurs, based on several age-related rules. I struggled a bit with this one and wasn't able to code up a fully working solution covering all the rules within the given time. However, I made sure to clearly communicate my thought process and approach to the interviewer, detailing how I would tackle the problem. I later revisited the problem myself and realized it's manageable if framed correctly.
Interview Questions (2)
Given a binary tree (NOT BST), print the column traversal from leftmost column to rightmost column. If two nodes are in the "same column", the top most node in that column should appear before the bottom most node.
We are building facebook for mythical creatures called centaurs. Centaurs live much longer than humans and we want to understand the number of friend requests when we launch the app. Here's how centaur friendships work (you will be expected to gather some requirements though b/c the interviewer explained the problem in a confusing way):
- Centaurs younger than 100 can friend other Centaurs younger than 100
- Centaurs older than 100 can friend centaurs that are strictly older, but not younger than 100
- Centaurs older than 100 can friend Centaurs older than x/2 + 7
Given a list of ages, return the number of friend requests. Friend requests for centaurs are directional (eg: just because I friend request you doesn't mean you automatically reciprocate the same)