0% found this document useful (0 votes)
10 views3 pages

TechQuiz HardQAs

This document is more important to study

Uploaded by

harinikadevi9
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)
10 views3 pages

TechQuiz HardQAs

This document is more important to study

Uploaded by

harinikadevi9
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/ 3

Technical Quiz

Rules and Regulation:


 Please write your respective Team ID.
 Each question carries five points.
 Write the correct option for the following question in the given paper.
 A total of 10 minutes will be provided for every round.

Hard:
1. What is the time complexity of the Floyd-Warshall algorithm for finding
all pairs of shortest paths in a graph?
a) O(V^2)
b) O(V^2 log V)
c) O(V^3)
d) o O(E log V)

2. Which of the following algorithm is used for finding the shortest path in a
graph with non-negative weights?
a) Dijkstra's Algorithm
b) Bellman-Ford Algorithm
c) Floyd-Warshall Algorithm
d) Prim's Algorithm

3. What will be the output of the following code?


#include <stdio.h>
void func(int *p) {
*p = 10;
}
int main() {
int x = 5;
func(&x);
printf("%d", x);
return 0;
}

a) 5
b) 10
c) 15
d) Error

4. What is the purpose of the volatile keyword in C/C++?


a) To declare a constant variable.
b) To indicate that a variable can be changed unexpectedly.
c) To optimize the variable storage.
d) To manage memory dynamically.

5. What is the time complexity of accessing an element in a hash table?


a) O(1)
b) O(log n)
c) O(n)
d) O(n log n)

6. What is the output of this code?


def func(n):
if n == 0:
return 1
return n * func(n+1)
print(func(5))

a) 5
b) 10
c) 120
d) RecursionError

7. What is the worst-case time complexity for inserting a node into a B-tree
of order m?
a) O(log n)
b) O(m)
c) O(m log n)
d) O(log m * log n)

8. In the context of operating systems, what does thrashing refer to?


a) A high level of CPU utilization
b) Frequent context switching
c) Excessive page swapping
d) A lack of memory

9. What is the worst-case time complexity of inserting an element in a


balanced binary search tree (BST)?
a) O(1)
b) O(log n)
c) O(n)
d) O(n log n)

10. Which of the following describes a race condition?


a) Two processes are waiting for each other to release resources.
b) Multiple processes are accessing shared data simultaneously, leading to
incorrect results.
c) A process is unable to proceed because it is blocked by a higher-priority
process.
d) A process is executing without interruption.

You might also like