Watch a full mock coding interview where the candidate tackles Combination Sum, one of the most popular backtracking problems in coding interviews (LeetCode 39). This 55-minute session covers two problems and includes real-time problem solving, debugging, and interviewer feedback.
The interview starts with a warm-up problem (Unique Paths on an MxN grid using dynamic programming), then moves into the main challenge: given a list of candidate numbers and a target, find all unique combinations that sum to the target. The candidate first builds a brute-force solution that generates all combinations and filters by sum, then works through extending the solution to allow using the same number multiple times. The interviewer guides the candidate toward a cleaner recursive backtracking approach where at each index you branch between including or skipping a number. The session covers Python implementation, edge case testing, and complexity analysis.
0:00 Introduction and language selection (Python)
0:10 Warm-up problem: Unique Paths on MxN grid (dynamic programming)
1:33 Problem 2 introduction: Combination Sum
2:03 Reading problem statement and examples
3:08 Clarifying questions (duplicates, positive numbers, sorted input)
4:49 Discussing brute-force approach
6:29 Exploring sliding window idea and why it fails
7:31 Brute-force: generate all combinations, filter by sum
9:36 Complexity discussion for brute-force approach
11:11 Coding the combination generator (recursive)
17:06 Coding the match/filter function
18:27 Writing test cases and debugging
21:43 Verifying output against expected results
25:23 Extending to allow repeated candidates
28:10 Approach discussion for repeated elements
33:47 Interviewer guides toward full recursive backtracking
39:10 Implementing recursive backtracking approach
45:08 Space complexity discussion
51:17 Feedback and interview tips
54:31 Closing discussion on problem difficulty
Problem links:
Combination Sum (LeetCode 39): https://leetcode.com/problems/combina...
Unique Paths (LeetCode 62): https://leetcode.com/problems/unique-...