Live data from Hacker News

I failed a Twitter interview

qandwhat.apps.runkite.com

21–30 of 86 posts

Re: I failed a Twitter interview

#21
post #9

you could solve this with a simple state machine; there's no reason to resort to parlour tricks... https://gist.github.com/igor47/7228586

Your solution doesn't work when there is more than one "puddle":

https://gist.github.com/alexchow/7228746

Try the case: ([2,5,1,2,3,4,7,7,6,3,5], 12)

Re: I failed a Twitter interview

#22
> The next day I showed this question to my TA, who's a PhD student in theoretical computer science. After 40 minutes he was also stuck with nothing.

That just doesn't speak well of this particular PhD. The one-pass solution is rather obvious. I hate puzzle-based interviews with passion, but this is actually a very reasonable question and it does help to tell apart people with "theoretical" computer science skills from those with a bit more practical experience.

Re: I failed a Twitter interview

#25
post #21
post #9

you could solve this with a simple state machine; there's no reason to resort to parlour tricks... https://gist.github.com/igor47/7228586

Your solution doesn't work when there is more than one "puddle": https://gist.github.com/alexchow/7228746 Try the case: ([2,5,1,2,3,4,7,7,6,3,5], 12)

it's not "more than one puddle"; it's that i don't count the second puddle because i don't ever "close" it by encountering it's level again. if i go off the edge, i should close it as best i can.

Re: I failed a Twitter interview

#26
I had two phone screenings with Amazon recently and they decided not to continue with my application.

It was depressing to me and I felt down for quite a bit, mainly because on the second phone screening I just couldn't do the coding task asked. My mind went blank and I probably sounded like a 5 year old struggling through the simplest of questions.

It's my own fault though, I just got more and more stressed over the preceding weeks reading algorithms textbooks and "CareerCup" tests I think I just burned out.

I totally understand that top companies like Amazon and Google can afford to be ruthless and choosy in their interview process, after all, they're top companies for a reason, but I guess it just wasn't for me

Re: I failed a Twitter interview

#27

No offence to Twitter, but this is a seriously bad way of hiring developers. What are you trying to recruit mathematics scholars as developers? When will companies like Twitter learn not all great developers are math geniuses? I didn't even get a college education to get where I am, I failed maths in school as well, but I can code, so what does that mean? I think it means nothing in the greater scheme of things. By t…

I have no idea why a bunch of people here keep saying these questions are good for recruiting 'mathematics scholars'. Fact: I am a mathematics graduate student and I would not be able to solve this problem. I hope there isn't a notion that people studying mathematics spend all their time solving Project Euler type questions.

In fact I would be thrilled if they are recruiting for math people. They are not. I have been in the job market for a while now and recruiters literally stop listening when they don't hear "CS" in the first sentence.

Re: I failed a Twitter interview

#29
post #3

This question involves an "a-ha" moment (for the linear-time solution) and was thus banned from interviews at Google last year. Don't use questions involving eureka moments. They reveal nothing about the candidate. Edit: It should be noted that this question was used for a long time at Google, Microsoft, and many other places. It's a terrible question.

No, it doesn't involve the "a-ha" moment.

Two-pass solution is obvious, just look at the final state. Once you are at that, the one-pass is a run-of-the-mill optimization of switching from accumulating and then processing the state to doing it all in parallel. The ability to recognize when this is doable is a good way to tell someone who's done it before (in some other context) from those who merely wrote a functional prototype of Tic-Tac-Toe in TurboPascal.

Re: I failed a Twitter interview

#30
It's not you, it's them. A rather brilliant acquaintance of mine did the whole fly-to-SF song and dance with them and didn't make the cut either. (He got snagged by a wonderful startup soon after though.)

What is important to understand here is that these processes are highly variable and there is an element of luck involved. It's just the nature of a human-driven process and a complicated organization.

Post reply on HN