C Interview Questions
- 0of 0 votes
AnswersIn a class, the new operator is used for allocating memory for objects created . Can this be done using malloc ? If yes, how and if no , why not ? Are there any restrictions associated with the use of malloc in place of new ?
- ShadowMask September 13, 2008| Report Duplicate | Flag | PURGE
IBM Software Engineer / Developer C - 0of 0 votes
Answerswhat is difference between declaration and definition in C??
- zxcvbnm September 09, 2008| Report Duplicate | Flag | PURGE
Microsoft C - 0of 0 votes
Answerwhat is free()??
- zxcvbnm September 09, 2008
what is realloc()??| Report Duplicate | Flag | PURGE
Microsoft C - 1of 0 votes
Answersdifference between struct and class??where to use struct and where to use class??
- zxcvbnm September 09, 2008| Report Duplicate | Flag | PURGE
Microsoft C - 0of 0 votes
Answerswhat is difference between pointers in C and C++??
- zxcvbnm September 09, 2008| Report Duplicate | Flag | PURGE
Microsoft C - 0of 0 votes
Answershow is sizeof implemented??
- zxcvbnm September 09, 2008| Report Duplicate | Flag | PURGE
Microsoft C - 0of 0 votes
Answersdesign a class car??
- zxcvbnm September 09, 2008| Report Duplicate | Flag | PURGE
Microsoft C - 1of 0 votes
Answerswht is memory leakage in C++??
- zxcvbnm September 09, 2008| Report Duplicate | Flag | PURGE
Microsoft C - 0of 0 votes
Answerdifference between struct and class??
- zxcvbnm September 09, 2008
where to use struct and where to use class??| Report Duplicate | Flag | PURGE
C - 0of 0 votes
Answersbasic questions like what is volatile , static and where to use them and why?
- newguy September 01, 2008| Report Duplicate | Flag | PURGE
NVIDIA Software Engineer / Developer C - 0of 0 votes
AnswersWhat is the significance of virtual destructor?
- The Hercules September 01, 2008| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer C - 0of 0 votes
AnswerDiscussion on virtual inheritance
- The Hercules September 01, 2008| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer C - 0of 0 votes
AnswersDiference between deep copy & shallow copy
- The Hercules September 01, 2008| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer C - 0of 0 votes
AnswersDifference between Malloc vs Realloc
- The Hercules September 01, 2008| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer C - 0of 0 votes
AnswersWhat VTBL is and why it's useful?
- Jack September 01, 2008| Report Duplicate | Flag | PURGE
Expedia Software Engineer / Developer C Terminology & Trivia - 0of 0 votes
AnswersIf u have to write your own printf and u don't have va_arg how would you get the arguments in the variable list.
- Anonymous July 26, 2008| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer C - 0of 0 votes
AnswersWrite function similar to malloc.
- Anonymous July 26, 2008
void* myMalloc(int n)
'n' is the num of bytes to allocate.
You are given a void* f pointer that points to the location free in the memory.| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer C Coding - 1of 0 votes
AnswersWrite the function my2DAlloc.
- Anonymous July 26, 2008
Minimize the number of calls to malloc.
Also, the memory should be accessible by the notation arr[i][j].| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer C - 0of 0 votes
AnswersYou have a class that many libraries depend on. You need to modify the class for one application. Which of the following changes require recompiling all libraries before it is safe to build the application?
- zhizun July 22, 2008
a. add a constructor
b. add a data member
c. change destructor into virtual
d. add an argument with default value to an existing member function| Report Duplicate | Flag | PURGE
JP Morgan Financial Software Developer C - 0of 0 votes
AnswersWhat is memory leakage? how do you detect it?
- lax July 22, 2008| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C - 0of 0 votes
AnswersVirtual functions. How does a compiler know which function to use(virtual funtion table)?
- Sach (Sachin) July 22, 2008| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C - 0of 0 votes
AnswersWrite a function to make a pointer point to a different object.
- XXXX July 22, 2008| Report Duplicate | Flag | PURGE
Qualcomm Software Engineer / Developer C Coding - 0of 0 votes
AnswersWhat is a copy constructor? How do you use it? What's the difference between shallow and deep copy? Why the significance of ambersand (&) in the copy constructor ? What will happen if there is no ambersand?
- Alfy July 22, 2008| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C Terminology & Trivia - 0of 0 votes
Answerswhat problems do you see in this piece of code (tell without compilation):
- pavel.em June 16, 2008
template <class Custom = void>
struct Foo : public Custom {
};
template <>
struct Foo<void> {
template <class X>
struct rebind {
typedef Foo<X> Other;
};
};
template <class Base>
struct Derived : public Base::template rebind <Derived<Base> >::Other {
int foo() {
printf("here we are\n");
};
};
main() {
typedef Foo<> Foo_inst;
typedef Derived<Foo_inst> Derived_inst;
Derived_inst ii;
ii.foo();
}| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer C - 0of 0 votes
AnswersWhat is wrong with the below method?
- Guest May 30, 2008
public int getchar(string s)
{
string s1=s[3];
}| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer C - 0of 0 votes
AnswersHow do you programitcally create & terminate a process on linux
- The Hercules May 26, 2008| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer C - 0of 0 votes
Answers- When to use Refernece/Pointer
- Ozzy May 23, 2008
- What is Copy ctor? Passing by ref to const
- Mutable? Why use it?
- Design a web browser class.
- Why use Exceptions? What are some of the concerns with exceptions?
- What is a dynamic cast? And when do we use it?
- What is a design patter? Name a few design patterns.
- What happens when you take the address of a reference?
- Few behavioral questions.
This was a phone screening. Will report more with the onsite questions.| Report Duplicate | Flag | PURGE
London Investment Bank Software Engineer / Developer C Coding Algorithm