Uninformed Search — AI Technical Interview Questions & Answers

Uninformed Search

Uninformed Search

  • Uninformed search has no heuristic. BFS uses a queue — shortest path if every step costs 1. DFS uses a stack — can dive deep, may miss a nearby goal. UCS (uniform cost) expands cheapest path first — like Dijkstra. IDS repeats DFS with a rising depth limit.
  • Trap: DFS is not “always faster”. On a huge tree it can get lost. BFS eats memory. Say those two costs out loud.
  • Uninformed Search — output: three lines. No heuristic.
  start
    ├── BFS  queue
    ├── DFS  stack
    └── A*   g+h
    │
    ▼
   goal

Technical Interview Tip: BFS vs DFS: data structure + when shortest.

Code Examples for Uninformed Search

Example

# Uninformed search
print("BFS: queue  → shortest hops (cost=1)")
print("DFS: stack  → may miss a nearby goal")
print("UCS: cheapest g(n) first")

Uninformed Search — output: three lines. No heuristic.

How to Explain Uninformed Search to an Interviewer

Explain Uninformed Search as if you are teaching a junior — definition, then one example.

BFS queue. DFS stack. UCS cheapest path. No h(n).

What does the example print, and what does that prove?

Uninformed Search — output: three lines

What mistake do freshers make with Uninformed Search?

Only the buzzword, no example