HCL Question Paper : November 2014 Set : 3

share facebook

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



]]>
Q.Akshay has a Heap of 15 elements. He stores this Heap as an Array Arr. The starting index of Arr is 1. Which subarray of this Array stores the leaves
of the Heap?

Question
i) Arr[8..15]
ii) Arr[7..15]
iii) Arr[10..15]
iv) Data Insufficient



Passage:
Shalini wants to program to print the largest number out of three inputted numbers. She
writes the following program:
int number1, number 2, number3, temp;
input number1, number2, number3;
if (number1>number2)
temp = number1
else
temp = number2
end if
if (??) // Statement 1
temp = number3
end if
print temp
Fill in the ?? in Statement 1
Question
i) number3 > number2
ii) number3 > temp
iii) number3 < temp
iv) number3 > number1

Which of the following accessibility modes can be the specifier of a top level class?
1. Private
2. Protected
3. Public
4. No modifier

Options:

i) Only 3
ii) Only 4
iii) Both 1 and 3
iv) Both 2 and 3
v) Both 3 and 4

Which of the following accessibility modes can be the specifier of a top level class?
1. Private
2. Protected
3. Public
4. No modifier

Options
i) Only 3
ii) Only 4
iii) Both 1 and 3
iv) Both 2 and 3
v) Both 3 and 4

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
i) The code will not compile.
ii) The code will give an error while in execution
iii) The code may work for some inputs and not for others.
iv) It will create no problems.

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
i) Linear Search
ii) Binary search
iii)Hash Coded Search
iv) None of these

Passage:
A sorting algorithm traverses through a list, comparing adjacent elements and
switching them under certain conditions. What is this sorting algorithm called? Question
Insertion Sort
Heap Sort
Quick Sort
Bubble Sort



Raj has a list of n numbers each of a fixed size k. He sorts them using radix sort technique. Which of the following options gives the complexity of this
operation?

Question
O(n-k)
O(nk)
O(k log n)
k O(log n)



Computer Programming 00:18:53
Passage:
While calculating time complexity of an algorithm, the designer concerns
himself/herself primarily with the run time and not the compile time. Why?

Question
Run time is always more than compile time.
Compile time is always more than run time.
Compile time is a function of run time.
A program needs to be compiled once but can be run several times.



Passage:
What is space complexity of a program?
Question
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

Passage:
Which one of the following is the lowest level format to which the computer converts a
higher language program before execution?

Question
English code
Machine Code
Assembly Language
System Language



Passage:
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?
Question
Use for loops
Use functions
Use arrays
Use classes



Share on Google Plus
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment