Font size
WorksheetsComputer Science Quiz
Total questions: 40
Worksheet time: 20mins
Which of the following is a property of a transaction that ensures changes are permanent once committed?
Atomicity
Consistency
Durability
Isolation
Which normal form eliminates partial dependency?
1NF
2NF
3NF
BCNF
In SQL, which command is used to remove a table along with its data permanently?
DELETE
DROP
TRUNCATE
REMOVE
Which join returns all rows from both tables, with NULLs for non-matching rows?
Inner Join
Left Join
Right Join
Full Outer Join
Which indexing technique is most efficient for range queries?
Hash Indexing
B+ Tree Indexing
Bitmap Indexing
Clustered Index
What does the SQL keyword DISTINCT do?
Sorts results
Eliminates duplicate rows
Groups rows
Finds max value
Which of the following is a non-procedural query language?
SQL
PL/SQL
Java
C
Which anomaly occurs if we cannot insert a record without the presence of another attribute?
Deletion anomaly
Update anomaly
Insertion anomaly
Redundancy anomaly
Which scheduling algorithm can cause starvation?
FCFS
SJF
Round Robin
Priority with aging
Page replacement algorithm which gives the lowest page fault rate is:
FIFO
LRU
Optimal
Clock
In multiprogramming, the degree of multiprogramming refers to:
Number of CPUs
Number of jobs in memory
Number of processes in ready queue
Number of I/O devices
Thrashing in OS occurs when:
CPU utilization is high
Processes spend more time in paging than execution
Deadlock occurs
System is idle
Which of the following is not a type of semaphore?
Binary
Counting
Mutex
Circular
Which OS concept allows multiple processes to share CPU time?
Spooling
Multitasking
Multiprogramming
Buffering
Critical section problem can be solved by ensuring:
Progress
Mutual Exclusion
Bounded Waiting
All of the above
What is the size of a virtual address space in a system with 32-bit addressing?
2^16
2^32
4 GB
Both b and c
Which layer in OSI handles error detection and correction?
Transport
Data Link
Network
Application
Which of the following uses connection-oriented communication?
UDP
TCP
ICMP
HTTP over UDP
What is the maximum length of a TCP port number?
8 bits
16 bits
32 bits
64 bits
Which topology has the highest reliability but also the highest cost?
Star
Ring
Mesh
Bus
Which protocol is used to find the hardware address from a given IP address?
RARP
ARP
DHCP
ICMP
IPv6 address length is:
32 bits
64 bits
128 bits
256 bits
Which DNS record type maps a hostname to an IP address?
MX
CNAME
A
PTR
In sliding window protocol, if the sender window size is 7, how many sequence numbers are needed?
7
8
14
15
What is the time complexity of binary search in a sorted array?
O(1)
O(n)
O(log n)
O(n log n)
Which data structure uses FIFO order?
Stack
Queue
Linked List
Tree
Which traversal of a BST gives sorted order of elements?
Preorder
Inorder
Postorder
Level order
What is the space complexity of recursive Fibonacci?
O(n)
O(1)
O(log n)
O(n^2)
Which sorting algorithm is stable and works in O(n log n)?
Quick Sort
Merge Sort
Heap Sort
Selection Sort
In a max-heap, the largest element is stored at:
Any leaf node
Root node
Left child
Right child
Which graph representation is better for sparse graphs?
Adjacency Matrix
Adjacency List
Both
None
If a stack is implemented using a linked list, what is the time complexity of push and pop?
O(n)
O(1)
O(log n)
O(n log n)
Which principle of OOPs is achieved by function overloading?
Abstraction
Inheritance
Polymorphism
Encapsulation
Which feature of C++ allows using the same function name with different signatures?
Overloading
Overriding
Inheritance
Templates
Which of the following is not a valid storage class in C?
auto
register
static
global
Which access specifier in Java makes members accessible only within the same package?
public
private
protected
default
What will happen if you write `return 0;` in the main() function in C?
Compilation error
Program runs successfully
Only runs in Linux
Causes infinite loop
Which of these is not a feature of OOP?
Encapsulation
Inheritance
Polymorphism
Modularity
Which keyword is used in Java for exception handling?
try
catch
finally
All of the above
In Java, which statement about String is correct?
String is mutable
String is immutable
String is stored in heap only
String can’t be assigned
