I was initially approached by recruitment agency, for which I needed to do an IKM C++ test for screening. I'm not sure if this is what Bloomberg demanded of them or not. After that followed a standard phone interview with an engineer from Bloomberg. I lasted more than half an hour and appart from standard who we are/who I am questions, it mainly consisted of C++ trivia:
- what is a pointer,
- what is extern C,
- what is virtual function,
- what is singleton and how would you implement it,
- what is const,
- what is mutable,
- stack/static/heap memory, and so on.
They were satisfied with my answers so I got to face-to-face interview in their London office two weeks after phone screening. Two Bloomberg engineers met me. They were some project/team managers. They offered me coffee from their cafeteria, but I politely declined. They took some for themselves and we proceeded to an office with glass walls. One of the interviewers was fairly quiet the whole time and looked a bit annoyed, while the other one was really friendly and helpful. The friendly one admitted at the beginning that he had not even looked at my CV. He had a couple of sheets of paper and selected few questions from them. The whole interview lasted for about an hour.
1. Question:
char abc[27].
char* ptr = abc
strcpy(abc,"abcdefg")
What are data types and values of following:
abc[3]
&abc[3]
*abc
abc + 2
abc[6]
abc[7]
abc[8]
*ptr
&abc
ptr + 3
(and similar)
2. Question:
Base {
public:
void foo() {}
}
Derived : public Base {
void foo() {}
}
What does this program do, line by line:
Base b;
Derived d;
b.foo();
d.foo();
Base* bb = &d
bb->foo();
Derived* dd = &b
dd->foo();
3. Question:
Write on paper a function in C++ that will reverse the order of words in string without using O(n) memory for this. So "write reversing order function" should become "function order reversing write".
4. Question: do a code review:
char* addnewline(char* s) {
char buffer[1024]
strcpy(buffer,s)
buffer[strlen(s)-1] = '\n'
return buffer;
}
Then he was using my code review comments for follow up debate:
What is auto keyword?
What is the opposite of auto?
Where in memory are static variables located.
Where in memory are located variables, that are declared outside of any function?