← Back to CS Fundamentals

BFS & DFS

CS Fundamentals

The Question

Explain BFS and DFS — when would you use each?

What a Strong Answer Covers

  • BFS = queue
  • "DFS = stack/recursion
  • "both O(V+E)
  • use case each

Related Questions

  • Process vs Thread
  • Race Condition
  • Deadlock — 4 Conditions, Prevention
  • Thread Safety — Is dict Thread Safe?
  • HashMap Internals

Practice This Question

Get AI-graded feedback on your answer with follow-up probes on weak points.

Take the Free Assessment
GrindQuestionsAITechnical interview assessment
TermsPrivacyAbout