Вы находитесь на странице: 1из 8

I did very well in the HR round.

Questions were:

Tell us about your family

What are the faults in our interview process?


Then I was given the opportunity to ask questions to them. It is important to ask work
related questions rather than place of posting and salary.It denotes enthusiasm in the work.

The next question was related to matrix . Suppose u have a nXn matrix and having different
elements then , find out the realtion between minimum of maximum of each row and
maximum of minimum of each column .
1) Design a data structure which contains the behaviour of a bag.
2) Write a method to sort the matrix such that each row should be in increasing
order and each column should be in decreasing order and find the time complexity .
3) Write a dynamic programming solution for travelling sales man problem.
4) Many other questions from bitwise operations .

C++/ Java Interview Questions - Alcatel Lucent


1. What is the output of following function?
type def enum grade{good,bad,worst,}bad;
main()
{
bad a;
a=1;
cout<<a;
}
a) 1 b) Garbage value c) good, bad, worst d) Error e) No output
2. What is the output of the following function?
#define style char
main()
{
typedef char style2;
style x;
style2 y;
clrscr();
x=255;
y=255;
cout<<x<<y;
}
a) 255, 255 b) ASCII value c) Error d) No output

3. What is the output of the following function?


#ifdef TRUE
int I=0;
#endif
main()
{
int j=0;
cout<<i<<j;
}
a) 0 0 b) 2 0 c) 0 2 d) Error e) No output
4. What is the output of the following function?
#include
main()
{
char *pDestn,*pSource="I Love You Daddy";
pDestn=malloc(strlen(pSource));
strcpy(pDestn,pSource);
cout<<pdestn;
free(pDestn);
}
(a) Cant be defined
(b) None
(c) I love You Daddy
(d)Error</pdestn;
</i<<j;
</x<<y;
</a;
5. Write a program to insert a node in a doubly linked list?
6. What is a data structure?

Database Interview Questions - Alcatel Lucent


1. What is the difference between oracle and MS Access?
2. What is the function of cluster index?
3. How does non-cluster index functions?
4. What are the disadvantages of primary key and foreign key in SQL?
5. What are the tools used for backup and ticketing?

Point out the error in the expression a>b ? g=a : g=b;


This expression give an error L valued required.
The error can be overcome by enclosing the statement in the : part within parenthesis.
Correct expression is a>b ? g=a : (g=b);
In absence of parenthesis the compiler considers that b is being assigned to expression to the left of =.
This is the limitation of conditional operator that only one C statement can occur after ? or: .

Which statement is used to jump out of loop instantly?


Keyword break is used to jump out of loop without waiting for conditional test.
After break statement the control automatically passes to the first statement after the loop.

It breaks the control only from the loop in which it is placed.


Example: if(32 /2 ==0)
{
printf(number is even);
break;
}
In the given example condition is true, so break statement occurs and control jumps out of the loop.

difference between while and do while loop


* In while loop , the condition is checked before entering the loop
* In do while loop ,the condition is checked only after entering the loop

Explain the keyword continue.


It is used to take the control to the beginning of the loop.
It bypasses the statements inside the loop, which have not been executed.
Continue statement is generally present within a loop and associated with if statement.
Example:
int i, j;
for ( i=1 ; 1<=2 ; i++)
{
for ( j=1 ; j<=2; j++)
{
if (i==j)
continue ;
printf (\n%d %d\n,i,j);
}
}
Output of program is 12
21
When the continue statement takes control it bypasses the remaining statements of the inner for loop.

How are decisions made using a switch keyword?


Switch is combined with case and default keywords to make a control statement.
Syntax: switch(integer expression)
{
case constant 1:
do this;
case constant 2:
do this;
case constant n:
do this;
default:
do this;
}
The integer expression yields an integer value.
This integer value is matched with case constant and if condition for any case is true it executes the statements
following the case statement.
If no case matches then statements following default are executed.

What is the K & R method to declare formal arguments in a function .

K & R is called as the Kernighan and Ritchie method of declaring arguments.


Example: calsum(x, y, z)
int x, y, z;
here x,y,z are the formal parameters.
Here the values x, y, z are defined in the first statement (function declaration).
Their data types are defined in the second statement.

Give one method for declaration of formal parameters.


Formal parameters can be declared using ANSI method .
In this method the data types of the parameters are defined in the function declaration.
The data types used can be integer, float, char, etc.
Example: calsum(int x, int y, int z)
Here x,y,z are the formal parameters.

What is garbage value and how it can be avoided?


If a function is not returning any specific value ,it returns data called garbage value.
Example: return(a); A
return ; B
In statement A a specified value a is returned.
In statement B no specified value present so it returns a garbage value.
To avoid the garbage value keyword void is placed before the function name.
Example: void display ( )
{
printf (welcome);
}

Give the difference between call by value and call by reference.


When a function is called it passes values of variables to called functions.
This is called as call by value and we have access to formal parameters.
Example: sum= calsum( a, b, c);
Here calsum is the function and a, b, c are the values passed.
If instead of the values the addresses of value are passed it is called as call by reference.
To pass values using call by reference pointers are used and we have access to actual parameters.

Which variables always contain whole numbers?


Pointers are the variables which always contain data in the form of whole numbers.
They store the address of other variables.
They are declared as data type *name of variable.
It also uses other operator & which returns the address of the variable.
Example; j= &i
Here j is a variable that holds the address of other variable i.

Explain recursion.
A function is called recursive if a statement within the function can call the same function.
In circular definition it is the process of defining something in terms of itself.
It is represented as rec( ).
An if statement is used within recursive statement to avoid infinite loop.

Example: rec ( int x)


{
int f;
if (x== 1)
return ( 1 );
else
f=x*rec(x-1);
return ( f );
}
Function to find the factorial of a number.

Can user defined functions be added to the library ?If yes, explain.
Yes, the user defined functions can be added to the library.
Also different compilers provide different utilities to modify functions and for c compilers utility called tlib.exe (Turbo
library) is used.
Initially create the function and then compile the file using Alt f9.
This file contains the code in machine language and then add file to the library using the command c:\.>tlib
math.lib + c:\filename.obj
Declare the prototype of function in the header file.
To include it in a program use syntax : #include c:\\filename.h.

Explain the automatic and static storage classes.


Automatic and static storage classes for variables defined uses memory as the storage.
These classes are local to the block in which variables are defined.
Automatic class uses the garbage value as the default initial value.
Static class uses the default initial value as zero.
These classes remain till the control remains within block in which the variable is defined.

1. From which of the following libraries below, calloc() belongs to?


stdlib.h
malloc.h
calloc.h
both a and b above

2. What is the main difference between calloc() and malloc()?


calloc() takes a single argument while malloc() needs two arguments
malloc() takes a single argument while calloc() needs two arguments
malloc() initializes the allocated memory to ZERO
calloc() initializes the allocated memory to NULL
3. Which of the following below is/are valid C keywords?
integer
int
null
both a and c above

4. What will be the of the following program?

float x = 3.3;
int i;
i = (int) x;
print i;
3
3.3
3.0
3.00
5. What is the purpose of getc() for?
read a character from STDIN
read a character from a file
both and b above
read a character from an input of user

6. ______________ is used to write formatted output with variable argument lists


vfprintf
vsprintf
vprintf
all of above

7. What is the difference between a structure and a union?


We can define functions within structures but not within a union
We can define functions within union but not within a structure
The way memory is allocated
They have no difference.

8. ___________ will immediately jump to the end of the current block of code
continue
exit
goto
break
9. Importance of "auto" specifier
Automatically initializes a variable to NULL.
Automatically initializes a variable to 0;.
Automatically increments the variable when used.
Indicates that a variable's memory space is allocated upon entry into the block.
Indicates that a variable's memory will automatically be preserved.
10. How to read a character from the keyboard and will store it in the variable a.
a = getchar( stdin );
a = getchar();
a = getc();
getchar( &a )
getc( &a );

11. Which one is used for moving blocks of binary data that are of arbitrary size and position in memory?
strncpy()
memcpy()
memmove()
strcpy()
memset()
12. _________________ function to read a specified number of elements from a file.
gets()
fileread()
readfile()
fread()
getline()

13. What function should be used to release allocated memory which is no longer needed?
free()
dealloc()
release()
dropmem()
unalloc()

RE: HR Interview Questions - Alcatel Lucent


Interview Questions 02-3-2012 04:05 AM
What is your greatest achievement?
Are you ambitious?
Are you speaking to some other companies? Or how is your job search going on?
You have stayed for a long time with your last company-Why?
What was your biggest mistake?
Why havent you got a job yet?
You do not have all the experience we are seeking for this position.
Why do you want to quit your present job?
Have you ever made a mistake at work? How did you rectify it?
What major problems did you face in your last role?
Where do you see yourself 5 years from now?
How do you feel about doing repetitive work?
How did you manage to attend this interview during your working hours?
Would you like to work in a team or on your own?
If your last boss was present here, what do you think he would tell us about you?
Has your career developed as you had liked?
Your expected salary?
What will you do if you are offered a job with a salary higher than this?
Do you want to ask us something about the company?
1. What you want to become in future?
2. What are your long term goals?
3. Do you have short term goals as well?
4. What are the challenges you have faced till now?
5. Explain one challenge where you came out to be a winner?
6. What are disappointments you have faced in your life?

Вам также может понравиться