wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

(Early Placement Assessment)JAVA, DBMS, DATA STRUCURE SET A

Total questions: 60

Worksheet time: 3600secs

Name
Class
Date
1.

Which of these allows you to read elements in the order you have inserted ?

1. LinkedList

2. ArrayList

3. LinkedHashSet

a)

1 2 3

b)

1 2

c)

1

d)

2

2.

Predict the output

List<Integer> list = new ArrayList<Integer>();

list.add(10);

list.add("10");

System.out.println(list);

a)

Prints

[10,10]

b)

Prints

[10]

c)

Compile time error : cannot add String data

d)

Runtime Error : Cannot add String data

3.

Fill the Code:

Map<Integer,String> map=new HashMap<Integer,String>();

map.put(1,"One");

map.put(4,"Four");

map.put(2,"Two"); Set<Map.Entry<Integer,String>> set=map.______________

a)

iterator()

b)

setEntry()

c)

enterySet()

d)

enteries()

4.
Which one of the following interfaces implementation accepts only unique elements?
a)
Set
b)
Array
c)
List
d)
Map
5.

Which one of the following classes implements Set interface and maintains the insertion order of elements?

a)

HashSet

b)

TreeSet

c)

LinkedHashSet

d)

None of the above

6.

Predict the output :

a)

ArrayIndexOutOfBoundsException

b)

null

c)

0

d)

1

7.

Which of the following is NOT used while writing main() function in Java?

a)

public

b)

static

c)

void

d)

private

8.

class Demo

{

class_body;

main() function body;

}

By which name above program should be saved?

a)

Demo.java

b)

Demo.class

c)

class.Demo

d)

java.Demo

9.

Which is a correct way of compiling Demo.java program?

a)

javac Demo.java

b)

java Demo.java

c)

java Demo

d)

javac Demo

10.

Identify the CORRECT parent class of Exception

a)

Package Lang

b)

Package Util

c)

Class Throwable

d)

Class Error

11.

Choose the CORRECT mechanism of exception handling.

a)

try block --> catch block --> finally block

b)

try block --> catch block --> throws exception

c)

try block --> catch block --> finally --> throws exception

d)

try block --> throws exception--> catch block --> finally block

12.

Identify in which block should handling statements are written for any exception caught?

a)

try

b)

catch

c)

Throws

d)

throws

13.

Identify the CORRECT need of Exception handling

a)

It allows multiple users and requests can be served at the very same time.

b)

It helps and report early exceptional happen thus necessary action can be taken.

c)

It avoid system crashes and abnormal program termination

d)

It allows the same method name to be used but carry out different task implementation.

14.

Occurs when you try to convert a string, which is not in the form of a number into numeric.


Identify the type of Exceptions for the above description.

a)

ArithmeticException

b)

ArrayIndexOutOfBoundsException

c)

NumberFormatException

d)

StringBufferException

15.

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

16.

Exception classes belongs to following package

a)

import java.io.*

b)

import java.lang.*

c)

import java.util.*

d)

import java.lang.Exception.*

17.

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

18.

Which of this keyword must be used to inherit a class?

a)

super

b)

this

c)

extend

d)

extends

19.

Which of the following OOP concept binds the code and data together and keeps them secure from the outside world?

a)
  1. Polymorphism

b)
  1. Inheritance

c)
  1. Abstraction

d)
  1. Encapsulation

20.

The total number of elements in the array is called...............

a)

index

b)

length

c)

subscript

d)

memory

21.

Select DDL commands from among the options...

a)

SELECT

b)

ALTER

c)

DROP

d)

DELETE

22.

Choose the correct query

a)

SELECT * FROM EMP WHERE NAME=NULL

b)

SELECT * FROM EMP WHERE NAME IS NULL;

c)

SELECT FROM EMP WHERE NAME IS NULL;

d)

SELECT *FROM EMP WHERE NAME IS 'NULL';

23.

Which is the correct query to delete the rows of employees whose exp is less than 10.

a)

DELETE * FROM EMP WHERE EXP<10;

b)

DELETE FROM EMP;

c)

DELETE FROM EMP WHERE EXP<10;

d)

DELETE FROM EMP WHERE EXP>10;

24.

Which is not an aggregate function?

a)

SUM()

b)

POW()

c)

AVG()

d)

COUNT()

25.

CREATE TABLE employee (id INTEGER,name VARCHAR(20),salary NOT NULL);

INSERT INTO employee VALUES (1005,Rach,0);

INSERT INTO employee VALUES (1007,Ross, );

INSERT INTO employee VALUES (1002,Joey,335);


Some of these insert statements will produce an error. Identify the statement.

a)

Insert into employee values (1005,Rach,0);

b)

Insert into employee values (1002,Joey,335);

c)

Insert into employee values (1007,Ross, );

d)

None of the mentioned

26.

What does DML stand for?

a)

Data Manipulation Language

b)

Data Modeling Language

c)

Data Markup Language

d)

Data Migration Language

27.

Which of the following can add a row to a table?

a)

Add

b)

Insert

c)

Update

d)

Alter

28.

The _________ statement is used to delete a table.

a)

DROP TABLE

b)

DELETE TABLE

c)

DEL TABLE

d)

REMOVE TABLE

29.

Which one of the following sorts rows in SQL?

a)

SORT BY

b)

ALIGN BY

c)

GROUP BY

d)

ORDER BY

30.

Which SQL statement is used to return only different values?

a)

SELECT DISTINCT

b)

SELECT UNIQUE

c)

SELECT DIFF

d)

SELECT DIFFERENT

31.

In a LIKE clause, you can ask for any 6 letter value by writing

a)

LIKE ______ (that's six underscore characters)

b)

LIKE ...... (that's six dots)

c)

LIKE .{6}

d)

LIKE ??????

32.

Which SQL statement is used to update data in a database?

a)

MODIFY

b)

ALTER

c)

SAVE

d)

UPDATE

33.

The SQL keyword BETWEEN is used:

a)

For ranges.

b)

To limit the columns displayed.

c)

As a wildcard.

d)

None of the above

34.

Write a query to display first_name and last_name of all employees who have their first_name starting with 'A'.

a)

Select first_name from employess where first_name LIKE '%A';

b)

Select first_name from employess where first_name LIKE "'A'%";

c)

Select first_name from employess where first_name LIKE 'A%';

d)

Select first_name from employess where first_name LIKE '%A%';

35.

Correct command to create database school

a)

use school ;

b)

make database school ;

c)

create school;

d)

Create database school;

36.

Which of the following is not a DML command?

a)

Update

b)

Insert into

c)

Delete

d)

Create Table

37.

Which operator performs pattern matching?

a)

Between Operator

b)

Like Operator

c)

Exists Operator

d)

None of these

38.

If you were wanting to filter data, which clause would you use?

a)

Where

b)

Order by

c)

From

d)

Select

39.

To remove a record from a table which SQL statement would you use?

a)

Remove

b)

Cancel

c)

Delete

d)

Eradicate

40.

Which word is missing from the following SQL statement?


Select * table_name

a)

With

b)

Where

c)

From

d)

And

41.

What is the correct order of clauses in a SQL statement?

a)

SELECT, FROM, ORDER BY, WHERE

b)

SELECT, FROM, WHERE, ORDER BY

c)

SELECT, WHERE, FROM, ORDER BY

d)

WHERE, FROM, SELECT, ORDER BY

42.

How would you display Chairs in the Items table that have a Price greater than £50.

a)

SELECT * FROM Items WHERE Type = 'Chair' AND Price > 50

b)

SELECT * FROM Items WHERE Type = 'Chair' OR Price < 100

c)

SELECT * FROM Iterms WHERE Type = 'Chair' AND Price >= 50

d)

SELECT * FROM Items WHERE Price > 50

43.

____________data structures are those whose sizes and structures associated memory locations are fixed at compile time.

a)

linear

b)

homogeneous

c)

static

d)

dynamic

44.

Stack uses __________ data structure as the element that was inserted last is the first one to be taken out.

a)

LIPO

b)

FIFO

c)

LIFO

d)

FIPO

45.

Every stack has a variable _________ associated with it.

a)

TOP

b)

BOT

c)

POT

d)

none of the above

46.

_________ operation adds an element to the top of the stack.

a)

pop

b)

push

c)

peep

d)

all of the above

47.

A function calls itself is called ___________.

a)

queue

b)

recursion

c)

function

d)

none of above

48.

A queue is a _________ data structure in which each element that was inserted first is the first one to be taken out.

a)

FITO

b)

FIFO

c)

FISO

d)

FIVO

49.

The elements in a queue are added at one end called ________.

a)

front

b)

rear

c)

near

d)

none of above

50.

The term push and pop is related to

a)

A. Array

b)

B. List

c)

C. Stack

d)

D. Queue

51.

Which of the following is non-liner data structure?

a)

A. Stack

b)

B. List

c)

C. Graph

d)

D.Array

52.

Minimum number of fields in each node of a doubly linked list is ____

a)

A. 2

b)

B. 3

c)

C. 4

d)

D. 5

53.

The number of edges in a complete graph of n vertices is_______

a)

A. n(n+1)/2

b)

B. n(n-1)/2

c)

C. n2 /2

d)

D. n

54.

Identify the data structure which allows deletions at both ends of the list but insertion at only one end.

a)

A. Input restricted dequeue

b)

B. Output restricted dequeue

c)

C. Circular queue

d)

D. Priority queue

55.

The operation of visiting each element in the list is known as ……

a)

A. Sorting

b)

B. Traversing

c)

C. Merging

d)

D. Inserting

56.


Which of the following is a linear data structure?

a)

A. List

b)

B. AVL Tree

c)

C. Binary Tree

d)

D. Graph

57.

When a pop() operation is called on an empty queue, what is the condition called?

a)

A. Overflow

b)

B. Underflow

c)

C. Syntax error

d)

D. Garbage value

58.

A graph is a collection of nodes, called ...... And line segments called arcs or ...... that connect pair of nodes.

a)

A. vertices, paths

b)

B. vertices, edges

c)

C. graph node, edges

d)

D. edges, vertices

59.

In ........, search start at the beginning of the list and check every element in the list.

a)

A. Binary search

b)

B. Binary Tree search

c)

C. Linear search

d)

D. Exponential search

60.

Three standards ways of traversing a binary tree T with root R .......

a)

A. Prefix, infix, postfix

b)

B. Pre-process, in-process, post-process

c)

C. Pre-traversal, in-traversal, post-traversal

d)

D. Pre-order, in-order, post-order