Blog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2025 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Algorithms
Algorithmseasy

Backtracking: what is it and when do you use it?

Tags
#backtracking#search#pruning#recursion
Back to categoryPractice quiz

Answer

Backtracking is a depth-first search over a decision tree: you build a partial solution, and when it becomes invalid you undo the last choice and try another. It’s used for problems like permutations, N-Queens, Sudoku, and subset search with pruning.

Related questions

Algorithms
What is recursion and what is a base case?
#recursion#base-case#call-stack
Algorithms
BFS vs DFS?
#graph#bfs#dfs
Algorithms
Explain Binary Search.
#search#binary-search#algorithm
MongoDB
Text indexes: when would you use them and what’s a limitation?
#mongo#text-index#search
Data Structures
Binary heap vs binary search tree: which operations are efficient?
#heap#bst#priority-queue
Kotlin
`tailrec`: what does it do and when can Kotlin optimize recursion?
#kotlin#tailrec#recursion