WorksheetsQUIZZERIA
Total questions: 25
Worksheet time: 13mins
Which module is used to work with regular expressions in Python?
regex
re
regx
reg
Which of the following statements is true about Python sets?
Sets allow duplicate values
Sets are mutable and ordered
Sets are immutable
Sets do not allow duplicate values
What will sorted([3, 1, 4, 1, 5], reverse=True) return?
[1, 1, 3, 4, 5]
[5, 4, 3, 1, 1]
[5, 1, 4, 1, 3]
[3, 1, 4, 1, 5]
What is the purpose of enumerate() in Python?
It adds an index to an iterable
It creates a list from a range
It sorts a list
It removes duplicates from a list
Which of the following collections in Java allows duplicate keys?
HashMap
TreeMap
Hashtable
None of the above
Which of the following is NOT a wrapper class in Java?
Integer
Float
Character
String
Which of the following is the correct way to implement an interface in Java?
class A implements B {}
class A extends B {}
class A implements B, C {}
Both (a) and (c)
What will happen if an exception is thrown inside a finally block in Java?
The program will terminate
The exception will be ignored
The exception will be caught automatically
None of the above
What is the size of int on a typical 32-bit system?
2 bytes
4 bytes
8 bytes
1 byte
What does the typedef keyword do in C?
Defines a new data type
Allocates memory dynamically
Initializes a pointer
Declares a function
Which function is used to read a single character from the user in C?
scanf()
getchar()
gets()
fread()
What is the purpose of the break statement in C?
To exit a loop or switch case
To terminate the program
To pause the execution
To define a function
Which header file is required for file handling functions in C?
<stdio.h>
<stdlib.h>
<string.h>
<file.h>
What is the difference between is and == in Python?
is compares values, == compares memory locations
is compares memory locations, == compares values
is compares data types, == compares values
Both are the same
What is the amortized time complexity of inserting an element into a dynamic array (resizable array) when doubling its size?
O(1)
O(n)
O(log n)
O(n log n)
Which of the following memory allocation techniques suffers from internal fragmentation?
Paging
Segmentation
Buddy System
Best Fit Allocation
Which of the following is NOT a valid ACID property in databases?
Atomicity
Consistency
Isolation
Scalability
Which of the following logic gates is functionally complete (i.e., can be used to implement any Boolean function)?
AND & OR
NOR
XOR
XNOR
Which of the following is true for the "Quick Sort" algorithm?
It has a worst-case time complexity of O(n²)
It is always faster than merge sort
It can sort data that is stored in a linked list
It is a stable sort
What is the main advantage of a hash table over an array?
Faster access time for elements
Easier to implement
Lower space complexity
Better for storing large data sets
What does the "COMMIT" operation in a relational database do?
It aborts the transaction and rolls back changes.
It locks the tables used in a transaction.
It commits the transaction, making changes permanent.
It saves the transaction in a temporary state.
Which of the following sorting algorithms has the best worst-case time complexity?
QuickSort
MergeSort
HeapSort
BubbleSort
Which SQL command is used to remove all records from a table without deleting the table structure?
DELETE
DROP
TRUNCATE
ALTER
What will sorted([3, 1, 4, 1, 5], reverse=True) return?
[1, 1, 3, 4, 5]
[5, 4, 3, 1, 1]
[5, 1, 4, 1, 3]
[3, 1, 4, 1, 5]
Which keyword is used to prevent method overriding in Java?
final
static
private
abstract
