Final Techquiz Questions
Final Techquiz Questions
Which data structure would you use to implement a browser's history feature
efficiently?
A) Linked List
B) Stack
C) Queue
D) Tree
Answer: B) Stack
3. Which data structure would you use to implement a priority queue efficiently?
A) Array
B) Stack
C) Queue
D) Heap
Answer: D) Heap
4. What is the time complexity of finding the shortest path in a weighted graph using Dijkstra's
algorithm?
A) O(V^2)
B) O(E log V)
C) O(E + V log V)
D) O(V log V)
Answer: B) O(E log V)
5. Given an array representing stock prices on consecutive days, how would you find the
maximum profit that can be made by buying and selling stocks once?
A) Dynamic Programming
B) Greedy Algorithm
C) Depth-First Search (DFS)
D) Breadth-First Search (BFS)
Answer: B) Greedy Algorithm
6. Given a maze represented as a 2D grid, how would you find the shortest path from the start
point to the end point efficiently?
A) Breadth-First Search (BFS)
B) Depth-First Search (DFS)
C) Dijkstra's Algorithm
D) A* Algorithm
Answer: D) A* Algorithm
7. What is the difference between a primary key and a unique key in a relational database?
A) A primary key cannot have NULL values, whereas a unique key can.
B) A primary key uniquely identifies a record in a table, whereas a unique key can be NULL.
C) A primary key can be composed of multiple columns, whereas a unique key cannot.
D) A primary key automatically creates an index, whereas a unique key does not.
Answer: A) A primary key cannot have NULL values, whereas a unique key can.
9. How would you handle database backups and recovery to ensure data integrity and
availability?
A) Take full backups daily and store them on the same server for quick access.
B) Implement regular incremental backups and store them off-site for disaster recovery.
C) Use database snapshots instead of backups to save storage space.
D) Disable transaction logging to improve database performance.
Answer: B) Implement regular incremental backups and store them off-site for disaster
recovery.
10. Which database architecture allows for horizontal scaling by sharding data across multiple
nodes?
A) Relational Database Management System (RDBMS)
B) Object-Oriented Database Management System (OODBMS)
C) NewSQL Database
D) NoSQL Database
11. How does virtual memory management improve system performance in an operating
system?
A) By allocating physical memory dynamically to processes as needed.
B) By providing a larger address space for processes than the physical memory available.
C) By allowing processes to execute without interruptions from other processes.
D) By reducing the amount of disk space required for storing data.
Answer: B) By providing a larger address space for processes than the physical memory
available.
12. A process which is copied from main memory to secondary memory on the basis of
requirement is known as -
A)Demand paging
B)Paging
C)Threads
D)Segmentation
Ans-A
13. Which TCP/IP protocol is used to resolve IP addresses to physical MAC addresses on a local
network?
A) ARP (Address Resolution Protocol)
B) ICMP (Internet Control Message Protocol)
C) DHCP (Dynamic Host Configuration Protocol)
D) DNS (Domain Name System)
21. What is the time complexity of the following code snippet in C++?
void solve() {
string s = "scaler";
int n = s.size();
for(int i = 0; i < n; i++) {
s = s + s[i];
}
cout << s << endl;
}
A)O(n)
B)O(n^2)
C)O(1)
D)O(log n)
Ans-b
23. To select some particular columns, which of the following command is used?
A)PROJECTION
B)SELECTION
C)JOIN
D)UNION
Ans-)a
function findMaxConsecutiveOnes(nums)
maxCount = 0
count = 0
for num in nums
if num == 1
count += 1
maxCount = max(maxCount, count)
else
count = 0
return maxCount
Options:
a) 2
b) 3
c) 4
d) 5