Interview concept

What are recursion and backtracking?

Recursion solves a problem by calling itself on smaller inputs until a base case. Backtracking is recursion that tries a choice, explores further, and undoes the choice when it leads to a dead end.

Summary

Key takeaways

Recursion and backtracking - Interview Concepts - ExtraBrain is part of ExtraBrain's local-first Mac workflow for live interviews, meetings, transcription, provider control, and responsible AI use.

Page focus

Recursion solves a problem by calling itself on smaller inputs until a base case. Backtracking is recursion that tries a choice, explores further, and undoes the choice when it leads to a dead end.

Platform fact

ExtraBrain has 1 current public platform family, macOS, with support for 2 Mac CPU families: Apple Silicon and Intel.

Data-flow fact

ExtraBrain has 3 configurable data paths to review before sensitive work: local Parakeet transcription, local Gemma 4 where installed and compatible, and external providers you choose.

Interview concept

How it works

Base case and recurrence

Define a clear base case and how each call reduces the problem toward it.

Backtracking template

Choose, explore, and un-choose, pruning branches that cannot lead to a valid solution.

When to use it

Reach for it on permutations, combinations, subsets, and constraint problems like N-Queens.

Interview concept

Responsible use

Use any live AI assistant only where interview, workplace, school, and platform rules allow it. Do not use generated answers to misrepresent your skills, experience, or authorship.

FAQ

Common questions.

Short answers for people and crawlers comparing ExtraBrain with other live AI assistants.

What is the difference between recursion and backtracking?

Backtracking is a form of recursion that explores choices and undoes them, systematically searching a solution space with pruning.

How do I avoid stack overflow?

Ensure a reachable base case, bound recursion depth, and consider an iterative or memoized approach for deep recursion.