Algorithms that Changed the World Flashcards

1
Q

What is an Algorithm?

A

A finite set of precise instructions for performing a computation or for solving a problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the PageRank algorithm designed to do?

A

To rank web pages by importance based on their hyperlink structure, helping users find the most relevant pages in a massive, unstructured web.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the two main ideas behind PageRank?

A

The Hyperlink Trick - Pages linked to by many others are likely more important.

The Random Surfer Model - Models a user randomly clicking links or restarting their browsing at random pages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does PageRank define page importance?

A

A page’s importance is higher if it is linked to by other important pages, with rank distributed proportionally based on the number of outbound links.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the sink page problem in PageRank?

A

Sink pages have no outbound links, which can absorb all rank. The solution is to redistribute their rank equally across all pages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the cycle page problem in PageRank?

A

A group of pages that only link to each other can trap rank in an infinite loop. This is mitigated using the random surfer model.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the damping factor in the Random Surfer Model?

A

It represents the probability (usually 0.85) that a user continues following links. With 1 - damping factor (e.g., 0.15), the user jumps to a random page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the time complexity of the PageRank algorithm?

A

O(kN²), where k is the number of iterations and N is the number of pages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the five key components of the TCP/IP Stack?

A

Application Layer, Transport Layer,
Network Layer,
Data Link Layer,
Physical Layer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is routing and forwarding?

A

Routing - Determines the full end-to-end path through a network.
Forwarding - Determines how a router handles an individual packet using a forwarding table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Packet Switching?

A

A communication method where data is split into packets and sent independently through a network.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are global and decentralised routing algorithms?

A

Global routing algorithms have full knowledge of topology and link costs, and decentralised routing algorithms only know local neighbours and link costs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are static and dynamic routing algorithms?

A

Static ones change slowly, and dynamic ones update periodically and react to network changes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does Dijkstra’s algorithm compute?

A

The least-cost path from a source node to all other nodes in a network with non-negative link costs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What type of routing algorithm is Dijkstra’s?

A

Link State routing algorithm, meaning it is global and static.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the main principle behind Dijkstra’s algorithm?

A

Greedy and iterative: after k iterations, the shortest paths to k nodes are known.

17
Q

What is the complexity of Dijkstra’s algorithm (naive implementation)?

A

O(n^2), where n is the number of nodes.

18
Q

Why does the Internet need more than one routing algorithm?

A

Because link state algorithms respond slowly to changes, consume bandwidth with large tables, and don’t scale well for large or dynamic networks.

19
Q

What are the three main characteristics of DV routing algorithms?

A

Distributed (no global knowledge), Iterative (keep updating), Asynchronous (don’t all update at the same time).

20
Q

How do DV routing algorithms work?

A

WAIT for changes in local links. RECOMPUTE its DVs. NOTIFY only if DV to any destination has changed.

21
Q

What is the purpose of Poisoned Reverse in DV routing?

A

To prevent routing loops by telling neighbors not to use certain paths (set cost to ∞). e.g If A routes. through B to get to C, A tells B its distance to C is infinity.

22
Q

What is the O notation of Bellman-Ford?

23
Q

Why is hierarchical routing necessary on the Internet?

A

Because the Internet is too large to maintain a flat routing structure; storing all destinations and exchanging updates would consume too much bandwidth.

24
Q

What is an Autonomous System (AS)?

A

A group of routers under a single administrative domain that run the same intra-AS routing protocol.

25
Q

What are the two types of routing in a hierarchical routing system?

A

Intra-AS, and Inter-AS

26
Q

What is the role of a gateway router in hierarchical routing?

A

It connects different ASes and runs both intra-AS and inter-AS routing protocols.

27
Q

What does intra-AS routing focus on?

A

Performance — since all routers are under one admin, there’s no need for policy decisions.

28
Q

What does inter-AS routing focus on?

A

Policy — administrators decide how traffic is routed between ASes.

29
Q

What are the benefits of hierarchical routing?

A

Reduces routing table size, limits traffic update scope, improves performance, and supports routing policies

30
Q

Which protocols are typically used for intra-AS routing?

A

Routing Information Protocol (RIP) and Open Shortest Path First (OSPF)

31
Q

Which protocol is typically used for inter-AS routing?

A

BGP (Border Gateway Protocol)

32
Q

What is the difference between RIP and OSPF?

A

RIP uses distance vector with hop count, while OSPF uses link-state with a full network map and Dijkstra’s algorithm.

33
Q

How does BGP work?

A

. It uses TCP to send messages like OPEN (establish session), UPDATE (announce/withdraw routes), KEEPALIVE (maintain session), and NOTIFICATION (error handling). Routing decisions are based on policies set by administrators, not just shortest path.