Sie sind auf Seite 1von 11

Innoplexus Consulting Services Pvt. Ltd.

TECHNICAL TEST PAPER

Note: PLEASE DONT WRITE ANYTHING ON THE QUESTION PAPER. USE ANSWER SHEET TO MARK
YOUR ANSWERS.

1) Which of the following are Java keywords? Select the three correct answers.
A. external
B. implement
C. throw
D. void
E. integer
F. private
G. synchronize
H. unsigned

2) Best complexity to find third largest element from an unsorted array is


a. n2
b. n*log n
c. log n
d. n

3) Which of the following function does not give outputs which are linearly separable when all
possible combinations of binary inputs are given
a. AND
b. OR
c. XOR
d. NAND

4) Fifth element of array arr[] can be accessed using


a. arr[5]
b. *(arr+4)
c. arr[4]
d. *(arr+5)

Innoplexus Consulting Services Pvt. Ltd.


5) What will be the output?
list = ['a', 'b', 'c', 'd', 'e']
print list[10:]

a.
b.
c.
d.

[]
Index Error: list index out of range
[a, b, c, d, e]
[e]

6) A page is brought into memory only when a location on that page is actually referenced
during execution is
a. Pre paging
b. Thrashing
c. Demand paging
d. Page fault

7) Which is the DDL command:


a. Delete
b. Insert
c. Grant
d. Update

8) When inorder traversing a tree resulted E A C K F H D B G; the preorder traversal would


return
a. FAEKCDBHG
b. FAEKCDHGB
c. EAFKHDCBG
d. FEAKDCHBG

Innoplexus Consulting Services Pvt. Ltd.


9) Predict the output or error(s) for the following:
void main()
{
int const * p=5;
printf("%d",++(*p));
}
a.
b.
c.
d.

6
5
sizeof(p) + 1
compile error

10) Sorting is not possible by using which of the following methods?


a. Insertion
b. Selection
c. Exchange
d. Deletion

11) Predict the output or error(s) for the following:


void main()
{
int i=5;
printf("%d%d%d%d%d%d",i++,i--,++i,--i,i);
}

a.
b.
c.
d.

45545
56655
54554
compile error

12) Does the minimum spanning tree of a graph give the shortest distance between any 2
specified nodes?
a. Yes
b. No

Innoplexus Consulting Services Pvt. Ltd.


13) Predict the output or error(s) for the following:
void main()
#define square(x) x*x
main()
{
int i;
i = 64/square(4);
printf("%d",i);
}
a.
b.
c.
d.

compile error
4
64
syntax error

14) Which of the following are immutable data types in Python?


a. Strings
b. Sets
c. Tuples
d. Numbers

15) Can user-defined object be declared as static data member of another class?
a. Yes
b. No

16) Predict the output:


void main(){
if(printf("cquestionbank"))
printf("I know c");
else
printf("I know c++");
}
a.
b.
c.
d.

I know c
I know c++
cquestionbankI know c
cquestionbankI know c++

Innoplexus Consulting Services Pvt. Ltd.


17) Predict the output or error(s) for the following:
#include <stdio.h>
#define a 10
main()
{
#define a 50
printf("%d",a);
}
a.
b.
c.
d.

10
50
Compile error
initialization error

18) Predict the output or error(s) for the following


#define x 5+2
void main(){
int i;
i=x*x*x;
printf("%d",i);
}
a. 343
b. 27
c. 133
d. Compile error

19) Binary search algorithm cannot be applied to


a. sorted linked list
b. sorted binary trees
c. sorted linear array
d. pointer array

20) Which of these are legal array declarations or definitions? Select the two correct answers.
a. int[] []x[];
b. int *x;
c. int x[5];
d. int[] x = {1,2,3};

Innoplexus Consulting Services Pvt. Ltd.


21) What gets printed when the following program is compiled and run? Select the one correct
answer

class test {

public static void main(String args[]) {


int i;
do {
i++;
}
while(i < 0);
System.out.println(i);
}
}

a.
b.
c.
d.
e.

The program does not compile as i is not initialized.


The program compiles but does not run.
The program compiles and runs but does not print anything.
The program prints 0.
The program prints 1.

22) What gets printed when the following program is compiled and run. Select the one correct
answer.

public class incr {


public static void main(String args[]) {
int i , j;
i = j = 3;
int n = 2 * ++i;
int m = 2 * j++;
System.out.println(i + " " + j + " " + n + " " + m);

Innoplexus Consulting Services Pvt. Ltd.


}
}

1.
2.
3.
4.
5.
6.

4486
4488
4466
4386
4388
4468

23) What is the result of compiling and running the following program. Select the one correct
answer.

class test {
public static void main(String args[]) {
char ch;
String test2 = "abcd";
String test = new String("abcd");
if(test.equals(test2)) {
if(test == test2)
ch = test.charAt(0);
else
ch = test.charAt(1);
}
else {
if(test == test2)
ch = test.charAt(2);
else
ch = test.charAt(3);
}

Innoplexus Consulting Services Pvt. Ltd.


System.out.println(ch);
}
}

1.
2.
3.
4.

'a'
'b'
'c'
'd'

24) What is the result of compiling and running the following program. Select the one correct
answer.

class test {
public static void main(String args[]) {
int[] arr = {1,2,3,4};
call_array(arr[0], arr);
System.out.println(arr[0] + "," + arr[1]);
}
static void call_array(int i, int arr[]) {
arr[i] = 6;
i = 5;
}
}

a.
b.
c.
d.

1,2
5,2
1,6
5,6

Innoplexus Consulting Services Pvt. Ltd.


25) What happens when the following program is compiled and then the command "java check
it out" is executed. Select the one correct answer.

class check {
public static void main(String args[]) {
System.out.println(args[args.length-2]);
}
}

a. The program does not compile.


b. The program compiles but generates ArrayIndexOutOfBoundsException
exception.
c. The program prints java
d. The program prints check
e. The program prints it
f. The program prints out

26) Select the one most appropriate answer. What is the purpose of method parseInt defined in
Integer class.
a. The method converts an integer to a String.
b. The method is used to convert String to an integer, assuming that the String
represents an integer.
c. The method is used to convert String to Integer class, assuming that the
String represents an integer.
d. The method converts the Integer object to a String.

27) What should be done to invoke the run() method on a thread for an object derived from the
Thread class. Select the one correct answer.
a. The run() method should be directly invoked on the Object.
b. The start() method should be directly invoked on the Object.
c. The init() method should be directly invoked on the Object.
d. The creation of the object using the new operator would create a new
thread and invoke its run() method.

Innoplexus Consulting Services Pvt. Ltd.


28) What is the default priority of a newly created thread.
a. MIN_PRIORITY (which is defined as 1 in the Thread class.)
b. NORM_PRIORITY (which is defined as 5 in the Thread class.)
c. MAX_PRIORITY (which is defined as 10 in the Thread class.)
d. A thread inherits the priority of its parent thread.

29) What gets printed when the following program is compiled and run? Select the one correct
answer.

class test {
static boolean check;
public static void main(String args[]) {
int i;
if(check == true)
i=1;
else
i=2;

if(i=2) i=i+2;
else i = i + 4;
System.out.println(i);
}
}

a.
b.
c.
d.
e.

3
4
5
6
The program does not compile because of the statement if(i=2)

Innoplexus Consulting Services Pvt. Ltd.


30) Given the following declarations, which of the assignments given in the options below would
compile. Select the two correct answers.

int i = 5;
boolean t = true;
float f = 2.3F;
double d = 2.3;

a. t = (boolean) i;
b. f = d;
1. d = i;
c. i = 5;
d. f = 2.8;

Das könnte Ihnen auch gefallen