Mark As Completed Discussion

BFS vs. DFS

Understanding Breadth First Search & Depth First Search Search

During the days and weeks before a technical interview, we can apply the 80/20 rule for more efficient preparation. The 80/20 rule, otherwise known as Pareto's Law, stipulates that roughly 80% of your results will come from 20% of your efforts. Once you've gotten more exposure to software engineering interview concepts, you'll find that learning certain techniques will more efficiently improve your ability to solve problems over others.

Breadth First Search (BFS) and Depth First Search (DFS) are two of the most common strategies employed in problems given during an interview. Proficiency in these two algorithms will allow you to solve (in our estimation) at least two-thirds of tree and graph problems that you may encounter in an interview.

Additionally, a surprising number of seemingly unrelated challenges can be mapped as tree or graph problems (see Levenshtein Edit Distance, Split Set to Equal Subsets, and Pick a Sign for just a small sample).