Youtube

No, the interview did not go well.
The first question was: You have an unsorted array of continuous integers and one is missing – find it. I suggested sorting, that would have worked but was not the solution he wanted, then I suggested a binary map, but that was not the most elegant solution either. With a little help something like o over n or so I determined the min, max, added them up and called a virtual function expectedSum and figured it out.
The next one was worse. Write a C++ function that gets an integer argument and outputs a string hex representation of that number. No functioncalls. Oh, and less than 10 lines. I understood the question. And I wish when I sit in meditation my mind could be as blank as it was when I should have answered. I sputtered masking and bitshifting and xor but did not write a single line.
It was over right then. The SQL question was a nested query, and I did not recover until the shell script questions.
What does the $ sign mean in a bash script … if it is undefined what happens… what does if [ $? -eq 0 ] mean… and a few more, I got these right. Took over an hour, and I am glad it is over…

Author: Sonja

Leave a Reply

Your email address will not be published. Required fields are marked *