github

Made bySaurav Hathi

TCS - Company Specific Mock Test - Programming - Set 1

Q1:

What is the the worst case time complexity of randomised quick sort?

Tags:
Cyient
NEW_Q
Bosch
mastek
+ 1 more
Section:
Algorithms
Options:
Q2:

Assume that f(n) and g(n) are functions such that:-

f(n) = O(n2)

g(n) = O(n3)

Then f(n) + g(n) will be equal to___________

Tags:
Capgemini1
NEW_Q
CAT2_MC9
MCA_MC1
+ 2 more
Section:
Algorithms
Options:
Q3:

What is an array in C/C++?

Tags:
c++
VVDN_NEAT_PROG
TCS_MC5
IN03
Section:
Core Programming
Options:
Q4:

In java, which of these keywords cannot be used for a class which has been declared final?

Tags:
java
IN02
Section:
Core Programming
Options:
Q5:

What will be the output of this java program?

abstract class A

{

    int i;

    abstract void display();

}   

class B extends A

{

    int j;

    void display()

    {

        System.out.println(j);

    }

}   

class Abstract_demo

{

    public static void main(String args[])

    {

        B obj = new B();

        obj.j=2;

        obj.display();   

    }

}

Tags:
java
Section:
Core Programming
Options:
Q6:

In java, a dynamic array is implemented using which of the standard collections class?

Tags:
Capgemini1
NEW_Q
Section:
Core Programming
Options:
Q7:

Which collection class allows you to grow or shrink its size and provides indexed access to its elements, but whose methods are not synchronized?

Tags:
java
Section:
Core Programming
Options:
Q8:

What is the output of this C code?

#include <stdio.h>

int main()

{

int i = 0;

int x = i++, y = ++i;

printf("%d % d\n", x, y);

return 0;

}

Tags:
c++
ct03
BOS5
Section:
Core Programming
Options:
Q9:

What is the output of this C code?

#include <stdio.h>

int main()

{

int a = 10, b = 10;

if (a = 5)

b--;

printf("a = %d, b = %d", a, b--);

}

Tags:
c++
IN03
BOS3
Section:
Core Programming
Options:
Q10:

Which of the following statements is incorrect about strings in java?

Tags:
java
Section:
Core Programming
Options: