🧠 AI Search Algorithms Interview Questions with Answers (Part 3)
1️⃣1️⃣ What is Uniform Cost Search (UCS)?
👉 Uniform Cost Search expands the node with the lowest path cost from the starting point.
📌 It uses:
💡 UCS is useful when different actions have different costs.
⏱️ Time Complexity: Depends on the search space
💾 Space Complexity: Depends on the search space
1️⃣2️⃣ What is Bidirectional Search?
👉 Bidirectional Search runs two searches simultaneously:
🔹 One from the initial state
🔹 One from the goal state
The searches continue until they meet.
💡 It can significantly reduce the search depth for suitable problems.
1️⃣3️⃣ What is Local Search in AI?
👉 Local Search algorithms focus on the current state and its neighboring states rather than maintaining a complete search path.
Examples:
🔹 Hill Climbing
🔹 Simulated Annealing
🔹 Local Beam Search
💡 Local search is commonly used for optimization problems where the goal is to find a good solution rather than necessarily reconstructing a path.
1️⃣4️⃣ What is Simulated Annealing?
👉 Simulated Annealing is a local optimization algorithm that sometimes accepts a worse solution temporarily to escape local optima.
📌 Basic idea:
💡 The probability of accepting worse solutions gradually decreases as the algorithm progresses.
1️⃣5️⃣ What is a Genetic Algorithm?
👉 A Genetic Algorithm is an optimization technique inspired by natural selection and evolution.
Main steps:
🔹 Initialize Population
🔹 Evaluate Fitness
🔹 Selection
🔹 Crossover
🔹 Mutation
🔹 Repeat
💡 Genetic Algorithms are useful for complex optimization problems where traditional methods may be difficult to apply.
💬 Save this for your AI interview preparation!
🔥 Next: Advanced Coding – Part 4
#AI #ArtificialIntelligence #AISearch #GeneticAlgorithm #SimulatedAnnealing #AIInterview #InterviewQuestions
1️⃣1️⃣ What is Uniform Cost Search (UCS)?
👉 Uniform Cost Search expands the node with the lowest path cost from the starting point.
📌 It uses:
Priority = Path Cost
💡 UCS is useful when different actions have different costs.
⏱️ Time Complexity: Depends on the search space
💾 Space Complexity: Depends on the search space
1️⃣2️⃣ What is Bidirectional Search?
👉 Bidirectional Search runs two searches simultaneously:
🔹 One from the initial state
🔹 One from the goal state
The searches continue until they meet.
Start → → → ← ← ← Goal
↓
Meet
💡 It can significantly reduce the search depth for suitable problems.
1️⃣3️⃣ What is Local Search in AI?
👉 Local Search algorithms focus on the current state and its neighboring states rather than maintaining a complete search path.
Examples:
🔹 Hill Climbing
🔹 Simulated Annealing
🔹 Local Beam Search
💡 Local search is commonly used for optimization problems where the goal is to find a good solution rather than necessarily reconstructing a path.
1️⃣4️⃣ What is Simulated Annealing?
👉 Simulated Annealing is a local optimization algorithm that sometimes accepts a worse solution temporarily to escape local optima.
📌 Basic idea:
Current Solution
↓
Generate Neighbor
↓
Better? → Accept
Worse? → Sometimes Accept
↓
Continue
💡 The probability of accepting worse solutions gradually decreases as the algorithm progresses.
1️⃣5️⃣ What is a Genetic Algorithm?
👉 A Genetic Algorithm is an optimization technique inspired by natural selection and evolution.
Main steps:
🔹 Initialize Population
🔹 Evaluate Fitness
🔹 Selection
🔹 Crossover
🔹 Mutation
🔹 Repeat
Population
↓
Fitness
↓
Selection
↓
Crossover + Mutation
↓
New Population
💡 Genetic Algorithms are useful for complex optimization problems where traditional methods may be difficult to apply.
💬 Save this for your AI interview preparation!
🔥 Next: Advanced Coding – Part 4
#AI #ArtificialIntelligence #AISearch #GeneticAlgorithm #SimulatedAnnealing #AIInterview #InterviewQuestions