Hi all.
So I just finished an interview with a major software company for an internship (I am an undergrad). I had some weird experiences during the interview, so I thought I had share them here and ask for feedback.
I was interviewed on-campus so there was no telephonic round.
Before the interview began, we were given a choice of a programming language. I picked C++. The interview began and the first question I was asked was about reversing a string (after the interview I came to know what a common question that was).
Now of course, I have always been told not to reinvent the wheel since time immemorial. So of course, being taught that by mentors, I did:
std::string s = "This is a string.";
std::reverse(s.begin(), s.end());
std::cout << s;
The interviewer was not impressed. There was an immediate frown on his face. He then told me, 'Do this without using the standard library.'
Now my question is, what does one do? For example, I have always used std::sort
without bothering about its internals. To actually understand how it works, one has to implement it. But if I ever did that, I was told to stop reinventing the wheel.
My question is, how does one handle such situations in an interview? For someone like me who uses the standard library without knowing anything about its internals, how do I handle interview questions such as these, where we are asked to reinvent the wheel? And being an undergrad, I can't possibly be expected to know the inner details of a standard library.
This is just one example. Indeed the string reversing example is easy to implement, but what about other situations? How have you handled them? Or to be a good programmer, I should be knowing the inner details?
PS: I was not selected.