Algorithms Technology & Digital Applications 5 ā Questions and Answers
Question 1: A social media platform detects communities of users who interact heavily with each other. Which algorithm family solves this?
- Sorting algorithms
- Graph clustering algorithms (Correct answer)
- String matching algorithms
- Divide and conquer
Correct answer: Graph clustering algorithms
Graph clustering algorithms like Louvain or Girvan-Newman detect densely connected communities within a social graph.
Question 2: A plagiarism detector compares a submitted essay against millions of documents. Which algorithm efficiently finds common substrings?
- Bubble sort
- Longest Common Subsequence (LCS) (Correct answer)
- Dijkstra's algorithm
- Prim's algorithm
Correct answer: Longest Common Subsequence (LCS)
LCS finds the longest shared sequence between two strings, making it ideal for plagiarism detection.
Question 3: A stock trading platform must execute sell orders at the best available price instantly. Which data structure enables this?
- Unsorted linked list
- Max-heap order book (Correct answer)
- Stack
- Trie
Correct answer: Max-heap order book
A max-heap order book keeps the highest bid price at the root, enabling O(1) access to the best available price.
Question 4: A delivery company needs to visit 10 warehouses and return to the start with minimum total distance. This is an instance of which problem?
- Shortest Path Problem
- Traveling Salesman Problem (TSP) (Correct answer)
- Minimum Spanning Tree
- Topological Sort
Correct answer: Traveling Salesman Problem (TSP)
The Traveling Salesman Problem asks for the shortest tour that visits every node exactly once and returns to the origin.
Question 5: A phone contacts app shows suggestions as you type each letter. What time complexity should the lookup ideally achieve per character typed?
- O(n)
- O(n log n)
- O(k) where k is the word length (Correct answer)
- O(n²)
Correct answer: O(k) where k is the word length
A Trie lookup traverses one node per character typed, giving O(k) complexity independent of the total number of contacts.
Question 6: A blockchain validates that no transaction has been tampered with by chaining block hashes together. What property does this exploit?
- Collision resistance of cryptographic hash functions (Correct answer)
- Greedy optimality
- Amortized complexity
- Graph planarity
Correct answer: Collision resistance of cryptographic hash functions
Cryptographic hash collision resistance means altering any block changes its hash, breaking the chain and revealing tampering.
Question 7: A mapping app must connect all cities in a region with roads using the minimum total cable length. Which algorithm solves this?
- Bellman-Ford
- Kruskal's Minimum Spanning Tree (Correct answer)
- Binary Search
- Counting Sort
Correct answer: Kruskal's Minimum Spanning Tree
Kruskal's algorithm builds a minimum spanning tree by greedily adding the shortest edges that don't form a cycle.
A social media platform detects communities of users who interact heavily with each other.
Which algorithm family solves this?