Day: August 9, 2010

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…

Mommy… can girls marry girls?

Well, there was a heated discussion about that in California. Leilani was bound to hear it right? And she was so relieved when she got my answer… one of her girlfriends wants to marry a girl. But then it escalated. Well, how do they have babies. And I explained about in vitro fertilization and other medicinal miracles. And boys? There is no way right? If two boys marry they can’t have babies… Umpfh… I was surprised that she got the biology of that right away. I was close to calling gay acquaintance of mine and ask how he got his kids. I tried international adoption and surrogate mothers… no they don’t really sell the babies… they try to make sure they give them to good people nice parents…

7 hours later: I picked up Leilani from the Little Gym. There was a newspaper, and on the front face a photo of 2 men kissing… and they were wearing suits. I had never before seen guys kissing while wearing suits … but Leilani probably had never seen men kissing “Look mommy, the two guys are kissing each other. Are they going to get married?” I felt someone stare at me. Probably the fat lady with the Texas accent and the “We are here to show you how its done” T-shirt who had just complained that Walmart is too far away and they have one at every corner in Texas. I still switched to German, just in case to answer Leilani’s question. And was very happy that I hadn’t dodged the earlier questions.