ANALYST-CUM-PROGRAMMER- PAGE 2
ANALYST-CUM-PROGRAMMER- PAGE 2 MCQs
1:-The time complexity of building a heap with 'n' elements is
A:-O(n) B:-O(log n) C:-`O(n^2)` D:-O(n log n)
Ans: A
2:-Which of the following is false regarding AVL trees?
A:-AVL tree is more balanced than binary search tree B:-AVL tree is more space efficient than binary search tree
C:-AVL tree is more time efficient than binary search tree D:-None of the above
Ans: B
3:-What is the worst case complexity of quicksort?
A:-O(n log n) B:-O(n) C:-`O(n^2)` D:-O(log n)
Ans: C
4:-Which data structure can be used to efficiently implement dijkstra's algorithm?
A:-Double ended queue B:-Priority queue C:-Stack D:-Binary search tree
Ans: B
5:-Which data structure is well suited for separate chaining?
A:-Singly linked list B:-Doubly linked list C:-Circular linked list D:-Binary trees
Ans: B
6:-In the following code, how many times the program will print "Hello"?
#include<stdio.h>
int main()
{
printf("Hello");
main();
return 0;
}
A:-Infinite times B:-32767 times
C:-65535 times D:-till stack overflows
Ans: D
7:-What will be output if you will compile and execute the following c code?
#include "string.h"
void main()
{
printf("%d%d",sizeof("program"),strlen("program"));
getch();
}
A:-8 7
B:-7 8
C:-8 8
D:-7 7
Ans: A
8:-Predict the outputs of following C program.
int main()
{
int x = -20;
while (x++ !=1);
printf("%d", x);
return 0;
}
A:-2
B:-1
C:--1
D:-infinite
Ans: A
9:-What is the return type of malloc()?
A:-void* B:-pointer of allocated memory type
C:-void** D:-int*
Ans: A
10:-What does the following declaration mean? int (*ptr)[20];
A:-ptr is array of pointers to 20 integers B:-ptr is a pointer to an array of 20 integers
C:-ptr is an array of 20 integers D:-None of these
Ans: B
11:-If class C is derived from another class B which is derived from class A, which class will have minimum level of abstraction?
A:-Class A B:-Class B C:-Class C D:-All have same level of abstraction
Ans: C
12:-Which of the following statement is false?
A:-An abstract class is a class which cannot be instantiated
B:-Creation of an object is not possible with abstract class but it can be inherited
C:-An abstract class can contain only Abstract method
D:-None of these
Ans: D
13:-Which is the necessary condition for virtual function to achieve late binding?
A:-Virtual function is to be accessed with direct name B:-Virtual functions is to be accessed using base class object only
C:-Virtual function is to be accessed using pointer or reference D:-Virtual function is to be accessed using derived class object only Ans: C
14:-Operator overloading is
A:-Making c++ operator works with objects B:-Giving new meaning to existing operator
C:-Adding operation to the existing operators D:-All the above
Ans: C
15:-What are all the operators that cannot be overloaded?
A:-Scope Resolution (::) B:-Member Selection (.)
C:-New operator (new) D:-Both 1 and 2
Ans: D
16:-Which two of the following methods are defined in class Thread?
A:-Start and wait B:-Start and run C:-Wait and notify D:-Start Only
Ans: B
17:-Which of these class object cannot be used to form a dynamic array in JAVA?
A:-ArrayList B:-Map C:-Vector D:-ArrayList and Vector
Ans: B
18:-Predict the output of the following code
public class Check
{
public static void main(String args[])
{
String s1 = "test";
String s2 = new String(s1);
System.out.println(s1==s2);
}
}
A:-true B:-false
C:-0 D:-test
Ans: B
19:-In java applet programs, the applet life cycle functions are called in which order?
A:-start(), init(), paint(), destroy(), stop() B:-init(), run(), start(), stop(), destroy()
C:-init(), start(), paint(), stop(), destroy() D:-start(), run(), paint(), destroy(), stop()
Ans: C
20:-The three notion of java virtual machine are
A:-class, object, variable B:-specification, implementation, instance
C:-primitive, referential, user defined D:-byte code, object code, executable
Ans: B
21:-Collection of entities that have the same attributes are called
A:-Domain B:-Value set C:-Entity set D:-Entity type
Ans: D
22:-Let X = {2, 3, 6, 12, 24, 48}, and ≤ be the partial order defined by X ≤ Y if X divides Y. Number of edges in the Hasse diagram of (X, ≤) is A:-4 B:-6 C:-5 D:-8
Ans: C
23:-A box contains 8 red and 6 yellow balls. The probability of drawing two balls of the same colour is
A:-42/98 B:-43/95 C:-43/91 D:-None of the above
Ans: C
24:-A die is tossed. If the number is odd, what is the probability that the number is prime?
A:-1/3 B:-2/3 C:-4/3 D:-3/4
Ans: B
25:-Let `P(K)=1+3+5....+(2K-1)=3+K^2` . Then which of the following is true?
A:-Principle of mathematical induction can be used to prove the formula
B:-P(1) is correct
C:-P(k) implies P(k+1)
D:-None of the above
Ans: C
26:-Three bags P, Q and R contains 20%, 40% and 40% of the total eggs produced in an industry. Past experience shows that 5%, 4% and 2% of the eggs contained in the respective bags are defective. If an egg was found to be defective, what is the the probability that the egg was from the bag P?
A:-10/36 B:-8/36 C:-10/34 D:-4/35
Ans: C
27:-For the set {1, 2, 3, 4}, which of the following is true for the relation R = {(1,3), (1,4), (2,3),(2,4), (3,1), (4,1), (4,2), (3,4), (3,2)}
A:-R is symmetric B:-R is transitive C:-R is antisymmetric D:-None of the above
Ans: D
28:-A correlation coefficient of 1 means that
A:-For every positive increase in one variable, there is a positive increase in a fixed proportion of the other variable
B:-For every positive increase in one variable, there is a negative decrease in a fixed proportion of the other variable
C:-For every positive increase in one variable, there is no change in a fixed proportion of the other variable
D:-There is no relation between the variables
Ans: A
29:-Multiple regression is used
A:-To predict scores on an independent variable from scores on multiple dependent variables
B:-To predict scores on an dependent variable from scores on multiple dependent variables
C:-To predict scores on an dependent variable from scores on multiple independent variables
D:-To predict scores on an independent variable from scores on multiple independent variables
Ans: C
30:-Which of the following is not true when conducting multiple regression?
A:-Data must be free from outliers for a multiple regression B:-Data must be heterogeneous for a multiple regression
C:-Multiple regression can be used to access linear relationships D:-Data must be normally distributed for multiple regression
Ans: B
31:-As compared to TTL, CMOS logic has
A:-Higher speed of operation B:-Higher power dissipation
C:-Smaller physical size D:-All of the above
Ans: C
32:-Pin 21 of 8086 microprocessor is used for the signal
A:-READY B:-ALE C:-RESET D:-QS1
Ans: C
33:-The Banker's algorithm is used
A:-To prevent deadlock in operating systems B:-To detect deadlock in operating systems
C:-To avoid deadlock in operating systems D:-All of the above
Ans: C
34:-The performance of a digital computer improves when its RAM size increases. This is because
A:-Size of virtual memory increases B:-Number of page faults are less
C:-Larger RAMS are very faster D:-Number of segment faults are less
Ans: B
35:-Multiplier Quotient register is placed in
A:-Main Memory B:-CPU
C:-I/O Equipment D:-None of these
Ans: B
36:-Which of the following is/are not true in contiguous allocation of disk space
A:-Size of the file is to be declared in advance B:-There is no external fragmentation
C:-Difficulty in finding space for a new file D:-Both 2 and 3
Ans: B
37:-Interrupt latency for real time OS should be
A:-Maximum B:-Zero C:-Minimal D:-None of the above
Ans: C
38:-Which of the following is an invalid shell variables?
A:-india_15 B:-_15_india C:-15_india D:-Both 2 and 3
Ans: C
39:-The output of the following shell programming is var_1 = good Readonly var_1 var_1= morning echo $var_1 exit 0
A:-good B:-morning C:-program will generate an error message D:-none of the above
Ans: A
A:-O(n) B:-O(log n) C:-`O(n^2)` D:-O(n log n)
Ans: A
2:-Which of the following is false regarding AVL trees?
A:-AVL tree is more balanced than binary search tree B:-AVL tree is more space efficient than binary search tree
C:-AVL tree is more time efficient than binary search tree D:-None of the above
Ans: B
3:-What is the worst case complexity of quicksort?
A:-O(n log n) B:-O(n) C:-`O(n^2)` D:-O(log n)
Ans: C
4:-Which data structure can be used to efficiently implement dijkstra's algorithm?
A:-Double ended queue B:-Priority queue C:-Stack D:-Binary search tree
Ans: B
5:-Which data structure is well suited for separate chaining?
A:-Singly linked list B:-Doubly linked list C:-Circular linked list D:-Binary trees
Ans: B
6:-In the following code, how many times the program will print "Hello"?
#include<stdio.h>
int main()
{
printf("Hello");
main();
return 0;
}
A:-Infinite times B:-32767 times
C:-65535 times D:-till stack overflows
Ans: D
7:-What will be output if you will compile and execute the following c code?
#include "string.h"
void main()
{
printf("%d%d",sizeof("program"),strlen("program"));
getch();
}
A:-8 7
B:-7 8
C:-8 8
D:-7 7
Ans: A
8:-Predict the outputs of following C program.
int main()
{
int x = -20;
while (x++ !=1);
printf("%d", x);
return 0;
}
A:-2
B:-1
C:--1
D:-infinite
Ans: A
9:-What is the return type of malloc()?
A:-void* B:-pointer of allocated memory type
C:-void** D:-int*
Ans: A
10:-What does the following declaration mean? int (*ptr)[20];
A:-ptr is array of pointers to 20 integers B:-ptr is a pointer to an array of 20 integers
C:-ptr is an array of 20 integers D:-None of these
Ans: B
11:-If class C is derived from another class B which is derived from class A, which class will have minimum level of abstraction?
A:-Class A B:-Class B C:-Class C D:-All have same level of abstraction
Ans: C
12:-Which of the following statement is false?
A:-An abstract class is a class which cannot be instantiated
B:-Creation of an object is not possible with abstract class but it can be inherited
C:-An abstract class can contain only Abstract method
D:-None of these
Ans: D
13:-Which is the necessary condition for virtual function to achieve late binding?
A:-Virtual function is to be accessed with direct name B:-Virtual functions is to be accessed using base class object only
C:-Virtual function is to be accessed using pointer or reference D:-Virtual function is to be accessed using derived class object only Ans: C
14:-Operator overloading is
A:-Making c++ operator works with objects B:-Giving new meaning to existing operator
C:-Adding operation to the existing operators D:-All the above
Ans: C
15:-What are all the operators that cannot be overloaded?
A:-Scope Resolution (::) B:-Member Selection (.)
C:-New operator (new) D:-Both 1 and 2
Ans: D
16:-Which two of the following methods are defined in class Thread?
A:-Start and wait B:-Start and run C:-Wait and notify D:-Start Only
Ans: B
17:-Which of these class object cannot be used to form a dynamic array in JAVA?
A:-ArrayList B:-Map C:-Vector D:-ArrayList and Vector
Ans: B
18:-Predict the output of the following code
public class Check
{
public static void main(String args[])
{
String s1 = "test";
String s2 = new String(s1);
System.out.println(s1==s2);
}
}
A:-true B:-false
C:-0 D:-test
Ans: B
19:-In java applet programs, the applet life cycle functions are called in which order?
A:-start(), init(), paint(), destroy(), stop() B:-init(), run(), start(), stop(), destroy()
C:-init(), start(), paint(), stop(), destroy() D:-start(), run(), paint(), destroy(), stop()
Ans: C
20:-The three notion of java virtual machine are
A:-class, object, variable B:-specification, implementation, instance
C:-primitive, referential, user defined D:-byte code, object code, executable
Ans: B
21:-Collection of entities that have the same attributes are called
A:-Domain B:-Value set C:-Entity set D:-Entity type
Ans: D
22:-Let X = {2, 3, 6, 12, 24, 48}, and ≤ be the partial order defined by X ≤ Y if X divides Y. Number of edges in the Hasse diagram of (X, ≤) is A:-4 B:-6 C:-5 D:-8
Ans: C
23:-A box contains 8 red and 6 yellow balls. The probability of drawing two balls of the same colour is
A:-42/98 B:-43/95 C:-43/91 D:-None of the above
Ans: C
24:-A die is tossed. If the number is odd, what is the probability that the number is prime?
A:-1/3 B:-2/3 C:-4/3 D:-3/4
Ans: B
25:-Let `P(K)=1+3+5....+(2K-1)=3+K^2` . Then which of the following is true?
A:-Principle of mathematical induction can be used to prove the formula
B:-P(1) is correct
C:-P(k) implies P(k+1)
D:-None of the above
Ans: C
26:-Three bags P, Q and R contains 20%, 40% and 40% of the total eggs produced in an industry. Past experience shows that 5%, 4% and 2% of the eggs contained in the respective bags are defective. If an egg was found to be defective, what is the the probability that the egg was from the bag P?
A:-10/36 B:-8/36 C:-10/34 D:-4/35
Ans: C
27:-For the set {1, 2, 3, 4}, which of the following is true for the relation R = {(1,3), (1,4), (2,3),(2,4), (3,1), (4,1), (4,2), (3,4), (3,2)}
A:-R is symmetric B:-R is transitive C:-R is antisymmetric D:-None of the above
Ans: D
28:-A correlation coefficient of 1 means that
A:-For every positive increase in one variable, there is a positive increase in a fixed proportion of the other variable
B:-For every positive increase in one variable, there is a negative decrease in a fixed proportion of the other variable
C:-For every positive increase in one variable, there is no change in a fixed proportion of the other variable
D:-There is no relation between the variables
Ans: A
29:-Multiple regression is used
A:-To predict scores on an independent variable from scores on multiple dependent variables
B:-To predict scores on an dependent variable from scores on multiple dependent variables
C:-To predict scores on an dependent variable from scores on multiple independent variables
D:-To predict scores on an independent variable from scores on multiple independent variables
Ans: C
30:-Which of the following is not true when conducting multiple regression?
A:-Data must be free from outliers for a multiple regression B:-Data must be heterogeneous for a multiple regression
C:-Multiple regression can be used to access linear relationships D:-Data must be normally distributed for multiple regression
Ans: B
31:-As compared to TTL, CMOS logic has
A:-Higher speed of operation B:-Higher power dissipation
C:-Smaller physical size D:-All of the above
Ans: C
32:-Pin 21 of 8086 microprocessor is used for the signal
A:-READY B:-ALE C:-RESET D:-QS1
Ans: C
33:-The Banker's algorithm is used
A:-To prevent deadlock in operating systems B:-To detect deadlock in operating systems
C:-To avoid deadlock in operating systems D:-All of the above
Ans: C
34:-The performance of a digital computer improves when its RAM size increases. This is because
A:-Size of virtual memory increases B:-Number of page faults are less
C:-Larger RAMS are very faster D:-Number of segment faults are less
Ans: B
35:-Multiplier Quotient register is placed in
A:-Main Memory B:-CPU
C:-I/O Equipment D:-None of these
Ans: B
36:-Which of the following is/are not true in contiguous allocation of disk space
A:-Size of the file is to be declared in advance B:-There is no external fragmentation
C:-Difficulty in finding space for a new file D:-Both 2 and 3
Ans: B
37:-Interrupt latency for real time OS should be
A:-Maximum B:-Zero C:-Minimal D:-None of the above
Ans: C
38:-Which of the following is an invalid shell variables?
A:-india_15 B:-_15_india C:-15_india D:-Both 2 and 3
Ans: C
39:-The output of the following shell programming is var_1 = good Readonly var_1 var_1= morning echo $var_1 exit 0
A:-good B:-morning C:-program will generate an error message D:-none of the above
Ans: A