Archive for December, 2007
C/C++/STL/Unix Programmer Question and Answers
C++
Basic Syntax
What is the difference between pointer and reference?
Pointer and reference hold memory address as their values. The address of the reference is the address of the aliased object, and the value of the pointer is the address of the pointed object. Pointer can point to different objects during its lifetime or NULL. [...]
Sample Programmer Interview at Ion
1) Count number of binary “ones” in a sentence
int numOnes(string word) {
int length = strlen(word);
int count = 0;
for (int i = 0; i > 1;
[...]
Sample C++ Programmer Interview Questions and Answers from Goldman Sachs Equity Platform Tech
The phone interview questions can be found at www.careercup.com. Below are the on-site questions.
Show me how virtual function works in C++
class base{
public:
virtual void foo(){}
};
class derived: public base{
public:
void foo(){}
};
base * a, *b;
a = new base();
a->foo() // Calls base’s foo()
b = new derived();
b->foo() [...]


