← Meta Interview Insights

Meta·Software Engineer·Online Assessment (OA)·Intermediate

Intermediate
May 2026

Summary

Meta SWE coding round with an AI-assisted platform. The problem was a maximum subset question where you had to print the actual subset, not just its size. Details were sparse in the original post so it's hard to say much more than that.

Questions Asked (1)

Q1

Given an array or set, find the largest subset satisfying some constraint and print the actual elements of that subset, not just its size.

Algorithms & Data Structures
Author's notes

The constraint definition wasn't even fully stated in what I saw, which made this extra frustrating to think about after the fact.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the specific constraint (e.g., sum, length, divisibility) and the input type (array or set) to determine the appropriate algorithmic technique. Then design a solution that not only finds the maximum size but also reconstructs the subset, typically using dynamic programming with parent pointers or a greedy approach with careful tracking. Finally, walk through a small example to validate the logic and discuss time/space complexity.

Pro tip: Always discuss how you would reconstruct the subset, not just compute its size—this is often where candidates fail. Mention that you would store predecessor information during DP or use a separate array to track choices, and be prepared to optimize space if needed.

1. Clarify the problem

Ask questions to pin down the exact constraint (e.g., sum equals target, no two adjacent, etc.), input format (array with duplicates? set?), and output requirements (any valid subset or all?).

2. Identify the algorithmic pattern

Based on the constraint, recognize if it's a variation of knapsack, longest increasing subsequence, interval scheduling, or another classic problem. This determines whether DP, greedy, or backtracking is suitable.

3. Design the DP/greedy with reconstruction

For DP, define state and transition, and store parent pointers or choices to rebuild the subset. For greedy, ensure the greedy choice property holds and track selected elements.

4. Walk through an example

Trace the algorithm on a small input to demonstrate correctness and show how the subset is reconstructed step by step.

5. Analyze complexity and edge cases

State time and space complexity, and discuss edge cases like empty input, all elements satisfying constraint, or multiple optimal subsets.

Key Points to Mention

  • Dynamic programming with parent pointers for subset reconstruction
  • Time and space complexity trade-offs (e.g., O(n*W) for knapsack)
  • Handling duplicates and whether the input is a set or array
  • Greedy approach validity and when it fails
  • Edge cases: empty input, no valid subset, multiple optimal subsets
  • Optimizing space by using 1D DP and backtracking

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