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

Final Techquiz Questions

The document contains questions about data structures, algorithms, databases, operating systems and computer networks. It tests knowledge about stacks, queues, heaps, sorting, searching, graphs, BFS, DFS, Dijkstra's algorithm, greedy algorithms, dynamic programming, SQL, relational databases, normalization, backups, NoSQL, virtual memory, ARP, TCP/IP and more.

Uploaded by

Jayarudran
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)
51 views6 pages

Final Techquiz Questions

The document contains questions about data structures, algorithms, databases, operating systems and computer networks. It tests knowledge about stacks, queues, heaps, sorting, searching, graphs, BFS, DFS, Dijkstra's algorithm, greedy algorithms, dynamic programming, SQL, relational databases, normalization, backups, NoSQL, virtual memory, ARP, TCP/IP and more.

Uploaded by

Jayarudran
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

1.

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

2. Which of the following algorithms is NOT a clustering algorithm?


a) K-Means
b) Support Vector Machine (SVM)
c) DBSCAN
d) Hierarchical Clustering
Answer: b) Support Vector Machine (SVM)

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.

8. What is the purpose of normalization in database design?


A) To reduce data redundancy and improve data integrity.
B) To increase data redundancy and simplify data retrieval.
C) To speed up database queries by denormalizing tables.
D) To decrease data integrity and optimize database performance.
Answer: A) To reduce data redundancy and improve data integrity.

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

Answer: 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)

Answer: A) ARP (Address Resolution Protocol)

14. What is the primary function of an operating system in system programming?


A) To provide a user interface for interacting with the computer.
B) To manage hardware resources and provide services to applications.
C) To compile and execute high-level programming languages.
D) To facilitate communication between networked devices.

Answer: B) To manage hardware resources and provide services to applications.

15. UNIX is written in which language?


A)C#
B)C++
C)C
D).NET
Ans c

16. OS classifies the threads as-


A)Mainframe and motherboard level
B)Kernel and User level
C)Security and Memory level
D)OS and CPU level
Ans-B

17. For which of the following purposes in Banker’s algorithm is used?


A)Preventing deadlock
B)Solving deadlock
C)Recover from deadlock
D)None
Ans A

18. How is an array initialized in C language?


A)int a[3] = {1, 2, 3};
B)int a = {1, 2, 3};
C)int a[] = new int[3]
D)int a(3) = [1, 2, 3];
Ans –A
19. What will be the output of the following code snippet?
void solve() {
int a[] = {1, 2, 3, 4, 5};
int sum = 0;
for(int i = 0; i < 5; i++) {
if(i % 2 == 0) {
sum += a[i];
}
}
cout << sum << endl;
}
A)5
B)15
C)9
D)6
Ans-c

20. What will the output of the following code snippet?


void solve() {
int a[] = {1, 2, 3, 4, 5};
int sum = 0;
for(int i = 0; i < 5; i++) {
if(i % 2 == 0) {
sum += *(a + i);
}
else {
sum -= *(a + i);
}
}
cout << sum << endl;
}
A)2
B)15
C)Syntax Error
D)3
Ans- C

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

22. Which of the following is known to be not an NP-Hard Problem?


A)Vertex Cover Problem.
B)0/1 Knapsack Problem.
C)Maximal Independent Set Problem.
D)Travelling Salesman Problem
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

24. What is the purpose of a firewall in computer networking?


A) To encrypt data transmissions between network devices.
B) To regulate network traffic based on predefined rules and policies.
C) To translate domain names into IP addresses.
D) To optimize network routing by selecting the shortest path for packet forwarding.
Answer: B) To regulate network traffic based on predefined rules and policies.

25. Consider the following pseudo-code:

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

What is the maximum number of consecutive 1s in the array [1,0,1,1,0,1] ?

Options:
a) 2
b) 3
c) 4
d) 5

Correct Answer: a)2

You might also like