4 ms·
Thats hilarious. I was once interviewing for a C++ position and the interviewer presented me with some C code with a broken "swap" implementation and a driver
by ensiferum 10y ago
Thats hilarious.
I was once interviewing for a C++ position and the interviewer presented me with some C code with a broken "swap" implementation and a driver function and asked me to fix it. I simply prefixed the call to swap with "std::".
He wasn't very happy about it. ;-)
- ryandrake 10y agoNice. I was once asked to implement a basic filesystem API in C++ including file manipulation, directories and paths, etc. I just said use boost::filesystem and move on with your life. Interviewer was not impressed but at 95% of companies that's what you are going to want to do. Can you imagine interviewing someone to build you a house and spending 90% of the interview time asking him how he'd chop down trees for wood and manufacture the nails? Welcome to software interviewing.
- scarface74 10y agoI partially agree. It depends on what you are hiring for. If you are hiring for a low level code monkey, you want to see how they code. If you are hiring for a senior level engineer/architect, you want to see how often they avoid coding and know how to leverage existing frameworks.
- ryandrake 10y agoOld post but wanted to respond: Even when interviewing more junior roles, I want to see the solution that involves the smallest amount of code, ideally no code. Nothing wrong with expecting that existing mentality from both junior and senior people alike. Saves you from having to instill it. A candidate's ability to re-implement the language's standard library is not so useful if we simply use the language's standard library in our application code.
- Kurtz79 10y agoOf course, you acted like a smartass for no apparent reason. You will never be asked to reimplement a library function on your job, these questions are used to see how you approach a problem, your reasoning, etc...
- scarface74 10y agoThat is how I approach a problem. I've seen too many inexperienced developers reinvent the wheel - badly - instead of taking a step back and wondering, "is this a solved problem"? Is this part of our core competency or can we outsource it, find an existing package, etc.
- HeyLaughingBoy 10y agoEven good, senior developers do this. A lot of people just jump into a problem because it's fun, but don't stop to say "hey, someone must have solved this already. Let me see if there's an open-source solution out there."
- scarface74 10y agoI might do something like that on my own time as a learning experience, but not as part of my job. The less surface area we have to support the better. It's also a lot easier to onboard new people if you're using a popular third party package and you have thousands of people that have already had the same problems you might encounter.
- danpalmer 10y agoHired. Seriously that's the correct answer as far as any productive engineer is concerned right?
- gpderetta 10y agoExcept these days you are not supposed to call std::swap directly but should go though ADL lookup. I.e.: using std::swap swap(a, b) /doublesmartass