- What are enumerations?
- What are unions?
- What do you know about byte alignment in structs?
- How can you create objects on the heap?
- What are virtual classes?
- Find the number of 1's in a number.
- There is an array of numbers from 1 to 1000 in which one of the numbers is duplicated. Find the duplicated number.
- Create a queue using two stacks.
- Write a one-line check for checking whether a given number is a power of 2.
- Difference between new and malloc.
- What happens on mixing free and new?
- What is name mangling?
- What is the usage of volatile and mutable keywords?
- What happens when you delete a null pointer?
- How can you delete void*?
- Casting in C++
- Safe dynamic casting using static cast.
- Are static members allowed in a local class?
- What all do threads share?
- Difference between thread communication and process communication.
- How to construct a tree, given its traversals?
- What are smart pointers?
- What is Thread Local storage?
- How can you get to common ancestors of two nodes in a tree?
- What are named constructors?
- What is placement new?
- What is the difference between char* and char[]?
- Delete a node from a linked list, given the pointer to the node.
- For a good design, what all should be implemented in a C++ class? E.g. Copy constructor, assignment operator, etc.
- Should a constructor throw an exception?
- Should a destructor throw an exception?
- What are virtual destructors?
- Difference between Thread synchronization and process synchronization.
- Write code to detect loops in a list.
- How to find complexity of recursive functions?
- Named parameter idiom.
- Design patterns - singleton, factory, visitor, observer.
Saturday, March 15, 2008
IT Job Interview Questions
A few of my ex-teammates and I prepared this when we were looking for jobs. C++ and general IT questions. Feel free to add answers below.
Subscribe to:
Post Comments (Atom)
1 comments:
6.A.
Below is 'C' Program:
int getNoOfOnes(unsigned int n)
{
int count=0;
while(n!=0)
{
n=(n&(n-1));
count++;
}
return count;
}
Post a Comment