wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

202508500003

Total questions: 45

Worksheet time: 39mins

Name
Class
Date
1.

The Banker's Algorithm is used for:

a)

CPU scheduling

b)

Deadlock detection

c)

Memory allocation

d)

Deadlock avoidance

e)

File system protection

2.

What’s the primary goal of virtual memory?

a)

Increase speed

b)

Enable multitasking

c)

Increase address space

d)

Reduce fragmentation

e)

Avoid deadlock

3.

Which protocol is used by DNS to resolve hostnames to IP addresses?

a)

TCP

b)

UDP

c)

ICMP

d)

ARP

e)

HTTP

4.

Which one is a Class C IPv4 address?

a)

126.22.33.4

b)

191.255.255.255

c)

200.1.1.1

d)

10.0.0.1

e)

224.1.1.1

5.

Which of the following uses three-way handshake?

a)

FTP

b)

TCP

c)

UDP

d)

DNS

e)

ICMP

6.

What is the purpose of subnet mask?

a)

Encrypt traffic

b)

Find default gateway

c)

Determine network and host portion

d)

Assign DNS

e)

Set TTL

7.

In OOP, a class with at least one pure virtual function is called:

a)

Abstract class

b)

Interface

c)

Base class

d)

Singleton

e)

Constructor

8.

The Decorator pattern is used to:

a)

Allow dynamic behavior extension

b)

Compress data

c)

Authenticate users

d)

Avoid subclassing

e)

Enforce abstraction

9.

Which of the following is a violation of encapsulation?

a)

Using getter methods

b)

Making all variables public

c)

Making methods private

d)

Declaring variables protected

e)

Defining constructors

10.

What is the outcome of calling a method that’s been overloaded, not overridden?

a)

Runtime resolution

b)

Static (compile-time) resolution

c)

Causes ambiguity

d)

Calls base method

e)

Depends on inheritance

11.

What is the Diamond Problem in OOP?

a)

Recursion depth exceeded

b)

Memory allocation failure

c)

Multiple inheritance ambiguity

d)

Overriding failure

e)

Object slicing

12.

You have a method draw() in the base class Shape. Different subclasses (Circle, Rectangle) implement it differently. This is an example of:

a)

Inheritance

b)

Method overloading

c)

Static binding

d)

Runtime polymorphism

e)

Abstraction

13.

In a payment system, you use a base interface PaymentMethod and classes like CreditCard, UPI, NetBanking. Which OOP feature allows this?

a)

Abstraction

b)

Polymorphism

c)

Encapsulation

d)

Inheritance

e)

Delegation

14.

A class User has fields name, email, password that should not be accessible from outside. You use private access modifier. This is:

a)

Polymorphism

b)

Abstraction

c)

Inheritance

d)

Encapsulation

e)

Delegation

15.

Which of the following are true about views in SQL?

a)

A view can be used to simplify complex queries

b)

A view stores data physically

c)

Views support INSERT, UPDATE, DELETE (with limitations)

d)

Views can have triggers

e)

Views can only be created on a single table

16.

Which statements about the IN and EXISTS operators are true?

a)

IN is generally faster than EXISTS

b)

EXISTS returns TRUE if the subquery returns at least one row

c)

IN cannot be used with subqueries

d)

EXISTS is more efficient in correlated subqueries

e)

Both IN and EXISTS can return NULL

17.

Which of the following statements about transactions are true?

a)

Transactions allow multiple operations to execute as a single unit

b)

COMMIT ends a transaction and saves the changes

c)

Transactions must always include DDL statements

d)

Transactions cannot be nested

e)

A ROLLBACK will commit the current transaction

18.

Which statements are correct regarding foreign keys?

a)

A table can have only one foreign key

b)

A foreign key must reference a primary or unique key

c)

Foreign key values must always be unique

d)

Foreign key enforces referential integrity

e)

Foreign keys are always nullable

19.

Which of the following best describe a composite primary key?

a)

A key made from two or more columns

b)

A key that is generated automatically

c)

A foreign key made of multiple columns

d)

A candidate key that references another table

e)

A key that contains duplicate values

20.

Which query returns the count of employees per job title sorted in descending order of count?

a)

SELECT job_title, COUNT(*) FROM employees GROUP BY job_title ORDER BY job_title DESC;

b)

SELECT job_title, COUNT(*) FROM employees GROUP BY job_title ORDER BY COUNT(*) DESC;

c)

SELECT COUNT(job_title) FROM employees ORDER BY COUNT(*) DESC;

d)

SELECT job_title, COUNT(*) FROM employees ORDER BY job_title;

e)

SELECT COUNT(*) FROM employees GROUP BY job_title DESC;

21.

Which query finds employees who earn the same as someone in department 10?

a)

SELECT * FROM employees WHERE salary IN (SELECT salary FROM employees WHERE department_id = 10);

b)

SELECT * FROM employees WHERE salary = salary IN department 10;

c)

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);

d)

SELECT * FROM employees GROUP BY salary = department_id;

e)

SELECT salary FROM employees HAVING department_id = 10;

22.

Which SQL query creates a new table from an existing one with selected columns?

a)

CREATE TABLE new_emp AS SELECT name, salary FROM employees;

b)

SELECT * INTO new_emp FROM employees;

c)

INSERT INTO new_emp SELECT name, salary FROM employees;

d)

CREATE new_emp FROM employees;

e)

MERGE TABLE new_emp SELECT name FROM employees;

23.

You need to implement an undo feature in a text editor. Which structure is most suitable?

a)

Queue

b)

Stack

c)

HashMap

d)

Tree

e)

Heap

24.

For a recommendation system, you need to identify connected components in a graph of users. What approach is suitable?

a)

DFS

b)

BFS

c)

Dijkstra

d)

Floyd-Warshall

e)

Kruskal

25.

A real-time messaging app requires that messages are processed in the exact order they were sent. What structure should be used?

a)

Stack

b)

Linked List

c)

Heap

d)

Queue

e)

Graph

26.

What technique is used in dynamic programming to avoid recomputation?

a)

Recursion

b)

Memoization

c)

Brute Force

d)

Backtracking

e)

Divide and Conquer

27.

Which algorithm is fastest for small datasets?

a)

Merge Sort

b)

Quick Sort

c)

Insertion Sort

d)

Heap Sort

e)

Counting Sort

28.

Which of these sorting algorithms has O(n²) time in both best and worst case?

a)

Bubble Sort

b)

Merge Sort

c)

Insertion Sort

d)

Quick Sort

e)

Counting Sort

29.

Which graph representation is more efficient for sparse graphs?

a)

Adjacency Matrix

b)

Incidence Matrix

c)

Adjacency List

d)

Edge List

e)

Cartesian Matrix

30.

Which algorithm is best suited for minimum spanning tree in dense graphs?

a)

Kruskal’s

b)

BFS

c)

Prim’s using Adjacency Matrix

d)

DFS

e)

Floyd–Warshall

31.

Which sorting is NOT stable?

a)

Merge Sort

b)

Insertion Sort

c)

Bubble Sort

d)

Heap Sort

e)

Tim Sort

32.

Which condition must be satisfied for a binary tree to be complete?

a)

Every node has 2 children

b)

All leaves are at same depth

c)

All levels are filled except possibly last

d)

Only root has two children

e)

Balanced height difference < 1

33.

Which method efficiently solves the “Trapping Rain Water” problem?

a)

Prefix Sum

b)

Sliding Window

c)

Two Pointers

d)

Sorting

e)

Binary Search

34.

If the sum of 35 distinct prime numbers is even, then one of them is always ________.

a)

3

b)

2

c)

5

d)

7

35.

The product of two numbers is 1320 and their H.C.F. is 6. The L.C.M. of the numbers is:

a)

220

b)

1314

c)

1326

d)

7920

36.

The average of first 100 natural number is:

a)

100

b)

50

c)

50.50

d)

55

37.

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:

a)

₹ 48

b)

₹ 49

c)

₹ 50

d)

₹ 35

38.

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:

a)

92

b)

42

c)

33

d)

23

39.

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)

A

b)

B

c)

C

d)

can't be determined

40.

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:

a)

20

b)

21

c)

22

d)

23

41.

If pen is table, table is fan, fan is chair, chair is roof, on which of the following will a person sit?

a)

Table

b)

Pen

c)

Chair

d)

Roof

42.

In a certain code ‘RATIONAL’ is written as ‘TARNOILA’. How would ‘BRUTAL’ be written in that code?

a)

UBRTAL

b)

URBLAT

c)

UBRATL

d)

URBTAL

43.

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?

a)

South-west

b)

North-East

c)

East

d)

North

44.

Pick the odd man out from the options

a)

Avocado

b)

Papaya

c)

Mulberry

d)

Eucalyptus

45.

Pick the odd man out from the options

a)

Awning

b)

Tarpaulin

c)

Canopy

d)

Endow