Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Related Rants
I once interviewed for a role at Bank of America. The interview process started off well enough, the main guy asked some general questions about career history and future goals. Then it was off to the technical interviewers. The first guy was fine. Asked appropriate questions which he clearly understood the answers to.
The next guy up, however, was what I like to call an aggressive moron. After looking at my resume, he said I see you listed C++. To which I said, yes I have about 7 years of experience in it but I've mostly been using python for the past few years so I might be a bit rusty. Great he said, can you write me a function that returns an array?
After I finished he looked at my code, grinned and said that won't work. Your variable is out of scope.
(For non C programmers, returning a local variable that's not passable by value doesn't work because the local var is destroyed once the function exits. Thus I did what you're supposed to do, allocate the memory manually and then returned a pointer to it)
After a quick double take and verifying that my code did work, I asked, um can you explain why that doesn't work as I'm pretty sure it does.
The guy then attempted to explain the concept of variable scope to me. After he finished I said, yes which is why I allocated the memory manually using the new operator, which persists after the function exits.
Einstein then stared really hard at my code for maybe 10 to 15 seconds. Then finally looked up said ok fine, but now you have a memory leak so your code is still wrong.
Considering a memory leak is by definition an application level bug, I just said fine, any more questions?
rant
bad interview