Showing posts with label technical interview questions. Show all posts
Showing posts with label technical interview questions. Show all posts

2 October 2013

Group Discussion Do’s & Dont’s

Group Discussion generally abbreviated as GD’s rounds are the most common one’s that tend to happy in many different interview processes. Many of you appear for the GD’s but do not know exactly about that what to actually do and how to actually face a GD. So to help you better here are some Do’s and Dont’s while you go for a GD.






Do’s For Group Discussion
  • Wearing formals is a must and you should talk politely
  • You can grab a chance to start the GD as well as end it up by summarizing in a proper manner
  • Maintain a proper posture of sitting
  • You can decide whether to speak in favor of or against the topic
  • Try to justify well whatever point you talk on
  • Try to stress out on what you are sure about
  • Give others an opportunity to speak
  • Manage your timings well
  • Share only what is relevant regarding the discussion
Dont’s For Group Discussion
  • Do not ever try to cut the point of your group member
  • Do not lay stress on what you are not sure about
  • Do not take too much of time for a single point
  • Do not try to scream out to justify your point
  • Do not try to give any judgments
  • Do not start an argument as it is a GD not a Debate
  • Do not use gestures like finger pointing or table thumping

27 September 2013

1.Sample C Program To Print Welcome Message.
#include 

int main()
{

printf( "Welcome to C Programming World. \n" );
getchar();
return 0;

}

OUTPUT:

Welcome to C Programming World.

2.Sample C Program To Accept & Display A Number.
#include 
#include 

main()
{

int number;
printf("Enter an integer ");
scanf("%d", &number);
printf("Integer that you have entered is %d",number);
getch();
return 0;

}

OUTPUT:

Enter an integer 9
Integer you have entered is 9
3.Sample C program To Print First Ten Numbers.

#include 
#include 

main()
{ 

int c;
for ( c = 1 ; c <= 10 ; c++ ) printf("%d\n", c); getch(); return 0; } OUTPUT: 1 2 3 4 5 6 7 8 9 10 4.Sample C Program To Find Area & Circumference Of A Circle. #include 
#include 

void main()
{

int r;
float pi=3.14, area, ci;
clrscr();

printf("Enter radius of circle: ");
scanf("%d",&r);

area = pi * r * r;
printf("Area of circle =%f",area);

ci = 2 * pi * r;
printf("Circumference =%f",ci);
getch();

}

OUTPUT:

Enter radius of circle: 5
Area of circle =78.500000 Circumference =31.400002
5.Sample C Program To Swap Two Numbers Using Temporary Variables.
#include 
#include 

main()
{

int x, y, temp;
printf("Enter the value of x and y ");
scanf("%d %d", &x, &y);

printf("Before Swapping\nx = %d\ny = %d\n",x,y);
temp = x;
x = y;
y = temp;

printf("After Swapping\nx = %d\ny = %d\n",x,y);
getch();
return 0;

}

OUTPUT:

Enter the value of x and y 2
4
Before Swapping
x = 2
y = 4
After Swapping
x = 4
y = 2
6.Sample C Program To Swap Two Numbers Without Using Temp Variable.
#include 
main()
{

int a, b;
printf("Enter two numbers to swap ");
scanf("%d %d", &a, &b);

a = a + b;
b = a - b;
a = a - b;

printf("a = %d\nb = %d\n",a,b);
return 0;

}

OUTPUT:

Enter two numbers to swap 2
4
a = 4
b = 2
7.Sample C Program To Find Factorial Of A Number.
#include 
#include 

void main()
{

int n, i, fact=1;
clrscr();
printf(" Enter any no: ");
scanf("%d", &n);

for( i = n; i >= 1; i-- )
{
fact = fact * i;
}
printf(" Factorial =%d",fact);
getch();

}

OUTPUT:

Enter any no: 5
Factorial = 120
8.Sample C Program To Print Fibonacci Series Upto 100.

#include 
#include 

void main()
{

int a = 1, b = 1, c = 0, i;
clrscr();
printf(" %d\t %d\t ", a, b);

for( i = 0; i <= 10; i++) { c = a + b; if(c < 100) { printf("%d\t",c); } a = b; b = c; } getch(); } OUTPUT: 1 1 2 3 5 8 13 21 34 55 89 9.Sample C Program To Calculate Simple Interest. #include 
#include 

void main()

{
int p, r, t, si;
clrscr();

printf(" Enter principle, rate of interest & time to find simple interest: ");
scanf(" %d %d %d",&p, &r, &t);

si = ( p * r * t ) / 100;
printf(" Simple interest = %d",si);
getch();

}

OUTPUT:

Enter principle, rate of interest & time to find simple interest: 1000
2
5
Simple interest = 100
10.Sample C Program To Check Whether A Number Is Prime Or Not.
#include 
#include 

void main()
{

int i, n ,r=0;
clrscr();
printf(" Enter any no: ");
scanf("%d",&n);

for( i = 2; i <= n - 1; i++ ) { if( n % i == 0) r = 1; break; } if( r == 0) printf(" Is prime "); else printf(" Not prime "); getch(); } OUTPUT: Enter any no: 8 Not prime 11.Sample C Program To Find The Greatest Among Three Numbers. #include 
#include 

void main()
{

int a, b, c;
clrscr();
printf(" Enter value of a, b & c: ");
scanf("%d %d %d",&a, &b, &c);

if( ( a>b ) && ( a>c ) )
printf(" a is greatest.");

if( ( b>c ) && ( b>a ) )
printf(" b is greatest.");

if( ( c>a ) && ( c>b ))
printf(" c is greatest.");

getch();

}

OUTPUT:

Enter value of a, b & c: 2
5
10
c is greatest.
12.Sample C Program To Find The Length Of A String.

#include 
#include 
#include 
main()
{

char a[100];
int length;
printf(" Enter a string to calculate it's length ");
gets(a);

length = strlen(a);
printf(" Length of entered string is = %d\n",length);

getch();
return 0;

}

OUTPUT:

Enter a string to calculate it's length: noon
Length of entered string is = 4
13.Sample C Program To Check Whether A Number Is Armstrong Or Not.

#include 
#include 

main()
{

int n, sum = 0, temp, r;

printf( " Enter a number " );
scanf( " %d ", &n);

temp = n;

while( temp != 0 )
{
r = temp % 10;
sum = sum + r * r * r;
temp = temp / 10;
}

if ( n == sum )
printf( " Entered number is an armstrong number. " );
else
printf( " Entered number is not an armstrong number. " );

getch();
return 0;

}

OUTPUT:

Enter a number6
Entered number is not an Armstrong number.

14.Sample C Program To Find The Reverse Of A Number.

#include 
#include 

void main()
{ 

int n, a, r=0;
clrscr();

printf(" Enter any number to get its reverse: ");
scanf("%d",&n);
while(n>=1)
{
a = n % 10;
r = r * 10 + a;
n = n / 10;
}
printf(" Reverse = %d",r);
getch();

}

OUTPUT:

Enter any number to get its reverse: 65
Reverse = 56
15.Sample C Program To Check Whether A String Is Palindrome Or Not.

#include 
#include 
#include 

int main()
{

char a[100], b[100];
printf(" Enter the string to check if it is a palindrome ");

gets(a);
strcpy(b , a);
strrev(b);
if (strcmp(a , b) == 0 )
printf(" Entered string is a palindrome.\n");
else
printf(" Entered string is not a pailndrome.\n");
getch();
return 0;

}

OUTPUT:

Enter the string to check if it is a palindrome: noon
Entered string is a palindrome

100 questions on c++,oops technical interview question for fresher

c++,oops technical interview question for fresher

Question - 1) What is a class ?

Question - 2) What is an object ?

Question - 3) List the advantages of object oriented programming ?

Question - 4) What is meant by 'call by value' ?

Question - 5) What is meant by 'call by reference' ?


Question - 6) What is a reference variable ? What is its use ?

Question - 7) What are inline Functions ? What is the advantage of using them ? How are they declared ?

Question - 8) What are the defining traits of an object-oriented language ?

Question - 9) What is the purpose of the scope resolution operator ?

Question - 10) What are the differences between type casting and automatic type conversion ?


Question - 11) Why ‘char’ is often considered as an integer data type ?

Question - 12) What is the difference between structure and class in C++ ?

Question - 13) What is the purpose of ios:app ?

Question -14) What is the purpose of ios::ate ?

Question - 15) How is random access of data achieved in C++ ?


Question - 16) Which header file is required for creating and manipulating data files in C++ ?

Question - 17) What is an access specifier ?

Question - 18) How is memory allocated to a class and its objects ?

Question - 19) What is the difference between an object and a class ?

Question - 20) Differentiate between data hiding and encapsulation ?


Question - 21) What is polymorphism? Explain with an example ?

Question - 22) What is public, protected and private ?

Question - 23) What is the significance of the protected access specifier ?

Question - 24) Do 'derivation' and 'friendship' mean the same ?

Question - 25) Enlist some advantages of object oriented programming ?


Question - 26) Is prototyping mandatory in C++ ? Why ?

Question - 27) When should a function be made inline ?

Question - 28) How is a static variable different from a static function ?

Question - 29) What is meant by macro ?

Question - 30) What do you mean by inline function?


Question - 31) What is a constructor? Why would I ever use one?

Question - 32) What are destructors really for? Why would I ever use them?

Question - 33) Is a default constructor equivalent to a constructor having default arguments?

Question - 34) Why is a destructor function required in a class?

Question - 35) What is a parameterized constructor?


Question - 36) What is a copy constructor?

Question - 37) What is a default constructor? What is its role?

Question - 38) What is meant by constructor overloading?

Question - 39) What is operator overloading?

Question - 40) What operators can/cannot be overloaded?


Question - 41) How is operator overloading implemented successfully in C++?

Question - 42) What is abstract class?

Question - 43) What is concrete class?

Question - 44) What is function overloading and operator overloading?

Question - 45) What is a ‘friend’ function?


Question - 46) Do ‘friends’ violate encapsulation?

Question - 47) What are some advantages/disadvantages of using friends?

Question - 48) What do you mean by the friend function and friend class?

Question - 49) Why should I use `new' instead of trustworthy old malloc()?

Question - 50) How do I allocate / unallocate an array of things?


Question - 51) What if I forget the `[ ]' when `delete'ing array allocated via `new X[n]'?

Question - 52) What are free store operators?

Question - 53) What do you mean by free storage list or AVAIL list?

Question - 54) What is meant by static memory allocation?

Question - 55) What is dynamic memory allocation?


Question - 56) Define free store ?

Question - 57) What do you mean by a self referential structure?

Question - 58) What is inheritance? What the types of inheritance?

Question - 59) What are the different types of inheritances?

Question - 60) What is the difference between a virtual base class and a normal base class?


Question - 61) What is meant by a visibility mode?

Question - 62) What's the difference between `public:', `private:', and `protected:' visibility modes?

Question - 63) When should you use inheritances?

Question - 64) How do you express `private inheritance'?

Question - 65) What are the access rules with `private' and `protected' inheritance?


Question - 66) What is meant by inheritance hierarchy ?

Question - 67) Differentiate between multiple and multilevel inheritances ?

Question - 68) What is an ABC (`Abstract Base Class') ?

Question - 69) What is a `virtual destructor' ?

Question - 70) What is a dangling pointer or wild pointers ? 


Question - 71) What is abstraction?

Question - 72) How is abstraction and encapsulation interrelated?

Question - 73) What is an adaptor class or Wrapper class?

Question - 74) What is a container class? What are the types of container classes?

Question - 75) What is polymorphism? 


Question - 76) What do you mean by a static data member and a static member function?

Question - 77) What is modularity in C++?

Question - 78) What do you mean by data abstraction?

Question - 79) What is a pointer? How will you define a pointer to an integer and a pointer to a character?

Question - 80) How does a pointer variable differ from a simple variable?


Question - 81) What is a nested structure ?

Question - 82) How are arrays and structures related to each other ?

Question - 83) What is the difference between structure and class?

Question - 84) What is the difference between get and getline member functions ?

Question - 85) Differentiate between ifstream class and ofstream class?


Question - 86) Name the streams generally used for file operations.

Question - 87) What do you mean by ‘this’ pointer?

Question - 88) What is a data structure?

Question - 89) List four major operations associated with linear data structures?

Question - 90) What are trees in C++?


Question - 91) State conditions under which binary search is applicable.

Question - 92) What is a linked list?

Question - 93) Differentiate between functions read() and write().

Question - 94) What is a null pointer?

Question - 95) What is a memory leak?


Question - 96) What is a stack?

Question - 97) What is meant by overflow in C++?

Question - 98) What is an infix expression?

Question - 99) What do you mean by static binding?

Question - 100) What do you mean by a node?