wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Test for Top 400

Total questions: 40

Worksheet time: 40mins

Name
Class
Date
1.

In preorder traversal of a binary tree the second step is ____________

a)

traverse the right subtree

b)

traverse the left subtree

c)

traverse right subtree and visit the root

d)

visit the root

2.

Given a sequence of number below:

50,60,40,70,45,55,30,80,65,35,25,75,85


When creating a binary search tree, what is the height of the tree?

a)

3

b)

4

c)

5

d)

6

3.

What kind of linked list begins with a pointer to the first node, and each node contains a pointer to the next node, and the pointer in the last node points back to the first node?

a)

Circular, singly-linked list.

b)

Circular, doubly-linked list.

c)

Singly-linked list.

d)

Doubly-linked list.

4.
Which of the following concepts of OOPS means exposing only necessary information to client?
a)
Encapsulation
b)
Abstraction
c)
Data hiding
d)
Data binding
5.

Choose the behaviour of Class: time

a)

Hour

b)

Second

c)

PrintTime

d)

getHour

6.

Ready the Query carefully:


SELECT emp_name FROM department WHERE dept_name LIKE ' _____ Computer Science';

In the above-given Query, which of the following can be placed in the Query's blank portion to select the "dept_name" that also contains Computer Science as its ending string?

a)

&

b)

_

c)

%

d)

$

7.

In RDBMS, different classes of relations are created using __________ technique to prevent modification anomalies.

a)

Functional Dependencies

b)

Data integrity

c)

Normal Forms

d)

Referential integrity

8.

The statement that is executed automatically by the system as a side effect of the modification of the database is

a)

trigger

b)

recovery

c)

assertion

d)

backup

9.

Which operation is used to extract specified columns from a table?

a)

Project

b)

join

c)

Substitute

d)

Extract

10.

Relations produced from E - R Model will always be in ________.

a)

2 NF

b)

1 NF

c)

3 NF

d)

BCNF

11.

A function that changes the values of an object's attributes in a Class is also known as a:

a)

string function

b)

setter

c)

getter

d)

changer

12.

When overloading a function, the signature of the function is determined by:

a)

The name of the function

b)

The name of the function and number of argument and types

c)

The return type, name and number of arguments and types.

13.

When a class is derived from a base class it gets access to:

a)

Private

b)

Protected

c)

Private and Protected

d)

Protected and Public

e)

Private, Protected and Public

14.

If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?

a)

ABCD

b)

DCBA

c)

DCAB

d)

ABDC

15.

What is a dequeue?

a)

A queue with insert/delete defined for both front and rear ends of the queue

b)

A queue implemented with a doubly linked list

c)

A queue implemented with both singly and doubly linked lists

d)

A queue with insert/delete defined for front side of the queue

16.

What data structure is used for breadth first traversal of a graph?

a)

queue

b)

stack

c)

list

d)

none of the above

17.

Which data structure is needed to convert infix notation to postfix notation?

a)

a) Tree

b)

b) List

c)

c) Stack

d)

d) Queue

18.

What happens if the word static is placed in front of a member function in C++?

a)

The member function can be called even if we do not create an instance of the class.

b)

It places the member function in the static part of memory

c)

It will cause an error and the program will not compile.

d)

None of the above.

19.

What will be the output of the following C code?

a)

True

b)

False

c)

True False

d)

No Output

20.

What will be the output of the following C code?

a)

Hi is printed 9 times

b)

Hi is printed 8 times

c)

Hi is printed 7 times

d)

Hi is printed 6 times

21.

what will be printed after Execution of the following program

void main()

{

int a[5]={11,13,56,20,5};

printf("%d",a[2]);

}

a)

garbage value

b)

13

c)

56

d)

20

22.
Which is the most appropriate data type for: "13th December"
a)
Float
b)
Boolean
c)
Integer
d)
String
23.

What will be the output of the following Python code?

a={1:"A",2:"B",3:"C"}

b={4:"D",5:"E"}

a.update(b)

print(a)

a)

a) {1: ‘A’, 2: ‘B’, 3: ‘C’}

b)

b) Method update() doesn’t exist for dictionaries

c)

c) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}

d)

d) {4: ‘D’, 5: ‘E’}

24.

What will be the output of the following Python code snippet?

d = {"john":40, "peter":45}

d["john"]

a)

a) 40

b)

b) 45

c)

c) “john”

d)

d) “peter”

25.

Which of the following classes extends HashMap and maintains the insertion order of the elements?

a)

TreeMap

b)

LinkedHashMap

c)

SortedMap

d)

None of the above

26.

Which of the following is mutable object in Java?

a)

String

b)

StringBuffer

c)

Both A & B

d)

None of the above

27.

Which of the following collection will store the elements in a sorter manner?

a)

Collection

b)

List

c)

Set

d)

SortedSet

28.

Which of these statements are true?

Statement A : Collection is a Interface

Statement B : Collections is a class

a)

Statement A is true

b)

Statement B is true

c)

Both Statements are true

d)

Both Statements are false

29.

Which kind of loop would be used?


I need a guessing game program that will let me keep guessing until I get the right answer.

a)

FOR Loop

b)

WHILE Loop

30.

Evaluate the following Java expression, if x=3, y=5, and z=10:

++z + y - y + z + x++

a)

24

b)

23

c)

20

d)

25

31.

Which of the following is a type of polymorphism in Java?

a)

Compile time polymorphism

b)

Execution time polymorphism

c)

Multiple polymorphism

d)

Multilevel polymorphism

32.

What is the extension of compiled java classes?

a)

.java

b)

.class

c)

.txt

d)

.js

33.

What's the value of below?


int i=5;

System.out.println(i++);

System.out.println(i);

System.out.println(++i);

a)

5

6

7

b)

6

6

7

c)

6

7

8

d)

5

5

6

34.

Which SQL function is used to count the number of rows in a SQL query?

a)

COUNT()

b)

NUMBER()

c)

SUM()

d)

COUNT(*)

35.

If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default

a)

ASC

b)

DESC

c)

There is no default value

d)

None of the mentioned

36.

With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?

a)

SELECT * FROM Persons WHERE FirstName=’a’

b)

SELECT * FROM Persons WHERE FirstName LIKE ‘a%’

c)

SELECT * FROM Persons WHERE FirstName LIKE ‘%a’

d)

SELECT * FROM Persons WHERE FirstName=’%a%’

37.

What does the ALTER TABLE clause do?

a)

The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints

b)

The SQL ALTER TABLE clause is used to insert data into database table

c)

THE SQL ALTER TABLE deletes data from database table

d)

The SQL ALTER TABLE clause is used to delete a database table

38.

SQL query to find all the cities whose humidity is 95.

a)

SELECT city WHERE humidity = 95

b)

SELECT city FROM weather WHERE humidity = 95

c)

SELECT humidity = 89 FROM weather

d)

SELECT city FROM weather

39.

SQL query to find the temperature in increasing order of all cities.

a)

SELECT city FROM weather ORDER BY temperature

b)

SELECT city, temperature FROM weather

c)

SELECT city, temperature FROM weather ORDER BY temperature

d)

SELECT city, temperature FROM weather ORDER BY city

40.

Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.

a)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70

b)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70

c)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70

d)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70