C Interview Questions
- 0of 0 votes
Answersint i=0'
- Anonymous January 13, 2009
while(i++<5)
{
std::cout<<++i<<std::end1;
}
How many lines produce this code?| Report Duplicate | Flag | PURGE
C - 0of 0 votes
Answersstruct A
- Anonymous January 13, 2009
{
int i,j;
public:
A(int ii,int jj):i(ii),j(ii){}
A(const A& a)
{
std::cout<<"("<<a.i<<","<<a.j<<")";
}
A& operator=(const A& a)
{
std::cout<<"["<<i<<","<<j<<"]";
return *this;
}
};
int main(void)
{
A x(1,2);
A y(3,4);
A z=(x=y);
return 0;
}
What is output?| Report Duplicate | Flag | PURGE
C - 0of 0 votes
Answerclass X
- Anonymous January 13, 2009
{
int a;
public:
X() {cout<<"X constructor was called"<<end1;}
X(int n) {cout<<"X(int) constructor was called"<<end1;}
~X() {cout<<"X destructor was called"<<end1;}
};
int main()
{
X x(3);
return 0;
}
Assuming all necessary header files , what is the output from the sample code above?| Report Duplicate | Flag | PURGE
C - 0of 0 votes
AnswersThey asked about various storage class specifiers of C : static,register,extern
- Prashi December 20, 2008
Their scope and existence during a program execution.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer C - 0of 0 votes
AnswersWAP for tic-tac-toe game and test it
- An December 15, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C - 1of 0 votes
AnswersWhy does destructor in base class need to be declare virtual?
- one2free November 28, 2008| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer C - 0of 0 votes
AnswersWhat is name hiding?
- one2free November 28, 2008| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer C - 0of 0 votes
AnswersImplement a class using singleton pattern
- Singleton November 12, 2008| Report Duplicate | Flag | PURGE
Credit Suisse Analyst C - 2of 0 votes
AnswersVirtual functions and vtable...
- Anonymous November 06, 2008
What happens when a Constructor gives a call to a virtual functions
What if it is a pure virtual function| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer C - 1of 1 vote
AnswersWrite code and test cases for reversing a C-style string.
- Aniruddha Gore November 02, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C String Manipulation Testing - 1of 0 votes
AnswersThis question was asked in Microsoft interview. Write a program to determine whether it is a good string or bad string.
- Write a program to determine the good string or bad October 19, 2008
For ex: {abcdteeh} - good string
(bans{xyzhs}aj) - good string
}this{ - bad string
{abs{jeu} - bad string
If the string contains the equal no. of corresponding braces, brackets and parathesis. Moreover, if the string is {adbc(xyz}the) bad string...
You should take all the possible scenorios and write an efficient code it.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer C - 0of 0 votes
AnswersWhat is the different between .a .o .out files?
- Raady October 18, 2008| Report Duplicate | Flag | PURGE
Aricent Software Engineer in Test C - 0of 0 votes
AnswersWhat happens when u delete a null pointer?
- Raady October 18, 2008
char *p;
del *p;
*p=null;
del *p| Report Duplicate | Flag | PURGE
Aricent Software Engineer in Test C - 0of 0 votes
AnswersWhat happens when u delete a pointer twice
- Raady October 18, 2008
del *p;
del *p;
What is this error called? How to avoid such double deletes?| Report Duplicate | Flag | PURGE
Aricent Software Engineer in Test C - 0of 0 votes
AnswersWhy is malloc preferred over calloc?
- Raady October 18, 2008| Report Duplicate | Flag | PURGE
Aricent Software Engineer in Test C - 0of 0 votes
AnswersHow is the memory allocation done for a union?
- Raady October 18, 2008| Report Duplicate | Flag | PURGE
Aricent Software Engineer in Test C - 0of 0 votes
AnswersWhat is the return type of constructor?
- Raady October 18, 2008| Report Duplicate | Flag | PURGE
Aricent Software Engineer in Test C - 1of 1 vote
AnswersExplain how memory allocation works in C++. Where is the stack vs the heap used?
- kashy October 16, 2008| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Computer Architecture & Low Level C - 0of 0 votes
AnswersWhat is the difference between C and C++? Compare and contrast the two.
- kashy October 16, 2008| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C - 0of 0 votes
AnswersYou are given a set of reference files (.txt files). The files contain sentences in English language. You have to write a function to process these files. The input to the function is path to the files. Take each file, read each line and process it so that you get first word last, last word first and so on (reversing the order of the words) and send the words to a function that translates each word into Hebrew. Assume that you already have the function that translates to Hebrew. You just have to use it. Function prototype is not provided. You can make your assumptions.
- Translate October 15, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C - 0of 0 votes
AnswersTypes of polymorphism
- Satish October 13, 2008| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C - 1of 0 votes
AnswersWhat does appending 'static' to a global variable/function do?
- Sandeep Marathe October 12, 2008| Report Duplicate | Flag | PURGE
Qualcomm Software Engineer / Developer C - 0of 0 votes
AnswerWhat are Virtual function, why are they important? Where did you use them in your projects?
- min2 October 09, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer C - 0of 0 votes
Answershow to free memory allocated to an array with new function?
- Jamie October 09, 2008| Report Duplicate | Flag | PURGE
Google Software Engineer in Test C - 0of 0 votes
AnswersWhat is the difference between these two statements
- Adobe October 03, 2008
void (*p) (void *a[],int n)
void *(*p[]) (void *a, int n)| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer C - 0of 0 votes
AnswersHow do you set a pixel in a monochrome screen of size 800 by 600. The pixels are stored in a 1 D array.
- Hello World September 27, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer C - 0of 0 votes
AnswersWhere in memory are a program's static variables stored?
- Anonymous September 25, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer C - 0of 0 votes
AnswersAdvantages of const over #define. When to use which of them?
- Anonymous September 25, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer C - 0of 0 votes
Answer4. (A) Explain Garbage Collection in .NET framework.
- MildGeek September 20, 2008
OR
4. (B) How buffer overrun is dangerous, and can be used for hacking.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer C - 0of 0 votes
Answers1. What is hash table?
- Satish September 18, 2008
Its access time?
Procedure to insert new element?
2. Given integer array of 199 numbers with 99 numbers repeating twice, find number that did not repeat it self?
Went to ask what if if the array is of Strings instead of number?
3. Program to reverse linked list, where I tumbled.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer C Algorithm