Live data from Hacker News

The Mother of All Interview Questions

raganwald.posterous.com

121–130 of 136 posts

Re: The Mother of All Interview Questions

#121
post #114
post #108

Earlier quoted context omitted.

The only time I was ever fired from a job, it was for doing this. I rewrote an entire web crawler stack using parallel event driven programming, yielding a crawler that could crawl the same number of sites they currently needed 10+ EC2 instances for on my laptop without breaking a sweat. I did it in a one-week + weekend maniac code binge. I was a little peeved, but looking back not so much. I was receiving pressure a…

I did the exact same thing a while back. The company I worked with used 4 fully-loaded servers driving Java spiders while I used 2 y/o laptop and 100 lines of Erlang. Showed the code to my manager, he left the room saying I should do some "real" sysadmin work and stop playing around. Just for a test, I started spidering big local news sites with I think 10000 threads and left it running for about 15 minutes. Two thin…

Yeah. In general, nobody knows how to write network code. I have seen tons of network apps that perform horribly and use utterly absurd amounts of resources for trivial tasks.

Re: The Mother of All Interview Questions

#122
post #82

Earlier quoted context omitted.

When I was at Google I wished they had a few 'uncoders', people who made it their goal in life to leave the source tree with fewer lines of source than they found it. True story: I went to a talk given by one of the 'engineering elders' (these were low Emp# engineers who were considered quite successful and were to be emulated by the workers :-) This person stated when they came to work at Google they were given the…

I had a working mapreduce job that was 300 lines of fairly high level java code. Compact, terse, expressive, everything you don't see in most Java. I came back over a the weekend and my boss/coworker made it 'configurable' which means he added 800 lines of code. I fucking cried. He was like, "I hoisted out some stuff that should have been behind interfaces." ... I didn't need an interface because I only had ONE and s…

"Adding interfaces" to improve is when i start to freak out too, also splitting a well-defined piece of code into multiple classes. I call that symptom "knowing object oriented programming principles too well".

Re: The Mother of All Interview Questions

#123
post #82

Earlier quoted context omitted.

When I was at Google I wished they had a few 'uncoders', people who made it their goal in life to leave the source tree with fewer lines of source than they found it. True story: I went to a talk given by one of the 'engineering elders' (these were low Emp# engineers who were considered quite successful and were to be emulated by the workers :-) This person stated when they came to work at Google they were given the…

I had a working mapreduce job that was 300 lines of fairly high level java code. Compact, terse, expressive, everything you don't see in most Java. I came back over a the weekend and my boss/coworker made it 'configurable' which means he added 800 lines of code. I fucking cried. He was like, "I hoisted out some stuff that should have been behind interfaces." ... I didn't need an interface because I only had ONE and s…

I've never met a class I didn't want to inherit.

Re: The Mother of All Interview Questions

#124
post #103
post #93

Earlier quoted context omitted.

Rewriting might still be faster then understanding an existing implementation.

If you don't understand it, how do you know what to write?

You know the know and understand the goals, but you don't understand the internals.

Re: The Mother of All Interview Questions

#125

I don't 'get it'. Sounds like an easy question and not "The Mother of All Interview Questions". But, for me, part of the answer is that the "process" has involved solving practical problems only in part with software, and some of the "invention" has been not really in the software. Do the following examples count? (1) A prof wrote a package for statistics for students and in the testing found that one of the operatio…

You lost me at (6):

Shouldn't it be proportional to O(n log 100) ~ 0(n) aka linear time?

Re: The Mother of All Interview Questions

#126
post #104
post #82

Earlier quoted context omitted.

I had a working mapreduce job that was 300 lines of fairly high level java code. Compact, terse, expressive, everything you don't see in most Java. I came back over a the weekend and my boss/coworker made it 'configurable' which means he added 800 lines of code. I fucking cried. He was like, "I hoisted out some stuff that should have been behind interfaces." ... I didn't need an interface because I only had ONE and s…

>Compact, terse, expressive Does 'Compact' mean that you originally did: if( foo ) while( foo ){ do something } all on one line and the boss split them up into multiple lines? I ask because I worked a job where statements were combined on single lines for ease or reading and it was a nightmare.

By compact I mean the domain logic was all in one place and not diluted like a fine mist across the code. You could read it like english and it made sense. Consistency in abstraction levels and not too much genericism.

Re: The Mother of All Interview Questions

#127
post #121
post #114

Earlier quoted context omitted.

I did the exact same thing a while back. The company I worked with used 4 fully-loaded servers driving Java spiders while I used 2 y/o laptop and 100 lines of Erlang. Showed the code to my manager, he left the room saying I should do some "real" sysadmin work and stop playing around. Just for a test, I started spidering big local news sites with I think 10000 threads and left it running for about 15 minutes. Two thin…

Yeah. In general, nobody knows how to write network code. I have seen tons of network apps that perform horribly and use utterly absurd amounts of resources for trivial tasks.

Used to work in a fortune 500 company that would send email notifications to customers telling them their monthly statements were available. Unfortunately, the monkeys who coded the email sending didn't understand the protocol, obviously had not read the RFC. The code would blindly send smtp commands without waiting for a response. One day the smtp server decided to change its behavior due to a dns misconfiguration and many emails were lost.

Re: The Mother of All Interview Questions

#128
post #116

Here's a metaphor about a special case where invention is justified. Suppose you have no cell phone and you need to get to your mad science lab before your apprentice does so that you can lock up the monster you created the night before — otherwise it will eat him. You spot him ten cars ahead of you on the two-lane highway, but he doesn't notice you. It is 100% guaranteed that he will arrive at the lab before you if…

>Alpha, PA-RISC, and the AS/400 aren't even on the market any more

Strictly speaking it's not correct: AS/400 was rebranded, but you still can buy hardware with OS/400 running on it. Also, it never was replaced by AMD64 - it's using CPU-independent byte-code and happily migrated over different CPU architectures few times.

Re: The Mother of All Interview Questions

#129
post #128
post #116

Here's a metaphor about a special case where invention is justified. Suppose you have no cell phone and you need to get to your mad science lab before your apprentice does so that you can lock up the monster you created the night before — otherwise it will eat him. You spot him ten cars ahead of you on the two-lane highway, but he doesn't notice you. It is 100% guaranteed that he will arrive at the lab before you if…

>Alpha, PA-RISC, and the AS/400 aren't even on the market any more Strictly speaking it's not correct: AS/400 was rebranded, but you still can buy hardware with OS/400 running on it. Also, it never was replaced by AMD64 - it's using CPU-independent byte-code and happily migrated over different CPU architectures few times.

You're right — I misread http://en.wikipedia.org/wiki/AS/400 to be saying that AS/400 was killed in 2008, but the replacement hardware still runs OS/400. Thank you!

> In April 2008, IBM announced its integration with the System p platform. The unified product line is called IBM Power Systems and features support for the IBM i (previously known as i5/OS or OS/400), AIX and Linux operating systems. Power4 or older hardware ran OS/400 exclusively.

Re: The Mother of All Interview Questions

#130
post #125

I don't 'get it'. Sounds like an easy question and not "The Mother of All Interview Questions". But, for me, part of the answer is that the "process" has involved solving practical problems only in part with software, and some of the "invention" has been not really in the software. Do the following examples count? (1) A prof wrote a package for statistics for students and in the testing found that one of the operatio…

You lost me at (6): Shouldn't it be proportional to O(n log 100) ~ 0(n) aka linear time?

Yup! I typed too fast! You are correct. I was thinking the right thing but typing the wrong thing! I'm too used to typine (n)ln(n)!. So, sure, worst case, n times have to do a heap 'sift' which is time proportional to ln(100) as you said.

Short answer: I blew it!

But for the exercise, that is, when there are no ties among the n numbers and all permutations are equally probable, for 100 < m < n, the probability that number m is among the 100 largest so far and, thus, causes a heap 'sift', seems to be 100/m. So, the expected work on number m is proportional to just (m - 100)/m + ln(100) (100/m), first cut, wild guess, don't hold me to it! So, sum this on m and get the expected work (computational time complexity) up to a constant of proportionality. Maybe! That is, so far, first cut, the exercise looks simple! When do the sum, I smell a ln(n) term!

Post reply on HN