Font size
Worksheets202508500003
Total questions: 45
Worksheet time: 39mins
The Banker's Algorithm is used for:
CPU scheduling
Deadlock detection
Memory allocation
Deadlock avoidance
File system protection
What’s the primary goal of virtual memory?
Increase speed
Enable multitasking
Increase address space
Reduce fragmentation
Avoid deadlock
Which protocol is used by DNS to resolve hostnames to IP addresses?
TCP
UDP
ICMP
ARP
HTTP
Which one is a Class C IPv4 address?
126.22.33.4
191.255.255.255
200.1.1.1
10.0.0.1
224.1.1.1
Which of the following uses three-way handshake?
FTP
TCP
UDP
DNS
ICMP
What is the purpose of subnet mask?
Encrypt traffic
Find default gateway
Determine network and host portion
Assign DNS
Set TTL
In OOP, a class with at least one pure virtual function is called:
Abstract class
Interface
Base class
Singleton
Constructor
The Decorator pattern is used to:
Allow dynamic behavior extension
Compress data
Authenticate users
Avoid subclassing
Enforce abstraction
Which of the following is a violation of encapsulation?
Using getter methods
Making all variables public
Making methods private
Declaring variables protected
Defining constructors
What is the outcome of calling a method that’s been overloaded, not overridden?
Runtime resolution
Static (compile-time) resolution
Causes ambiguity
Calls base method
Depends on inheritance
What is the Diamond Problem in OOP?
Recursion depth exceeded
Memory allocation failure
Multiple inheritance ambiguity
Overriding failure
Object slicing
You have a method draw() in the base class Shape. Different subclasses (Circle, Rectangle) implement it differently. This is an example of:
Inheritance
Method overloading
Static binding
Runtime polymorphism
Abstraction
In a payment system, you use a base interface PaymentMethod and classes like CreditCard, UPI, NetBanking. Which OOP feature allows this?
Abstraction
Polymorphism
Encapsulation
Inheritance
Delegation
A class User has fields name, email, password that should not be accessible from outside. You use private access modifier. This is:
Polymorphism
Abstraction
Inheritance
Encapsulation
Delegation
Which of the following are true about views in SQL?
A view can be used to simplify complex queries
A view stores data physically
Views support INSERT, UPDATE, DELETE (with limitations)
Views can have triggers
Views can only be created on a single table
Which statements about the IN and EXISTS operators are true?
IN is generally faster than EXISTS
EXISTS returns TRUE if the subquery returns at least one row
IN cannot be used with subqueries
EXISTS is more efficient in correlated subqueries
Both IN and EXISTS can return NULL
Which of the following statements about transactions are true?
Transactions allow multiple operations to execute as a single unit
COMMIT ends a transaction and saves the changes
Transactions must always include DDL statements
Transactions cannot be nested
A ROLLBACK will commit the current transaction
Which statements are correct regarding foreign keys?
A table can have only one foreign key
A foreign key must reference a primary or unique key
Foreign key values must always be unique
Foreign key enforces referential integrity
Foreign keys are always nullable
Which of the following best describe a composite primary key?
A key made from two or more columns
A key that is generated automatically
A foreign key made of multiple columns
A candidate key that references another table
A key that contains duplicate values
Which query returns the count of employees per job title sorted in descending order of count?
SELECT job_title, COUNT(*) FROM employees GROUP BY job_title ORDER BY job_title DESC;
SELECT job_title, COUNT(*) FROM employees GROUP BY job_title ORDER BY COUNT(*) DESC;
SELECT COUNT(job_title) FROM employees ORDER BY COUNT(*) DESC;
SELECT job_title, COUNT(*) FROM employees ORDER BY job_title;
SELECT COUNT(*) FROM employees GROUP BY job_title DESC;
Which query finds employees who earn the same as someone in department 10?
SELECT * FROM employees WHERE salary IN (SELECT salary FROM employees WHERE department_id = 10);
SELECT * FROM employees WHERE salary = salary IN department 10;
SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees WHERE department_id = 10) AND (SELECT MAX(salary) FROM employees WHERE department_id = 10);
SELECT * FROM employees GROUP BY salary = department_id;
SELECT salary FROM employees HAVING department_id = 10;
Which SQL query creates a new table from an existing one with selected columns?
CREATE TABLE new_emp AS SELECT name, salary FROM employees;
SELECT * INTO new_emp FROM employees;
INSERT INTO new_emp SELECT name, salary FROM employees;
CREATE new_emp FROM employees;
MERGE TABLE new_emp SELECT name FROM employees;
You need to implement an undo feature in a text editor. Which structure is most suitable?
Queue
Stack
HashMap
Tree
Heap
For a recommendation system, you need to identify connected components in a graph of users. What approach is suitable?
DFS
BFS
Dijkstra
Floyd-Warshall
Kruskal
A real-time messaging app requires that messages are processed in the exact order they were sent. What structure should be used?
Stack
Linked List
Heap
Queue
Graph
What technique is used in dynamic programming to avoid recomputation?
Recursion
Memoization
Brute Force
Backtracking
Divide and Conquer
Which algorithm is fastest for small datasets?
Merge Sort
Quick Sort
Insertion Sort
Heap Sort
Counting Sort
Which of these sorting algorithms has O(n²) time in both best and worst case?
Bubble Sort
Merge Sort
Insertion Sort
Quick Sort
Counting Sort
Which graph representation is more efficient for sparse graphs?
Adjacency Matrix
Incidence Matrix
Adjacency List
Edge List
Cartesian Matrix
Which algorithm is best suited for minimum spanning tree in dense graphs?
Kruskal’s
BFS
Prim’s using Adjacency Matrix
DFS
Floyd–Warshall
Which sorting is NOT stable?
Merge Sort
Insertion Sort
Bubble Sort
Heap Sort
Tim Sort
Which condition must be satisfied for a binary tree to be complete?
Every node has 2 children
All leaves are at same depth
All levels are filled except possibly last
Only root has two children
Balanced height difference < 1
Which method efficiently solves the “Trapping Rain Water” problem?
Prefix Sum
Sliding Window
Two Pointers
Sorting
Binary Search
If the sum of 35 distinct prime numbers is even, then one of them is always ________.
3
2
5
7
The product of two numbers is 1320 and their H.C.F. is 6. The L.C.M. of the numbers is:
220
1314
1326
7920
The average of first 100 natural number is:
100
50
50.50
55
The percent profit made when an article is sold for Rs. 56 is thrice as when it is sold for Rs. 42. The cost price of the price of the article is:
₹ 48
₹ 49
₹ 50
₹ 35
Rs. 69 were divided among 115 students so that each girl gets 50 paise less than a boy. Thus each boy
received twice the paise as each girl received. The no. of girls in the class is:
92
42
33
23
The ratio of working efficiency of A and B is 5:3 and the ratio of efficiency of B and C is 5:8. Who is the
most efficiency?
A
B
C
can't be determined
The average salary of all the workers in a workshop is Rs.8000. The average salary of 7 technicians is
Rs.12000 and the average salary of the rest is Rs.6000. The total number of workers in the workshop is:
20
21
22
23
If pen is table, table is fan, fan is chair, chair is roof, on which of the following will a person sit?
Table
Pen
Chair
Roof
In a certain code ‘RATIONAL’ is written as ‘TARNOILA’. How would ‘BRUTAL’ be written in that code?
UBRTAL
URBLAT
UBRATL
URBTAL
Reena walks 10 km south from her house, turns left and walk 25 km, again turns left and walks 40
km, then turns right and walks 5 km to reach her office. In which direction was her office from her
house?
South-west
North-East
East
North
Pick the odd man out from the options
Avocado
Papaya
Mulberry
Eucalyptus
Pick the odd man out from the options
Awning
Tarpaulin
Canopy
Endow
