← Meta Interview Insights

Meta·Software Engineer·Onsite - Coding / Algorithms·Intermediate

Intermediate
Apr 2026

Summary

Meta SWE onsite coding round. Apparently after mid-April they switched both coding rounds to AI-assisted format, which is a pretty significant change if you're prepping the traditional way.

Questions Asked (1)

Q1

LeetCode problem 339 (referred to by its numeric identifier).

Algorithms & Data Structures
Author's notes

No details shared about how it went, just that it came up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify that this is the Nested List Weight Sum problem, then propose a recursive DFS that passes the current depth down the call stack. At each element, if it's an integer, add value * depth to the running sum; if it's a list, recurse with depth + 1. Alternatively, use BFS with a queue to process level by level, multiplying by the level number.

Pro tip: Meta interviewers often care about clean, bug-free code and edge-case handling. Before coding, explicitly state that you'll treat the input as a tree where depth equals the level, and mention that you'll test with empty lists, nested empty lists, and negative numbers to show thoroughness.

1. Clarify the problem and constraints

Confirm that the input is a nested list of integers and that the weight is the depth (1-indexed). Ask about constraints like maximum depth or total elements to discuss complexity.

2. Choose an approach

Decide between recursive DFS (simpler, uses call stack) and iterative BFS (avoids recursion depth issues). Explain the trade-offs briefly.

3. Outline the algorithm

For DFS: define a helper function that takes the nested list and current depth. Iterate through elements; if integer, add to sum; if list, recurse with depth+1. For BFS: use a queue of (list, depth) and process level by level.

4. Code the solution

Write clean code with meaningful variable names. Handle base cases (empty list) and ensure the depth starts at 1. Use the provided NestedInteger interface.

5. Test and analyze complexity

Walk through a small example, then state time complexity O(N) where N is total number of integers and lists, and space complexity O(D) for recursion depth or O(N) for BFS queue.

Key Points to Mention

  • Depth is 1-indexed: the outermost list has depth 1.
  • Recursive DFS naturally tracks depth via function arguments.
  • BFS can process level by level, multiplying by the level number.
  • Time complexity is O(N) where N is the total number of elements (integers and lists).
  • Space complexity is O(D) for recursion depth (D = maximum nesting depth) or O(N) for BFS queue.
  • Edge cases: empty nested list, deeply nested lists, negative integers, and lists containing only empty lists.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.