Home / Placement Papers / Genpact / Technical Questions Asked In Genpact

Technical Questions Asked In Genpact

Technical Questions

1.What happens when the following piece of code in file1.c, is compiled and executed?

namespace
{
Class Temp
{
public:
int GetVal()
{
return 100;
}
};
} //end of namespace
int main()
{
Temp oTempObj1; Cout< }

A.Compile Error
B.100
C.Runtime Error
D.Compilation Error

Answer & Explanation

Answer: Option B.

2.Iterators are________________

A.Generalised pointers in STL
B.Container classes in STL
C.Algorithms in STL
D.Special Methods in STL

Answer & Explanation

Answer: Option A.

3.Big O notation is defined for

A.Time and Space Complexity
B.Optimality
C.Searching
D.Sorting

Answer & Explanation

Answer: Option A.

4.The effectiveness of an algorithm is best stated in

A.Best-case Time
B.Average-case Time
C.Worst-Case running time
D.Industry-Standard Time

Answer & Explanation

Answer: Option C.

5.output of following program
#include<stdio.h>
int f1( int );
void main()
{
int b=5;
printf(“%d,%d”, f1(b),f1(b));
}
int f1(int b)
{
static int n=5;
n++;
return n;
}

A.6,6
B.6,7
C.7,6
D.5,6

Answer & Explanation

Answer: Option C.

6.int * ptr=(int *) realloc(NULL,100) is same as

A.int *ptr=(int *) malloc(20)
B.int *ptr=(int *) malloc(50)
C.int *ptr=(int *) calloc(25,4)
D.int *ptr=(int *) calloc(20,4)

Answer & Explanation

Answer: Option C.

Check Also

Genpact Reasoning Questions

Reasoning Questions What should come in place of question mark (?) in the following number/alphabetic …

Leave a Reply

Your email address will not be published. Required fields are marked *