
Ask HN: Do interviewers expect this much expertise or am I that bad a programmer? - sage76
Hi everyone,<p>So I recently had an interview at a unicorn startup for a software developer position (SDE3 as I recall). I have about 5 years of experience, mostly in php and rails.<p>It was a programming round. They gave me a problem to code in about an hour. This was the problem (Imgur link) :<p>http:&#x2F;&#x2F;imgur.com&#x2F;gallery&#x2F;osqJx<p>It was expected that there shouldn&#x27;t be any data loss.<p>I have no professional experience in Java, and  my CV was quite clear on it.<p>Do I have to prepare myself for this kind of stuff? I’m not in the valley but is this the general expected standard? I was quite stunned that I had to code this in an hour, really wasn’t expecting this.
======
lastofus
This is a non-trivial problem, assuming they really do want this to be a
network server. For instance, it did not specify if they wanted "at most once
vs at least once" delivery specifications (I'm guessing they wanted to see if
you have come across this). Dealing with reliability in the face of failing
network connections takes some serious thought.

One thing I may have pushed back on is "the requirements say this should be
thread safe, but it does not say it must use threading. Can the server be
single threaded?". If they are ok with that, writing an async IO server in a
language geared for it would make things a bit easier (Erlang, Go, Python +
Gevent, Node, etc). If feeling cheeky, you could ask if you just write a basic
server sitting in front of Redis or using 0mq since the specs did not
explicitly disallow 3rd party libs or apps.

At the end of the day, this may be one of those problems where they see how
far you get, and don't expect most candidates to finish in 60 mins. It could
also just be not the best test question relevant to the job you were applying
for. I think it's fair game for anyone w/ previous experience writing low
level networking code and servers from scratch, which is generally not what
PHP/Rails devs are doing.

~~~
sage76
If by at most once, you mean all the subscribers get the message once and once
only, yes, that's what they wanted.

I tried this in java anyway and didn't get very far. Defined the classes for
publisher, consumer and queue. Then was grilled about the reliability and all
the other requirements.

~~~
lastofus
If they required of you to implement once-and-only-once reliable delivery of
messages over a network, then I would argue they don't really understand the
problem themselves.

This blog post does a pretty good job of describing the problem:

[http://bravenewgeek.com/you-cannot-have-exactly-once-
deliver...](http://bravenewgeek.com/you-cannot-have-exactly-once-delivery/)

I would not feel bad about missing this question. Distributed systems are
hard!

------
orionblastar
Interviewers sometimes make strict and complex tests to see how well you do
under pressure. They give you brain teasers and other things as well.

Their test was written for Java before they contacted you for an interview.
They think everyone knows Java, and that is not always the case.

Writing the code in an hour is very hard to do and follow all the guidelines
as well. You'd have to have a photographic memory on Java and how messaging
works.

------
bjourne
The task description is pretty dumb. It claims to be language agnostic but it
is not because very language has a completely different threading model which
greatly affects how the task would be solved. Threading in Ruby is not at all
like threading in Java.

I've written threading and worker queue code in Java so I can kind of "see"
what solution they are aiming for. But they are specialized domains, so if you
have mostly written web code, you won't have had any experience with them.

Never the less, if you work on this problem in Java and you write a thread-
safe solution, you will become a better programmer for it.

------
nherment
They are quite clear that you can use the language you want (preferred =
Java).

For a candidate with 5 years experience, if I was the interviewer, I would
expect you to plow through this problem with ease, even on an awful
whiteboard. The reason is that pub/sub is one of the systems that are quite
important to know and understand for non-trivial enterprise applications. If
you understand it well, you should have no problem in implementing a basic
solution within an hour.

I'm a big proponent of the idea that one shouldn't _have to_ prepare for an
interview beyond the curiosity of what the potential future employer do and
which technologies do they use.

Maybe you're really good at what you do and the question asked is too
different from the kind of problems that you've been working on in the past
few years. Are you good ? I don't know. I don't know you. Moreover, failing
one interview does not answer that question for you. Neither is failing at 2
to N interviews...

------
andywood
I'd say this is a bit extreme, even for a programming interview test. I think
it assumes you've already done something like it in the past. But then, if you
haven't, then maybe you aren't a fit for this particular job.

I once interviewed at a game/graphics startup and they asked me to implement a
non-trivial graphics algorithm in a take-home test. I completed it
successfully, but only because I've done graphics programming for decades, and
in fact had implemented this very algorithm just months before in a side
project. Someone without experience in that specific area of graphics
programming would probably not have passed.

------
rgovind
I don;t think it is about the standard. It looks like they only want someone
who has already worked with messaging servers. If you have not worked on that
before, then you have nothing to worry. Sometimes it happens that what a
company/group wants is not what you have to offer, even if you are a good
programmer. With all the media hype regarding these unicorns, you feel let
down. Shrug it off and move on to other companies.

Java is just to make their own life easier, because they readily know the Java
solution.

------
partisan
If I were to write a trivial implementation from scratch then I would enjoy
this type of question. If it is about writing code to interact with some
specific Java messaging APIs then it's not a fair question to ask someone who
doesn't have the specific skill set.

------
rajacombinator
Seems a bit silly to me unless there was an understanding you were expected to
have experience with this exact sort of problem. Probably someone just trying
to be a badass.

