HCL Question Paper : November 2014 Set : 5

share facebook

Enter Your Email below to get Daily Job Alert in Your Mailbox

Linked List
Both Array and Linked List
Merge Sort can be implemented using constant space irrespective of the implementing data structure
Merge Sort requires O(n) space when implemented using __________ .
Fill in the blank

For solving a problem, which of these is the first step in developing a working program
for it?

Writing the program in the programming language
Writing a step-by-step algorithm to solve the problem.
Compiling the libraries required.
Code debugging

Mary is making a database of animals in a zoo and their properties. The possible
animals are dog, lion and zebra. Each one has as attributes isHerbivorous, colour and
isNocturnal. She uses the object oriented programming paradigm for this. How will she
conceptualize the system?
class: Animal; objects: dog, lion and zebra; data members:
isHerbivorous, colour and isNocturnal
class: Animal; objects: isHerbivorous, colour and isNocturnal; data
members: dog, lion and zebra
classes: dog, lion and zebra; objects: Animal; data members:
isHerbivorous, colour and isNocturnal
None of these

Null function is also known as _________ .
Fill in the blank

Anonymous Function
Generic Function
Void Function
Null Operator

Which of the following options refers to the worst case while sorting elements in a Binary Search tree?

Random elements with last element having the largest value
Data input lies within 0 to 100
Data input is sorted(in order)
First data input element is the lowest and the last one is the largest in value.

Parthiv has included several classes and their objects in his project. Now he wants to use something that will hold all these objects(of different
classes). Which of the following options provides him with the best alternate?

Store them in database
Final Class
Generic Class
Anonymous Class

Zenab and Shashi independently write a program to find the the mass of one mole of
water, which includes mass of hydrogen and oxygen. Zenab defines the variables:
integer hydrogen, oxygen, water // Code A
while Shashi defines the three quantities as:
integer a, b, c // Code B
Which is a better programming practice and why?
Code B is better because variable names are shorter
Code A is better because the variable names are understandable
and non-confusing
Code A will run correctly, while Code B will give an error.
Code B will run correctly, while Code A will give an error.

It is known as variant
Only one data type is used at a time
It holds values of variable sized different data types
The tag field determines which data type is being currently used
Which of the following statements is not true about tagged Union?

How can a call to an overloaded function be ambiguous?
By misspelling the name
There might be two or more functions with the same name
There might be two or more functions with equally appropriate
None of these

Any function can be made and marked as starting point using a language dependent syntax
Two macros can be used. One to hold the name of a function and its working and the other to call the first macro
Any program without a main function shall not do anything but can only produce a blank screen
It is not possible to run a program without a main function in a program
Function main is the starting point of execution of a program. Which of the following options shall help in making an executable program without the
use of main function in the program?

Smriti wants to make a program to print the sum of square of the first 5 whole numbers
(0...4). She writes the following program:
integer i = 0 // statement 1
integer sum = 0 // statement 2
while ( i < 5 ) // statement 3
sum = i*i // statement 4
i = i + 1 // statement 5
print sum // statement 6
Is her program correct? If not, which statement will you modify to correct it?
No error, the program is correct.
Statement 1
Statement 4
statement 6

Consider a binary tree implementation. The root address is stored in the variable root.
Given the address of a node in variable node, its value, right and root child node
address can be accessed using the following statements respectively: node-> value,
node -> right, node-> left. Srikanth writes the following function to do a preorder
traversal of the tree.
function preordertraverse(node)
print node -> value
if (Condition X)
{ preordertraverse(node->left) }
if (Condition Y)
{ preordertraverse(node->right) }
What is condition X and Condition Y?
Condition X: node -> left isnotequal null
Condition Y: node -> right isnotequal null
Condition X: node -> right isnotequal null
Condition Y: node -> left isnotequal null
Condition X: node -> left isequal null
Condition Y: node -> right isequal null
Condition X: node -> right isequal null
Condition Y: node -> left isequal null

Afzal writes a piece of code, where a set of three lines occur around 10 times in
different parts of the program. What programming concept can he use to shorten his
program code length?
Use for loops
Use functions
Use arrays
Use classes

Deep needs to implement a Linked List for his project. He needs to bring out the given operations on the list.
1. Deleting the first element of the list.
2. Inserting a new element as a first element.
3. Deleting the last element of the list.
4. Adding a new element at the end of the list.
If Deep has the access to the pointers to the first and last elements in a Linked List, then which of the given operations that he performs is dependent
on the length of the list?

Only 1
Only 3
Both 1 and 2
Both 3 and 4

What is the term given to the concept of binding an object with its identifier?

Dynamic Binding
Name Binding
Dynamic Dispatching
Name Dispatching

What is space complexity of a program?
Amount of hard-disk space required to store the program
Amount of hard-disk space required to compile the program
Amount of memory required by the program to run
Amount of memory required for the program to compile

Shahaana has a 10,000 line code. She is trying to debug it. She knows there is a
logical error in the first 25 lines of the code. Which of the following options will be an
efficient way of debugging?
Compile the whole code and step into it line by line
Use an interpreter on the first 25 lines.
Compile the whole code and run it
None of these

Which of the following statements is not true in the context of anonymous Union data type?

It is a Union that does not have any name
It is not followed by a declarator
It defines an unnamed object
It defines a data type

Which of the following sorting algorithms yield approximately the same worst-case and
average-case running time behaviour in O (n log n)?

As part of the maintenance work, you are entrusted with the work of rearranging the
library books in a shelf in proper order, at the end of each day. The ideal choice will be Question
Bubble Sort
Insertion Sort
Selection Sort
Heap Sort


Share on Google Plus
    Blogger Comment
    Facebook Comment


Post a Comment