0% found this document useful (0 votes)
7 views6 pages

Quiz

The document consists of a series of questions divided into five sections covering basics of data structures, algorithms, graphs and trees in AI, AI-specific data structures, and advanced concepts. Each section contains multiple-choice and true/false questions aimed at assessing knowledge in computer science and artificial intelligence. Topics include priority queues, time complexities, neural networks, and various algorithms used in AI.

Uploaded by

sirjojo407
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

Quiz

The document consists of a series of questions divided into five sections covering basics of data structures, algorithms, graphs and trees in AI, AI-specific data structures, and advanced concepts. Each section contains multiple-choice and true/false questions aimed at assessing knowledge in computer science and artificial intelligence. Topics include priority queues, time complexities, neural networks, and various algorithms used in AI.

Uploaded by

sirjojo407
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Section 1: Basics of Data Structures (10 Questions)

1. Which data structure is best suited for implementing a priority queue?


a) Stack
b) Queue
c) Heap
d) Tree
2. Which of the following is not a linear data structure?
a) Array
b) Linked List
c) Stack
d) Graph
3. What is the time complexity to search an element in a balanced binary search tree
(BST)?
a) O(1)
b) O(log n)
c) O(n)
d) O(n log n)
4. Which data structure uses LIFO order?
a) Queue
b) Array
c) Stack
d) Linked List
5. Which data structure is most efficient for checking balanced parentheses in code?
a) Queue
b) Stack
c) Graph
d) Tree
6. True/False: A singly linked list allows traversal in both directions.
7. True/False: Hash tables offer constant time complexity for average-case lookup.
8. What is the worst-case time complexity of accessing an element in an array?
a) O(1)
b) O(n)
c) O(log n)
d) O(n^2)
9. In which of the following data structures is the concept of FIFO used?
a) Stack
b) Queue
c) Tree
d) Graph
10. What does a hash function do?
a) Sorts data
b) Encrypts data
c) Maps keys to indices
d) Converts trees to lists
Section 2: Algorithms (10 Questions)

11. Which algorithm is commonly used in pathfinding in AI games?


a) Merge Sort
b) A*
c) Dijkstra's
d) BFS
12. What is the best-case time complexity of QuickSort?
a) O(n log n)
b) O(n^2)
c) O(n)
d) O(log n)
13. Which sorting algorithm is stable?
a) QuickSort
b) MergeSort
c) HeapSort
d) SelectionSort
14. True/False: BFS uses a queue while DFS uses a stack or recursion.
15. Which algorithm is optimal and complete for tree search in AI?
a) DFS
b) BFS
c) A*
d) Greedy
16. Which algorithm is used in backtracking problems like Sudoku solving?
a) BFS
b) DFS
c) Dijkstra's
d) A*
17. Which of the following is used for dynamic programming problems?
a) Greedy Algorithm
b) Recursion with memoization
c) Binary Search
d) DFS
18. What is memoization?
a) Loop unrolling
b) Caching previous results
c) Sorting input
d) Disabling recursion
19. True/False: Greedy algorithms always produce the globally optimal result.
20. Which algorithm is used to find the shortest path in a weighted graph?
a) DFS
b) BFS
c) Dijkstra’s Algorithm
d) Bellman-Ford
Section 3: Graphs and Trees in AI (10 Questions)

21. Which of the following best represents a neural network?


a) Tree
b) Directed Acyclic Graph
c) Linked List
d) Matrix
22. Which traversal method is used in Minimax search trees?
a) BFS
b) DFS
c) Inorder
d) Postorder
23. True/False: All trees are graphs, but not all graphs are trees.
24. In graph theory, what is a cycle?
a) A node with no neighbors
b) A path that begins and ends at the same node
c) A weighted edge
d) A tree traversal
25. What type of graph is used in Bayesian networks?
a) Undirected Graph
b) Directed Acyclic Graph (DAG)
c) Tree
d) Grid
26. What is the time complexity of DFS on a graph with V vertices and E
edges?
a) O(V)
b) O(E)
c) O(V+E)
d) O(VE)
27. What type of tree is used in decision tree learning?
a) Binary Tree
b) N-ary Tree
c) Regression Tree
d) Classification Tree
28. True/False: Adjacency matrix representation of a graph is more space-
efficient than adjacency list for sparse graphs.
29. Which of the following is not a valid tree traversal?
a) Inorder
b) Preorder
c) Outorder
d) Postorder
30. What is the branching factor in a tree search algorithm?
a) Number of leaves
b) Average depth
c) Number of children per node
d) Number of goals

Section 4: AI-Specific Data Structures (10 Questions)

31. What is the main data structure used to store the weights in a neural network?
a) Graph
b) Matrix
c) Queue
d) Tree
32. In reinforcement learning, what is a Q-table?
a) A table storing transition probabilities
b) A hash table of state-action values
c) A decision tree
d) A search tree
33. True/False: Tensors are generalizations of matrices used in deep learning.
34. What kind of structure is a convolutional neural network's layer typically
represented as?
a) Array
b) Tree
c) Grid/Matrix
d) Linked List
35. Which data structure underlies the Transformer attention mechanism?
a) Graph
b) Hash table
c) Matrix
d) Queue
36. Which data structure is used in backpropagation to store intermediate gradients?
a) Stack
b) Tensor
c) Tree
d) Linked List
37. True/False: Heuristics in AI search can be stored as a hash map for efficient lookup.
38. Which of the following data structures is not typically used in AI/ML libraries like
TensorFlow or PyTorch?
a) Tensor
b) Graph
c) Heap
d) Matrix
39. Which structure is commonly used for experience replay in reinforcement learning?
a) Queue
b) Stack
c) Buffer
d) Linked List
40. What type of data structure is used in Alpha-Beta pruning?
a) Stack
b) Queue
c) Tree
d) Heap

Section 5: Advanced Concepts (10 Questions)

41. What is the role of a priority queue in A algorithm?*


a) It stores the visited nodes
b) It manages the frontier with lowest-cost paths
c) It holds all the nodes
d) It stores only the goal
42. Which of the following is true for sparse matrices in ML models?
a) They are faster to compute than dense matrices
b) They use more memory
c) They are not used in ML
d) They can’t be stored efficiently
43. True/False: Recurrent Neural Networks rely heavily on stack data structures.
44. What is a Trie commonly used for in AI?
a) Sorting
b) Text prediction and autocomplete
c) Clustering
d) Decision making
45. What is the purpose of the softmax function in neural networks?
a) Normalize inputs
b) Introduce non-linearity
c) Convert outputs into probabilities
d) Reduce overfitting
46. Which data structure supports O(1) lookup in most ML feature hashing
implementations?
a) Array
b) Hash Table
c) Tree
d) Graph
47. Which graph algorithm is used in PageRank?
a) DFS
b) BFS
c) Power Iteration
d) Dijkstra
48. True/False: The backpropagation algorithm uses a directed graph for its computation
graph.
49. Which of the following is used for hierarchical clustering?
a) Union-Find
b) Min Heap
c) Tree
d) Graph
50. Which data structure is ideal for implementing beam search in NLP?
a) Queue
b) Priority Queue
c) Stack
d) Tree

You might also like