wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Test 04 May

Total questions: 40

Worksheet time: 40mins

Name
Class
Date
1.

What is an exception

a)

Error occurred during the execution of a program

b)

Bug occurred during the compile time of a program

c)

Simply an Error

d)

It is related to input values

2.

Choose an exception if attempt to divide number by zero


int number = 89 / 0;

System.out.println("The answer is " + number);

a)

ArithmeticException

b)

NullPointerException

c)

NumberFormatException

d)

ArrayIndexOutOfBoundException

3.

-Contains no duplicate elements.

-Can contain at most one Null value.

-Elements are not key-value pairs.

-Accessing an element can be almost as fast as performing a similar operation on an array.


Which of these classes provides the specified features?

a)

LinkedList

b)

TreeMap

c)

HashSet

d)

LinkedHashMap

e)

HashMap

4.
a)

{1=C, 2=JavaEE, 4=Python, 3=PHP}

b)

{1=C, 2=JavaSE, 3=Python, 4=PHP}

c)

{1=C, 2=JavaEE, 3=Python, 4=PHP}

d)

{1=C, 2=JavaSE,2=JavaEE, 3=Python, 4=PHP}

e)

NullPointerException

5.
a)

4

b)

5

c)

6

d)

12

6.

 What will be the output of the  Java program?

a)

{0, 1, 3, 4}

b)

{0, 1, 2, 4}

c)

{0, 1, 2, 3, 4}

d)

{0, 0, 0, 3, 4}

7.

Which one of the following statement is not true about the collection interface?

a)

all methods defined in set interface are also defined in collection interface

b)

list interface extends collection interface

c)

set interface extends collection interface

d)

all methods defined in list interface are also defined in collection interface

8.

Choose the correct JavaScript syntax to change the content of the following HTML code.

a)

document.getElement (“WadJava").innerHTML = "I am a WadJava";

b)

document.getElementById (“WadJava").innerHTML = "I am a WadJava";

c)

document.getId (“WadJava") = "I am a WadJava";

d)

document.getElementById (“WadJava").innerHTML = I am a WadJava;

9.

To use the external DTD we have the syntax

a)

<?xml version=”A.0” standalone=”no”?>

<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

b)

<?xml version=”A.0” standalone=”yes”?>

<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

c)

<?xml version=”A.0” standalone=”no”?>

<! DOCTYPE DOCUMENT “order.dtd”?>

d)

<?xml version=”A.0” standalone=”yes”?>

<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

10.

What is the output of the program when accessed to context root URL?

a)

Hellostar

b)

whitelabel error page

c)

Hello***********

d)

None of the above

11.

REST stands for

a)

REpresentational State Transport

b)

Representational Expression State Transfer

c)

REpresentational Style Transfer

d)

REpresentational State Transfer

12.

If the in-order and post-order traversals of a binary tree are given as 2, 3, 4, 5, 6, 7, 8, 9 and 3, 2, 5, 7, 6, 9, 8, 4 respectively, identify the root.

a)

4

b)

5

c)

9

d)

8

13.

If we build a min-heap with the following list of elements

24, 54, 32,76,3, 56, 93, 17, 43, 60. What will be the key at the root?

a)

24

b)

93

c)

3

d)

60

14.

Write the postfix notation of the following infix expression.

A+B*C+(D*E+F)*G

a)

ABC*+DE*F+G*+

b)

AB+C*DE*F+G*+

c)

ABC*+DE*F++G*

d)

AB+C*DE*F++G*

15.

How would a binary heap for an array A = {2,7,26,25,19,17,1,90,3,36} look like?

a)
b)
c)
d)
16.

Consider a circular array based queue ’Q’ that is capable of holding 12 elements. What would the element at index 3 be after execution of the following code snippet on the array? Assume Q is initially empty and its indices run from 0 to 11.

for(i=1; i != 10; i++)

q.enqueue(i);

for(i=1; i != 6; i++)

q.dequeue();

q.enqueue(q.dequeue());

a)

6

b)

5

c)

4

d)

3

17.

The inorder and postorder traversal of a binary tree are ’d b e a f c g’ and ’d e b f g c a’, respectively.

(a) Is the binary tree a complete binary tree?

(b) Identify the root node.

(c) What is the preorder traversal of the binary tree?

a)

(a) No

(b) a

(c) Preorder : a b c d e f g

b)

(a) Yes

(b) a

(c) Preorder : a b d e c f g

c)

(a) Yes

(b) d

(c) Preorder : a b d e c f g

d)

(a) Yes

(b) d

(c) Preorder : a b d e c g f

18.

Which of the following best fits for forward and back buttons in web browsers?

a)

Stack

b)

Queue

c)

Binary Search Tree

d)

None of these

19.

Predict the output of the following C code.

int main(){

char c = 011;

printf("%d",c);

return 0;

}

a)

11

b)

10

c)

9

d)

None of the other.

20.

Consider the following sequence of operations on an empty stack.

push(54); push(52); pop(); push(55); push(70); s=pop(). Consider the following sequence of operations on an empty queue. enqueue(21); enqueue(24);dequeue(); enqueue(28); enqueue(32); q=dequeue(). The value of s + q is

a)

86

b)

68

c)

24

d)

94

21.

If every non-key attribute is functionally dependent on the primary key, then the relation will be in :

a)

1NF

b)

2NF

c)

3NF

d)

4NF

22.

What is returned by SUBSTR(‘TUTORIALS POINT’, 1, 9)

a)

TUTORIAL

b)

POINT

c)

TUTORIALS

d)

UTORIALS

23.

The statement in SQL which allows to change the definition of a table is

a)

Alter

b)

Update

c)

Create

d)

Select

24.

The term "Data" refers to

a)

The electronic representation of the information( or data)

b)

Basic information

c)

Row Facts and figures

d)

Both A and C

25.

SELECT * FROM employee WHERE dept_name="Comp Sci";

In the SQL given above there is an error . Identify the error.

a)

Dept_name

b)

Employee

c)

“Comp Sci”

d)

From

26.

The ______ clause allows us to select only those rows in the result relation of the ____ clause that satisfy a specified predicate.

a)

Where, from

b)

From, select

c)

Select, from

d)

From, where

27.

Which of the following statements contains an error?

a)

Select * from emp where empid = 10003;

b)

Select empid from emp where empid = 10006;

c)

Select empid from emp;

d)

Select empid where empid = 1009 and lastname = ‘GELLER’;

28.

In ordered indices the file containing the records is sequentially ordered, a ___________ is an index whose search key also defines the sequential order of the file.

a)

Clustered index

b)

Structured index

c)

Unstructured index

d)

Nonclustered index

29.

9. Which command is used to permanently save into database?

a)

a) SAVE POINT

b)

b) COMMIT

c)

c) ROLLBACK

d)

d) SET

30.

Which HTTP method is advised to send sensitive information like password and OTP while sending it to the application server ?

a)

GET

b)

POST

c)

DELETE

31.

What will be the output of the “hello” +1+2+3?

a)

a) hello123

b)

b) hello

c)

c) Error

d)

d) hello6

32.

If a=(1,2,3,4), a[1:-1] is _________

a)

a) Error, tuple slicing doesn’t exist

b)

b) [2,3]

c)

c) (2,3,4)

d)

d) (2,3)

33.
Look at this code, what shape will it make?
a)
Square
b)
Triangle
c)
Rectangle
d)
Hexagon 
34.
What is wrong with this code?
a)
Missing Brackets
b)
Missing Comma
c)
Missing Colon
d)
Incorrect spelling 
35.

What will be the output of the following Python code?

x = [[0], [1]]

print((' '.join(list(map(str, x))),))

a)
(['0', '1'],)
b)
(['0'] ['1'],)
c)

01

d)
(['0'] , ['1'],)
36.

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

z=set('abc$de')

'a' in z

a)
error
b)

True

c)

False

d)
null
37.

Which lines are having an error in the shown code

a)

Line 1 and 2

b)

Line 2 and 3

c)

Line 3 and 4

d)

line 5 and 6

38.

What is the output?

a)

more than 7

b)

more than 23

c)

spam

d)

7

39.

The display of web pages in HTML5 starts with the standards created by the W3C. The standards list and describe _______________.

a)

All the available elements

b)

the parameters for how user agents should use available elements

c)

Both A and B

d)

Neither A nor B

40.

How can you open a link in a new browser window?

a)

<a href="url" target="_blank">

b)

<a href="url" target="new">

c)

<a href="url" new>

d)

<a href="url" target="">