wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Computer Science Quiz

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

Which of the following is a property of a transaction that ensures changes are permanent once committed?

a)

Atomicity

b)

Consistency

c)

Durability

d)

Isolation

2.

Which normal form eliminates partial dependency?

a)

1NF

b)

2NF

c)

3NF

d)

BCNF

3.

In SQL, which command is used to remove a table along with its data permanently?

a)

DELETE

b)

DROP

c)

TRUNCATE

d)

REMOVE

4.

Which join returns all rows from both tables, with NULLs for non-matching rows?

a)

Inner Join

b)

Left Join

c)

Right Join

d)

Full Outer Join

5.

Which indexing technique is most efficient for range queries?

a)

Hash Indexing

b)

B+ Tree Indexing

c)

Bitmap Indexing

d)

Clustered Index

6.

What does the SQL keyword DISTINCT do?

a)

Sorts results

b)

Eliminates duplicate rows

c)

Groups rows

d)

Finds max value

7.

Which of the following is a non-procedural query language?

a)

SQL

b)

PL/SQL

c)

Java

d)

C

8.

Which anomaly occurs if we cannot insert a record without the presence of another attribute?

a)

Deletion anomaly

b)

Update anomaly

c)

Insertion anomaly

d)

Redundancy anomaly

9.

Which scheduling algorithm can cause starvation?

a)

FCFS

b)

SJF

c)

Round Robin

d)

Priority with aging

10.

Page replacement algorithm which gives the lowest page fault rate is:

a)

FIFO

b)

LRU

c)

Optimal

d)

Clock

11.

In multiprogramming, the degree of multiprogramming refers to:

a)

Number of CPUs

b)

Number of jobs in memory

c)

Number of processes in ready queue

d)

Number of I/O devices

12.

Thrashing in OS occurs when:

a)

CPU utilization is high

b)

Processes spend more time in paging than execution

c)

Deadlock occurs

d)

System is idle

13.

Which of the following is not a type of semaphore?

a)

Binary

b)

Counting

c)

Mutex

d)

Circular

14.

Which OS concept allows multiple processes to share CPU time?

a)

Spooling

b)

Multitasking

c)

Multiprogramming

d)

Buffering

15.

Critical section problem can be solved by ensuring:

a)

Progress

b)

Mutual Exclusion

c)

Bounded Waiting

d)

All of the above

16.

What is the size of a virtual address space in a system with 32-bit addressing?

a)

2^16

b)

2^32

c)

4 GB

d)

Both b and c

17.

Which layer in OSI handles error detection and correction?

a)

Transport

b)

Data Link

c)

Network

d)

Application

18.

Which of the following uses connection-oriented communication?

a)

UDP

b)

TCP

c)

ICMP

d)

HTTP over UDP

19.

What is the maximum length of a TCP port number?

a)

8 bits

b)

16 bits

c)

32 bits

d)

64 bits

20.

Which topology has the highest reliability but also the highest cost?

a)

Star

b)

Ring

c)

Mesh

d)

Bus

21.

Which protocol is used to find the hardware address from a given IP address?

a)

RARP

b)

ARP

c)

DHCP

d)

ICMP

22.

IPv6 address length is:

a)

32 bits

b)

64 bits

c)

128 bits

d)

256 bits

23.

Which DNS record type maps a hostname to an IP address?

a)

MX

b)

CNAME

c)

A

d)

PTR

24.

In sliding window protocol, if the sender window size is 7, how many sequence numbers are needed?

a)

7

b)

8

c)

14

d)

15

25.

What is the time complexity of binary search in a sorted array?

a)

O(1)

b)

O(n)

c)

O(log n)

d)

O(n log n)

26.

Which data structure uses FIFO order?

a)

Stack

b)

Queue

c)

Linked List

d)

Tree

27.

Which traversal of a BST gives sorted order of elements?

a)

Preorder

b)

Inorder

c)

Postorder

d)

Level order

28.

What is the space complexity of recursive Fibonacci?

a)

O(n)

b)

O(1)

c)

O(log n)

d)

O(n^2)

29.

Which sorting algorithm is stable and works in O(n log n)?

a)

Quick Sort

b)

Merge Sort

c)

Heap Sort

d)

Selection Sort

30.

In a max-heap, the largest element is stored at:

a)

Any leaf node

b)

Root node

c)

Left child

d)

Right child

31.

Which graph representation is better for sparse graphs?

a)

Adjacency Matrix

b)

Adjacency List

c)

Both

d)

None

32.

If a stack is implemented using a linked list, what is the time complexity of push and pop?

a)

O(n)

b)

O(1)

c)

O(log n)

d)

O(n log n)

33.

Which principle of OOPs is achieved by function overloading?

a)

Abstraction

b)

Inheritance

c)

Polymorphism

d)

Encapsulation

34.

Which feature of C++ allows using the same function name with different signatures?

a)

Overloading

b)

Overriding

c)

Inheritance

d)

Templates

35.

Which of the following is not a valid storage class in C?

a)

auto

b)

register

c)

static

d)

global

36.

Which access specifier in Java makes members accessible only within the same package?

a)

public

b)

private

c)

protected

d)

default

37.

What will happen if you write `return 0;` in the main() function in C?

a)

Compilation error

b)

Program runs successfully

c)

Only runs in Linux

d)

Causes infinite loop

38.

Which of these is not a feature of OOP?

a)

Encapsulation

b)

Inheritance

c)

Polymorphism

d)

Modularity

39.

Which keyword is used in Java for exception handling?

a)

try

b)

catch

c)

finally

d)

All of the above

40.

In Java, which statement about String is correct?

a)

String is mutable

b)

String is immutable

c)

String is stored in heap only

d)

String can’t be assigned