Algorithms Technology & Digital Applications 2 ā Questions and Answers
Question 1: Which algorithm is used by GPS navigation apps to find the shortest driving route between two locations?
- Bubble Sort
- Dijkstra's Algorithm (Correct answer)
- Binary Search
- Merge Sort
Correct answer: Dijkstra's Algorithm
Dijkstra's Algorithm finds the shortest path in a weighted graph, which is how GPS apps compute optimal driving routes.
Question 2: A streaming service recommends movies based on what similar users watched. What algorithmic technique does this primarily use?
- Greedy Algorithm
- Collaborative Filtering (Correct answer)
- Depth-First Search
- Radix Sort
Correct answer: Collaborative Filtering
Collaborative filtering identifies users with similar taste and recommends items those users enjoyed.
Question 3: When a search engine indexes the web, it visits pages by following links layer by layer. Which traversal algorithm does this resemble?
- Depth-First Search
- Breadth-First Search (Correct answer)
- Binary Search
- Quicksort
Correct answer: Breadth-First Search
Breadth-First Search visits all neighbors before going deeper, mirroring how crawlers explore the web level by level.
Question 4: Autocomplete in a text editor suggests completions by traversing a tree of stored words. What data structure is this?
- Hash Table
- Trie (Prefix Tree) (Correct answer)
- Binary Heap
- Adjacency Matrix
Correct answer: Trie (Prefix Tree)
A Trie stores strings by shared prefixes, enabling fast prefix-based lookups used in autocomplete features.
Question 5: A social network wants to suggest friends-of-friends. Which algorithm best identifies second-degree connections?
- Quicksort
- Breadth-First Search (Correct answer)
- Binary Insertion Sort
- Huffman Coding
Correct answer: Breadth-First Search
BFS explores one hop (direct friends) then two hops (friends-of-friends) from a starting node.
Question 6: An e-commerce site uses a hash function to map product IDs to storage slots for O(1) lookup. What is a key concern with this approach?
- Logarithmic growth
- Hash collisions (Correct answer)
- Stack overflow
- Graph cycles
Correct answer: Hash collisions
Hash collisions occur when two different keys map to the same slot, requiring a collision resolution strategy.
Question 7: A music app stores a playlist as a doubly linked list. What is the time complexity of skipping to the next song?
- O(n)
- O(log n)
- O(1) (Correct answer)
- O(n²)
Correct answer: O(1)
In a doubly linked list, moving to the next node requires only following a pointer, which is O(1).
Which algorithm is used by GPS navigation apps to find the shortest driving route between two locations?