NEOCODE

Routing Algorithms MCQs

Section 1: Shortest Path Algorithm (Dijkstra's Algorithm)

1. What is the main objective of the shortest path algorithm in routing?

Correct Answer: b) Minimize the total path cost

Explanation:
The shortest path algorithm aims to find the path with the lowest total cost (sum of link costs) between source and destination, not necessarily the fewest hops.

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

Correct Answer: b) Dijkstra's

Explanation:
Dijkstra's algorithm is the most efficient for finding shortest paths in graphs with non-negative weights. Bellman-Ford can handle negative weights, and Floyd-Warshall finds paths between all pairs.

3. Dijkstra's algorithm is an example of:

Correct Answer: b) Link State Routing

Explanation:
Dijkstra's algorithm is used in Link State Routing protocols where each router has complete topology information and computes shortest paths independently.

4. What is the time complexity of Dijkstra's algorithm using a binary heap?

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

Explanation:
With a binary heap implementation, each extract-min operation takes O(log V) and there are V such operations. Each edge relaxation takes O(log V) and there are E edges.

5. In Dijkstra's algorithm, which data structure is optimal for extracting the minimum distance node efficiently?

Correct Answer: c) Priority Queue (Min-Heap)

Explanation:
A min-heap allows O(1) access to the minimum element and O(log n) insertion and extraction, making it ideal for Dijkstra's algorithm which repeatedly needs the node with the smallest tentative distance.

Section 2: Distance Vector Routing (DVR)

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

Correct Answer: a) Routers exchange entire routing tables with neighbors

Explanation:
In Distance Vector Routing, routers periodically send their complete routing tables to directly connected neighbors, containing information about all known destinations and distances.

7. What is the main issue with Distance Vector Routing?

Correct Answer: b) Count-to-infinity problem

Explanation:
The count-to-infinity problem occurs when routers slowly increment their metric for a destination that has become unreachable, potentially causing routing loops until the metric reaches its maximum value.

8. Which algorithm is used in Distance Vector Routing to update routing tables?

Correct Answer: b) Bellman-Ford algorithm

Explanation:
The Bellman-Ford algorithm forms the mathematical basis for Distance Vector Routing, where each router calculates distances based on information from its neighbors.

9. What is "Split Horizon" used for in DVR?

Correct Answer: a) To prevent routing loops

Explanation:
Split Horizon prevents a router from advertising a route back to the neighbor from which it learned that route, which helps prevent routing loops.

10. Which protocol uses Distance Vector Routing?

Correct Answer: c) RIP

Explanation:
RIP (Routing Information Protocol) is the most common Distance Vector Routing protocol. OSPF and IS-IS are link-state protocols, while BGP is a path-vector protocol.

Section 3: Link State Routing (LSR)

11. Which of the following is a characteristic of Link State Routing?

Correct Answer: b) Routers flood Link State Advertisements (LSAs)

Explanation:
In Link State Routing, routers flood LSAs throughout the network, allowing each router to build a complete topological map of the network.

12. Which algorithm is used in Link State Routing to compute the shortest path?

Correct Answer: b) Dijkstra's

Explanation:
Link State Routing protocols use Dijkstra's algorithm to compute shortest paths from the complete network topology stored in the link-state database.

13. What is the purpose of a "Link State Database" in LSR?

Correct Answer: a) Stores the entire network topology

Explanation:
The Link State Database contains information about all routers and links in the network, forming a complete topological map used for shortest path calculations.

14. Which protocol uses Link State Routing?

Correct Answer: c) OSPF

Explanation:
OSPF (Open Shortest Path First) is the most common Link State Routing protocol. RIP is distance vector, BGP is path vector, and EIGRP is an advanced distance vector protocol.

15. What is the main advantage of Link State Routing over Distance Vector Routing?

Correct Answer: b) Faster convergence

Explanation:
Link State Routing converges faster than Distance Vector Routing because changes are flooded immediately throughout the network and each router can independently recalculate paths.