HCL Question Paper : November 2014 Set : 4

share facebook

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



]]>
Passage:
Consider the following pseudo-code
class rocket
{
private:
integer height, weight
public: // Statement 1
function input( int a, int b)
{
height = a;
weight = b;
}
}
function main ( )
{
rocket rocket1, rocket2
}
What can we infer from this code?
Question
rocket is a class with rocket1 and rocket2 as its objects. height and
weight are attributes of a rocket.
rocket is a class with rocket1 and rocket2 as its attributes. height
and weight are objects of the class rocket.
rocket is a class with rocket1, rocket2, height and weight as its
attributes.
rocket is a class with rocket1, rocket2, height and weight as its
objects.



Computer Programming 00:33:10
Passage:
A destructor may be invoked in which of the following situations?
Question
When the object is created
When the object is assigned value 0.
Only at the end of the code
When the scope of the object is over.



Passage:
Shashi writes a program in C++ and passes it on to Pankaj. Pankaj does some
indentation in some statements of the code. What will this lead to?

Question
Faster Execution
Lower memory requirement
Correction of errors
Better readability

Consider the given queue structure -
__ , __ , __ , __ , A , B
FRONT = 5, REAR = 6.
What will be the values of FRONT and REAR respectively after the following operations?
REMOVE A
ADD C,D

Question
6,8
5,8
5,7
6,6. Items will not be inserted.



Passage:
In an implementation of a linked list, each node contains data and address. Which of
the following could the address field possibly contain? Question
Address of next node in sequence
It's own address
Address of last node
Address of first node

Which of the following options give the English statement for the above?

Question
T(n) grows asymptotically faster than n
T(n) grows asymptotically no faster than n
T(n) grows asymptotically as fast as n
T(n) grows asymptotically slower than n
T(n) = O(n )

Passage:
A queue is implemented as a (singly linked) linked-list. Each node has an element and
pointer to another node. Rear and Front contain the addresses of the rear and front
node respectively. If the condition (rear isequal front) is true and neither is NULL, what
do we infer about the linked list?
Question
It has no elements
It has one element
There is an error
None of these



Passage:
Every element of a data structure has an address and a key associated with it. A search
mechanism deals with two or more values assigned to the same address by using the
key. What is this search mechanism?
Question
Linear Search
Binary search
Hash Coded Search
None of these

What will be the input to the second pass, if the list before starting the Radix Sort is: 729, 150, 123, 931, 348, 517?

Question
150, 123, 348, 517, 729, 931
150, 931, 123, 517, 348, 729
517, 729, 123, 931, 348, 150
123, 150, 348, 517, 729, 931

Passage:
Ravi is writing a program in C++. C++ uses the 'for' keyword for loops. Due to
distraction, Ravi writes 'gor' instead of 'for'. What will this result to?

Question
The code will not compile.
The code will give an error while in execution
The code may work for some inputs and not for others.
It will create no problems.

Passage:
The algorithm design technique used in the quick sort algorithm is
Question
Dynamic Programming
Back Tracking
Divide and Conquer
Greedy Search

Passage:
Consider the following pseudo-code
class brush
{
private:
integer size, colorcode
function getdata( ) { ... }// Statement 1
public:
integer name // Statement 2
function putdata( ) { ... }
}
function main
{
brush b1, b2
print b1.name // Statement 3
b2.getdata( ) //Statement 4
}

Deleting which line will correct the error in the code?
Question
Statement 1
Statement 2
Statement 3
Statement 4

Passage:
How can a call to an overloaded function be ambiguous?
Question
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
signatures
None of these

Passage:
Sharmili wants to make a program to print the sum of all cubes, where the value of the
cubes go from 0 to 100. She writes the following program:
integer i = 0, a // statement 1
integer sum = 0;
a = ( i * i * i )
while ( i < 100 ) // statement 2
{
sum = sum + a // statement 3
i = i + 1
a = ( i * i * i ) // statement 4
}
print sum
Does this program have an error? If yes, which statement will you modify to correct the
program?
Question
Statement 1
Statement 2
Statement 3
Statement 4
No error

Passage:
A stack is implemented as a linear array A[0...N-1]. Noor writes the following functions
for popping an element from the stack.
function POP( top, N )
{
if(X)
{
top = top - 1
}
else
{
print "Underflow"
}



Advertisement

Share on Google Plus
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment