NEOCODE

Routing Algorithms MCQs

Section 1: Shortest Path Algorithms (Dijkstra's, Bellman-Ford)

1. Which algorithm is used to find the shortest path in a graph with non-negative edge weights?

Correct Answer: b) Dijkstra's

Explanation:
Dijkstra's algorithm is specifically designed for finding shortest paths in graphs with non-negative edge weights.

2. What is the time complexity of Dijkstra's algorithm using a Fibonacci heap?

Correct Answer: b) O(V log V + E)

Explanation:
Using a Fibonacci heap allows Dijkstra's algorithm to achieve O(V log V + E) time complexity, which is more efficient than the O(V²) implementation.

3. Which algorithm can handle graphs with negative edge weights?

Correct Answer: b) Bellman-Ford

Explanation:
Bellman-Ford algorithm can handle graphs with negative edge weights, while Dijkstra's algorithm cannot.

4. What is the main drawback of the Bellman-Ford algorithm compared to Dijkstra's?

Correct Answer: a) Higher time complexity (O(VE))

Explanation:
Bellman-Ford has a time complexity of O(VE), which is higher than Dijkstra's O(E log V) with a priority queue.

5. Which algorithm is used in Distance Vector Routing?

Correct Answer: b) Bellman-Ford

Explanation:
Distance Vector Routing protocols use the Bellman-Ford algorithm to calculate paths based on information from neighboring routers.

Section 2: Distance Vector Routing (DVR)

6. Which of the following is a key feature of Distance Vector Routing?

Correct Answer: b) Routers share only their distance vectors with neighbors

Explanation:
In Distance Vector Routing, routers only share their distance vectors (cost to reach destinations) with directly connected neighbors.

7. What is the "count-to-infinity" problem in DVR?

Correct Answer: a) A loop where a route's cost increases indefinitely

Explanation:
Count-to-infinity occurs when routers continue to increment the metric for a destination that has become unreachable.

8. Which technique helps prevent routing loops in DVR?

Correct Answer: d) Both (a) and (c)

Explanation:
Both Split Horizon (not advertising routes back to the source) and Poison Reverse (advertising infinite cost back) help prevent routing loops.

9. Which protocol uses Distance Vector Routing?

Correct Answer: b) RIP

Explanation:
RIP (Routing Information Protocol) is the most common Distance Vector Routing protocol.

10. What is the maximum hop count in RIP to avoid count-to-infinity?

Correct Answer: a) 15

Explanation:
RIP uses a maximum hop count of 15 (with 16 considered infinite) to limit the count-to-infinity problem.

Section 3: Link State Routing (LSR)

11. Which algorithm is used in Link State Routing?

Correct Answer: b) Dijkstra's

Explanation:
Link State Routing protocols use Dijkstra's algorithm to compute shortest paths from the complete network topology.

12. What is the purpose of a Link State Advertisement (LSA)?

Correct Answer: b) To flood topology information

Explanation:
LSAs are used to flood information about a router's local topology to all other routers in the network.

13. Which protocol uses Link State Routing?

Correct Answer: b) OSPF

Explanation:
OSPF (Open Shortest Path First) is the most common Link State Routing protocol.

14. What is the main advantage of LSR over DVR?

Correct Answer: b) Faster convergence

Explanation:
Link State Routing converges faster than Distance Vector Routing because changes are flooded immediately throughout the network.

15. Which database stores the complete network topology in LSR?

Correct Answer: b) Link State Database (LSDB)

Explanation:
The Link State Database (LSDB) contains the complete network topology built from received LSAs, which is used by Dijkstra's algorithm to compute the shortest paths.