← Meta Interview Insights

Meta·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Interviewed at Meta for a software engineer role. The only question I can trace back to this session maps to LeetCode 322 (coin change), a classic DP problem.

Questions Asked (1)

Q1

Given a set of coin denominations and a target amount, find the minimum number of coins needed to make up that amount.

Algorithms & Data Structures
Author's notes

Classic dynamic programming.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem constraints (e.g., unlimited coins, positive denominations, target can be 0). Then explain that this is a classic dynamic programming problem where you build up the solution for smaller amounts to find the minimum coins for the target. Present the DP recurrence and analyze time/space complexity, and if time permits, discuss optimizations or alternative approaches.

Pro tip: Mention that greedy doesn't always work (e.g., denominations [1,3,4] and target 6) to show you understand edge cases, and briefly discuss how to reconstruct the actual coins if asked.

1. Clarify the problem

Ask about constraints: Are coin denominations unlimited? Can the target be 0? Are all denominations positive? What if no combination exists?

2. Define the DP state and recurrence

Let dp[i] be the minimum coins to make amount i. Initialize dp[0]=0 and dp[i]=infinity for i>0. For each amount i from 1 to target, dp[i] = min(dp[i - coin] + 1) over all coins ≤ i.

3. Implement and handle edge cases

Iterate through amounts and coins, updating dp. After filling, if dp[target] is still infinity, return -1 (or indicate impossible).

4. Analyze complexity

Time complexity: O(target * number of coins). Space complexity: O(target) for the DP array.

5. Discuss optimizations and alternatives

Mention that BFS can be used for unweighted graph interpretation, and that space can be optimized if only the minimum count is needed (though O(target) is already optimal for this approach).

Key Points to Mention

  • Dynamic programming approach with optimal substructure
  • State definition: dp[i] = min coins for amount i
  • Recurrence relation: dp[i] = min(dp[i - coin] + 1) for all coins ≤ i
  • Initialization: dp[0] = 0, others infinity
  • Handling impossible cases by returning -1 or infinity
  • Time and space complexity analysis

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