NEW
Font size
WorksheetsCODE RIDDLE
Total questions: 40
Worksheet time: 30mins
Which of the following is the correct format specifier to print an integer in C?
%f
%d
%c
%s
Which keyword is used to inherit a class in Java?
super
this
extends
implements
What is the output of the following code? x = "Hello" print(len(x))
4
5
6
Error
Which data structure is best suited for implementing recursion?
Queue
Stack
Linked List
Binary Tree
Which of these concepts is NOT supported in Java?
Multiple inheritance using classes
Abstraction
Polymorphism
Encapsulation
Which function is used to read a string from the user in C?
scanf()
gets()
printf()
puts()
Which data structure uses FIFO principle?
Stack
Queue
Linked List
Tree
Which operator gives the address of a variable?
&
*
%
#
Which SQL keyword is used to remove duplicate rows in the output?
UNIQUE
DISTINCT
REMOVE
DIFFERENT
Which data structure uses LIFO principle?
Stack
Queue
Linked List
Tree
Default value of boolean variable in Java?
true
false
0
null
Which of these is dynamic data structure?
Array
Linked List
Stack
Queue
Which exception is thrown when dividing by zero?
ArithmeticException
NullPointerException
IOException
RuntimeException
In ER model, a weak entity is one that:
Has no primary key
Depends on strong entity for identification
Both A and B
None
What is function pointer?
Pointer to data
Pointer to array
Pointer to function's address
Pointer to struct
What is the output? a = (1,2,[3,4]) a[2][0] = 99 print(a)
Error
(1,2,[3,4])
(1,2,[99,4])
None
Which of these is used to handle exceptions in Python?
catch-finally
try-except
do-catch
handle-error
What is the result? int a=5; printf("%d %d %d", a, ++a, a++);
5 6 6
5 6 7
Undefined behavior
5 7 6
Which SQL clause is applied after GROUP BY?
WHERE
HAVING
ORDER BY
LIMIT
Which of these functions is used to dynamically allocate memory?
malloc()
alloc()
create()
memalloc()
What is the output? x = [1,2,3] y = x y.append(4) print(x)
[1,2,3]
[1,2,3,4]
Error
None
In SQL, which command is used to remove a table definition permanently?
DELETE
TRUNCATE
DROP
REMOVE
Which of the following ensures that no foreign key value can exist without a corresponding primary key?
Referential Integrity
Domain Integrity
Entity Integrity
Functional Dependency
What is the output? printf("%d", 'A');
65
A
Error
97
Which concept prevents method overriding in Java?
abstract
static
final
synchronized
ASCII code of digit '0' is:
47
48
65
97
Which traversal method is best to copy a binary tree?
Preorder
Inorder
Postorder
Level order
Which function is used to compare two strings in C?
strcmp()
strcomp()
strcompare()
compare()
Which key is used to uniquely identify a row in a relation?
Foreign key
Primary key
Candidate key
Alternate key
Which exception is checked at compile time?
NullPointerException
IOException
ArithmeticException
ArrayIndexOutOfBounds
what will be the Output? a = {1,2,3} b = {3,4,5} print(a & b)
{1,2,3,4,5}
{3}
{1,2}
Error
Which of the following is NOT a valid join?
Outer Join
Cross Join
Natural Join
Foreign Join
Which collection doesn't allow duplicates?
List
Set
ArrayList
LinkedList
Which of the following is immutable?
List
Set
Tuple
Dictionary
Which design principle is violated if multiple classes depend on volatile fields?
Encapsulation
Single Responsibility
Open/Closed
Liskov Substitution
Which operator has the highest precedence in C?
* (multiplication)
++ (increment)
= (assignment)
&& (logical AND)
Which of these interfaces does Collection extend in Java?
Iterator
Iterable
Enumeration
List
Which of these ensures no phantom reads in transactions?
Read Uncommitted
Read Committed
Repeatable Read
Serializable
What is ASCII value of uppercase Z?
90
91
65
97
What is the postfix of (A + B) * (C - D)?
AB+CD-*
AB+CD-
ABCD+-
AB*CD+-
