Font size
WorksheetsTest for Top 400
Total questions: 40
Worksheet time: 40mins
In preorder traversal of a binary tree the second step is ____________
traverse the right subtree
traverse the left subtree
traverse right subtree and visit the root
visit the root
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?
3
4
5
6
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?
Circular, singly-linked list.
Circular, doubly-linked list.
Singly-linked list.
Doubly-linked list.
Choose the behaviour of Class: time
Hour
Second
PrintTime
getHour
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?
&
_
%
$
In RDBMS, different classes of relations are created using __________ technique to prevent modification anomalies.
Functional Dependencies
Data integrity
Normal Forms
Referential integrity
The statement that is executed automatically by the system as a side effect of the modification of the database is
trigger
recovery
assertion
backup
Which operation is used to extract specified columns from a table?
Project
join
Substitute
Extract
Relations produced from E - R Model will always be in ________.
2 NF
1 NF
3 NF
BCNF
A function that changes the values of an object's attributes in a Class is also known as a:
string function
setter
getter
changer
When overloading a function, the signature of the function is determined by:
The name of the function
The name of the function and number of argument and types
The return type, name and number of arguments and types.
When a class is derived from a base class it gets access to:
Private
Protected
Private and Protected
Protected and Public
Private, Protected and Public
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?
ABCD
DCBA
DCAB
ABDC
What is a dequeue?
A queue with insert/delete defined for both front and rear ends of the queue
A queue implemented with a doubly linked list
A queue implemented with both singly and doubly linked lists
A queue with insert/delete defined for front side of the queue
What data structure is used for breadth first traversal of a graph?
queue
stack
list
none of the above
Which data structure is needed to convert infix notation to postfix notation?
a) Tree
b) List
c) Stack
d) Queue
What happens if the word static is placed in front of a member function in C++?
The member function can be called even if we do not create an instance of the class.
It places the member function in the static part of memory
It will cause an error and the program will not compile.
None of the above.
What will be the output of the following C code?
True
False
True False
No Output
What will be the output of the following C code?
Hi is printed 9 times
Hi is printed 8 times
Hi is printed 7 times
Hi is printed 6 times
what will be printed after Execution of the following program
void main()
{
int a[5]={11,13,56,20,5};
printf("%d",a[2]);
}
garbage value
13
56
20
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) {1: ‘A’, 2: ‘B’, 3: ‘C’}
b) Method update() doesn’t exist for dictionaries
c) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}
d) {4: ‘D’, 5: ‘E’}
What will be the output of the following Python code snippet?
d = {"john":40, "peter":45}
d["john"]
a) 40
b) 45
c) “john”
d) “peter”
Which of the following classes extends HashMap and maintains the insertion order of the elements?
TreeMap
LinkedHashMap
SortedMap
None of the above
Which of the following is mutable object in Java?
String
StringBuffer
Both A & B
None of the above
Which of the following collection will store the elements in a sorter manner?
Collection
List
Set
SortedSet
Which of these statements are true?
Statement A : Collection is a Interface
Statement B : Collections is a class
Statement A is true
Statement B is true
Both Statements are true
Both Statements are false
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.
FOR Loop
WHILE Loop
Evaluate the following Java expression, if x=3, y=5, and z=10:
++z + y - y + z + x++
24
23
20
25
Which of the following is a type of polymorphism in Java?
Compile time polymorphism
Execution time polymorphism
Multiple polymorphism
Multilevel polymorphism
What is the extension of compiled java classes?
.java
.class
.txt
.js
What's the value of below?
int i=5;
System.out.println(i++);
System.out.println(i);
System.out.println(++i);
5
6
7
6
6
7
6
7
8
5
5
6
Which SQL function is used to count the number of rows in a SQL query?
COUNT()
NUMBER()
SUM()
COUNT(*)
If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default
ASC
DESC
There is no default value
None of the mentioned
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”?
SELECT * FROM Persons WHERE FirstName=’a’
SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
SELECT * FROM Persons WHERE FirstName=’%a%’
What does the ALTER TABLE clause do?
The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints
The SQL ALTER TABLE clause is used to insert data into database table
THE SQL ALTER TABLE deletes data from database table
The SQL ALTER TABLE clause is used to delete a database table
SQL query to find all the cities whose humidity is 95.
SELECT city WHERE humidity = 95
SELECT city FROM weather WHERE humidity = 95
SELECT humidity = 89 FROM weather
SELECT city FROM weather
SQL query to find the temperature in increasing order of all cities.
SELECT city FROM weather ORDER BY temperature
SELECT city, temperature FROM weather
SELECT city, temperature FROM weather ORDER BY temperature
SELECT city, temperature FROM weather ORDER BY city
Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70
