
Show HN: 15-question programming quiz with answers - ammon
https://quiz.triplebyte.com/
======
graphememes
This is very python specific. While I got a 15/15 and can easily answer these,
the reason for that lies with the fact that I am very fluent in Python, had I
not been I would have not gotten at least 6-8 of these wrong.

This isn't a generalist quiz, nor is it a good baseline for interviewing
candidates for the hiring process, this wouldn't tell me anything about the
application of their skillset.

~~~
squeaky-clean
I took a quiz at the Facebook booth at PyCon this past weekend. It was Python
specific, but had a few annoying gotchas. There was one question in there
twice, but with 2 different values for the input (which is what tipped me off
that it was a trick).

It basically relied on this fact...

    
    
        x = 256
        x is 256  # True
    
        y = 257
        y is 257  # False
    

Which for one, you shouldn't use `is` to compare integers in Python. I wish I
could have just written that as my answer.

Secondly, you need to be aware the CPython uses an integer cache which causes
the answers to be different. You'll actually get different answers based on
whether you run it as a file, enter it line-by-line into the interpreter, or
use a different implementation such as PyPy.

[https://stackoverflow.com/questions/15171695/whats-with-
the-...](https://stackoverflow.com/questions/15171695/whats-with-the-integer-
cache-inside-python)

There wasn't any point to the quiz, so it's okay that they put in silly
questions like that. But it's clearly there just to try and trick you, and not
quiz you on anything relevant. Most of the other questions were tricks of the
sort, or or Python 3 specific gotcha's.

~~~
teekert
As a Python beginner I'm completely flabbergasted... How can this be? And why
can't I use "is" to compare integers? This is insane. The quoted stackoverflow
is not very readable to me...

By the way y == 257 does work.

~~~
kbp
"is" is for asking whether two objects are the same exact object in memory.
"==" is for asking whether two objects are logically equal, ie, that they
represent the same value. As an example:

    
    
        >>> x = [1,2,3]
        >>> y = [1,2,3]
        >>> x == y
        True        # two lists with the same values; equal
        >>> x is y
        False       # two different lists; doesn't matter that they contain the same values
        >>> z = x
        >>> z is x
        True        # same list object in memory
    

Because here you want to know if the two integers are logically equal, not if
they're necessarily the same object in memory, you want "==" and not "is". Due
to an optimisation, "is" might work for small integers, depending on
implementation, but the takeaway is not to use "is" for value comparisons;
that's what "==" is for.

~~~
mattbreeden
To expand on this, python creates some values as singletons to save
memory/speed things up because they are used so often. The most well known
examples are True/False/None. That's why you can always do None is None,
because all None are the same None in memory. Python takes this a step further
by creating lower integer singletons. So any integer from 0-256 (not sure
about negatives) will always be the same number in memory. Above 256 python
will start actually allocating memory for integers, so two of the same number
won't be at the same memory address, and there for won't be comparable by
'is'.

~~~
bakery2k
_0-256 not sure about negatives_

-5 to 256 (inclusive) [[https://github.com/python/cpython/blob/master/Objects/longob...](https://github.com/python/cpython/blob/master/Objects/longobject.c#L18)]

------
ezekg
Not entirely applicable to this particular quiz (most of the questions were
relatively simple until the final few), but the interview questions like the
ones that Hired and Triplebyte focus on honestly make me feel like an
imposter.

I've been a software developer for over 4 years but I don't have a formal CS
education. I've gone through CLRS along with MIT's open-courseware--but I
rarely use any of that _directly_ in the workplace and so have forgotten a lot
of it. And I think I'm a pretty good software developer, yet in the past when
I've tried to get into Hired or Triplebyte, I always leave feeling like I
don't belong in this profession because I can't tell you the big-O complexity
of DFS off the top of my head, much less write the algorithm on a scratch pad.

I've been doing technical interviews for a few weeks now (I was recently laid
off) and I'm honestly just a little tired of the brain teasers and non-
applicable algo questions--and more often than not, the interviewers flexing
their "knowledge" muscles.

Case in point: I'm in final stages with multiple companies for a Rails
position, yet only _one_ of those had even mentioned Rails in the technical
interviews--the others decided to quiz my CS knowledge and one of them even
quizzed my FP knowledge (for a Ruby position…). I don't understand it.

~~~
ammon
Hello Ezekg,

I am sorry that our process makes you feel bad :( The simple truth is that
there are a lot of different ways to be a skilled programmer. One ways is
being really good at CS (and to people who want skills in CS, talking about
DFS is a reasonable low-bar question). However, another way is writing great,
well-structured rails code. We work with people all the time who don't have CS
backgrounds (we help them get jobs at companies that don't care about CS). The
intent of our process is to measure both CS and practical skills (we actually
break it down on more axes, but you get the idea).

This does mean that if you go through our process, you will be asked CS
questions. But you'll also be asked to code. And not knowing the CS questions
is not an obstacle to passing.

~~~
mattmanser
Do you truly believe that being really good at CS will magically make you a
skilled programmer?

Are they not different skill sets? One is a practical skill, the other an
academic one.

I've met "programmers" who had depth of theoretical knowledge but couldn't
code their way out of a paper bag.

I've watched online lectures where Doctors of Computer Science lecture about
OO but clearly have no understanding of what works and what doesn't.

I will concede that being good at CS will give programmers an advantage in
solving problems in a subset of domains.

I suspect I could add the word small to advantage and subset and that
statement would still be true.

~~~
fwefwwfe
> Are they not different skill sets? One is a practical skill, the other an
> academic one.

I'd like to see you design and program a P2P networked program without any CS
knowledge, like Kazaa or Bit Torrent, that actually works as well as they do.

> I've met "programmers" who had depth of theoretical knowledge but couldn't
> code their way out of a paper bag.

That's true for lots of fields, but it's not hard to see that that doesn't
mean theoretical knowledge isn't useful.

~~~
jaggederest
It's a lot, lot easier to read papers on the algorithms needed by, and
understand the specific requirements of, a particular project than it is to
learn the entirety of software development outside algorithms ad hoc.

Honestly, even though I do know a fair bit about the Bit Torrent algorithms, I
_wouldn 't trust that knowledge_ since it's most likely out of date or
incomplete. It's deserving of research for anyone, even people who 'know it
already'.

That's why I don't understand these narrow algorithmic tests - very, very
seldom is a priori knowledge about DFS vs BFS going to be something that makes
or breaks a project.

It would be akin to testing civil engineers on the memorization of precise
ratios of the ingredients of concrete in current usage, instead of on the
broad applicability of particular materials to particular purposes.

~~~
solitus
Yeah, I'd love to know how they test civil engineers in interviews.

------
cperciva
This was an interesting quiz, but perhaps not the way the authors intended.
The second half was straightforward first-year computer science, but the first
half challenged me to speculate about the syntax of a novel scripting
language.

~~~
arohner
Agreed. I've been a professional developer for nearly 20 years. I've shipped
kernel C, windows C++, java,python, ruby, clojure to production, but the last
time I wrote python was nearly a decade ago. Since then, I've been firmly in
the Clojure community, with no intention of leaving.

I know I'm a good programmer, and I got nearly every python-specific question
wrong. I understand closures and call-by-reference tyvm, but I don't remember
or care about the quirks of python.

Triplebyte in particular seems to not care about the difference between "good
at programming" and "good at programming in python". The skillset needed for
C, python, clojure and JS are wildly different. They do a disservice to their
users by pretending otherwise.

~~~
ammon
For what it's worth, we run our interviews in the language of the engineer's
choosing (including clojure), and get people jobs at Clojure and Haskel and
C++ companies. We went with Python for this (toy) quiz because it's the most
common language we see among applicants. I tried to add comments to explain
anything python specific, and make the question about the underlying logic.
But it seems it's still easier for Python folks.

~~~
kefka
Sorry, not buying it.

I caught 3 "Whoops sorry you missed a weird bug in a specific programming
language that you weren't explicitly being tested on". Sure, if I was doing a
Python3 quiz, I'd expect those. But this wasn't what the quiz claimed to be.

Turns out, the "fill in the blank" code was easy, got all of them. Along with
all the 1st year theory questions.

~~~
horsawlarway
I agree. Coming in with a LOT of experience in JS and a good damn chunk in
c++, but none in python... this is really bad test.

You ask dev about aspects of the language that are essentially memorization:

Does matrix.append(x) in python append by reference or by value? Both are
equally likely without knowing anything about the language.

the question is also pretty easy to answer correct IF I know that, but I have
no reason to know that. You're not testing skill in any sense of the word.
You're purely testing familiarity with this specific language (and worse, this
language's standard library)

That's bad.

~~~
kbp
> Does matrix.append(x) in python append by reference or by value? Both are
> equally likely without knowing anything about the language.

I don't think they're equally likely. The question would have the same answer
in Javascript, Ruby, Lisp, Perl 6, Java, and many other languages. You can see
from the code samples that Python is a high level, dynamic, imperative
language, so I think it's fair to assume you would expect that behaviour from
it. There's a bit of guessing, but you can make an educated guess.

~~~
horsawlarway
Way late, but your response sort of proves the point. You're having to argue
about what I can infer about the language.

What JS/Ruby/Lisp/Perl/Java do is irrelevant. Hey, C/Go/D/C++ would all be
more likely to append by value, but neither of us care a whit because it's
asking about Python, which I know nothing about.

So (and this is really hard) try to forget that you've got experience with the
language, and approach it as a random pseudo language: this question has no
clear answer, because it depends on the memorized implementation details of
the standard library of a language...

That's bad.

\---

Finally: JS doesn't have matrix as a base type
(boolean/number/string/null/undefined/symbol is it, baby), so for this same
question, I'd strongly argue that you're simply wrong about bucketing JS with
those other languages. Again, for JS the question would revolve around the
implementation details of the matrix object and its prototype. Trust me, I can
write a useful matrix implementation that appends by value in JS.

~~~
kbp
> What JS/Ruby/Lisp/Perl/Java do is irrelevant. Hey, C/Go/D/C++ would all be
> more likely to append by value, but neither of us care a whit because it's
> asking about Python, which I know nothing about.

I guess my point was that you should be able to infer that Python would be
more likely to behave like JS/Ruby/Lisp/Perl/Java than C/Go/D/C++. If you know
or can tell by looking at it that it's much more in the first camp then the
second, then you should be able to guess. You're probably right that I
overstated how easy that is to tell just from the syntax if you don't know
anything at all about Python, but it's also pretty short of memorizing
implementation details.

> Finally: JS doesn't have matrix as a base type
> (boolean/number/string/null/undefined/symbol is it, baby), so for this same
> question, I'd strongly argue that you're simply wrong about bucketing JS
> with those other languages. Again, for JS the question would revolve around
> the implementation details of the matrix object and its prototype.

The 'matrix' in the question wasn't a special matrix type, it was just a list
of lists. Word-for-word translated into Javascript it would look like:

    
    
        let matrix = []
        let row = [0, 0]
        for (let i = 0; i < 2; ++i) matrix.push(row)
        matrix[1][1] = 1

~~~
horsawlarway
But that LITERALLY is memorizing implementation details.

Here are the rules for JS, which I happen to know, because I use it often:

1\. Javascript is always pass by value, but when a variable refers to an
object (including arrays), the "value" is a reference to the object.

2\. Changing the value of a variable never changes the underlying primitive or
object, it just points the variable to a new primitive or object.

3\. Changing a property of an object referenced by a variable does change the
underlying object.

Those are not trivial "just infer it" details. That's highly language
specific, and absolutely unrelated to the skills the test claims to be
evaluating.

------
FalconNL
The wording on question 9 (the regex one) is a little unclear: both b[l]. _e
and ([^b]_ b[^b]*){3} will match blabber but not babel. Presumably the
intended meaning is that the entire string must be matched, but the question
does not make this explicit.

~~~
ammon
Just added anchors to the expressions. Thanks for pointing this out!

------
StefanKarpinski
Cute quiz. Question 9 is incorrect, however – or at least poorly worded. It
asks about regex matches and only considers the last one to match, while the
second one also matches, albeit incompletely. The last regex is the only one
that matches the _entire_ input string, but that's not usually how regexes
work – e.g. in Perl or Ruby. This verbiage seems to be specific to Python,
which uses `re.match(str)` to mean "match the entire string" as compared to
`re.search(str)` which means "search for any matching substring". Arguably a
decent distinction, but very Python-specific.

[Update: this is now fixed in the quiz.]

~~~
tobyhinloopen
The given regular expression does not match `blabber`, it matches `blabbe`
(minus the `r`).

I got that one wrong as well. The question should have been "which regular
expression FULLY MATCHES X and not Y"

~~~
StavrosK
Nope:

In [3]: re.search("b[l].*e", "blabber")

Out[3]: <_sre.SRE_Match at 0x7f2db79ed030>

"Matches" means "matches". If they wanted "fully matches", they should have
specified "^$". That's why anchors exist.

~~~
tobyhinloopen
Yes, I agree. I just explained where it went wrong and that "Match" can mean
multiple things. It matches `blabber`, but the match result is `blabbe`.

------
isomorph
Got a few easy ones that were about language implementation details wrong
because I've never done Python. Only realised it was Python and not some kind
of beautiful pseudocode when I kept getting answers wrong

------
ammon
We've been using a quiz as part of our hiring process (at Triplebyte) for the
last two years. However, a lot of people do our quiz for fun. So we decided to
create a version optimized for this (and hopefully a little education). The
problems come from the most common mistakes / misunderstandings we see when
giving interviews, and ramp up in difficulty. We put a lot of effort into
writing interesting answers.

Let me know what you think!

~~~
chatmasta
If you're going to pick one language for the quiz (python) it seems a little
unfair to non-python developers to focus the questions on idiosyncrasies of
python. Whereas if all questions were of the more general algorithm variety
(like you see toward the end), non-python developers could infer the answer
without any esoteric python knowledge.

~~~
ammon
We talked a bunch about this. Python and JS are the two most common languages
we see on our site, and Python has slightly more compact syntax, which works
well in the questions. The idea, however, was not to require any python-
specific knowledge. Which question do you think is looking at syntax?

~~~
bussierem
Hey, not the GP, but just glancing through the quiz - Question 3 focuses on
the fact that Python passes things by reference to functions. This is
definitely specific to the two languages you guys use (as is your
prerogative), but if you're expanding this for others, you should definitely
explain that these focus on the JS and Python languages.

~~~
ammon
Good point. I _think_ that objects are passed by reference in a high enough %
of language in common use (PHP and C++ are the two exceptions I can think of)
that this is a fair question. But if enough people think it's bad, we'll
remove it.

~~~
marcosdumay
You got me on that too. A high enough % of the languages pass stuff by value
(C/C++), copy on assignment (C++, D, I'm sure there are more), or do not have
the concept of references or changes to start with (Prolog, Haskell).

Anyway, if you want to bias it into Python, go for it. It's a fun quiz.

~~~
Bartweiss
Copy on assignment was what got me, and I didn't feel terribly bad for missing
it. No harm done though, seeing as nothing was riding on the quiz.

------
keithnz
"True programming generalists are rare. This quiz covers basic programming,
web development, algorithms and low-level systems. The questions start easy,
but get harder fast. Only 3% of programmers can get all the way through. Can
you?"

This test doesn't cover any of that, makes me worry if they think it does.

it's more :-

do you understand python syntax?

do you understand a few algorithms?

do you understand a few security issues?

not sure how you'd go from this test to working out if a person is a
programming generalist. In fact I'd be worried that someone passing this test
would be fresh graduated from college where they used python.

------
dxbydt
imo, this is the right way to do interviewing. I'm currently interviewing with
several companies, and one thing that stresses me out is the expectation that

1\. candidate must discover algorithm to solve unseen problem

2\. candidate must code up algorithm discovered in #1

3\. candidate's code must work

4\. steps 1,2,3 must happen under 1 hour

I think this is a bit too much, and completely misrepresents the current
working state of professional programmers.

If I am asked to do #1, I usually do a literature survey - I read papers
before rolling my own algo from scratch. 99% of the time, there's a good
enough algo already out there.

If #2 - ok.

If #3 - not ok. Typically you need a debugger & 1-2 passes before you get it
right.

If #4 - definitely not ok. Step 1 itself can take you forever, and you don't
even know if its correct. Then you've got #2,#3...adding time constraint to
this mix is crazy.

So yeah, this quiz has two highlights: showing a block of code & asking to
fill in the blanks - much better, highly recommended. Also, looking at a block
of code & figuring out what it does - definitely part of programmer's everyday
work. I hope more companies adapt this technique.

~~~
j_s
A live example, from Uptake (Chicago):
[https://twitter.com/ch1gg1ns/status/867043938779222016](https://twitter.com/ch1gg1ns/status/867043938779222016)

~~~
zootam
i thought those were just for free tacos?

~~~
j_s
Hard to tell if you're joking or serious. (Either way: "Why not both?") Here
is the official tweet:

[https://twitter.com/Uptake/status/867105586336456705](https://twitter.com/Uptake/status/867105586336456705)

------
smcuiuc
I'm sorry but I just can't take a quiz/website/company seriously that assesses
programmer ability, and yet they put the freaking answer key in Local Storage.
Seriously, quizState? I got a 100%. ;)

{"questions":[{"name":"max_function","answerIndex":2,"question":"Fill in the
missing line of code:","code": ...

~~~
ammon
This quiz is just supposed to be fun :) We opted for speed over security, on
the idea that anyone who cared enough to pull out the answers deserves a 100!

~~~
smcuiuc
Gotcha. Just know it could give a bad first impression about the security of
other assessments and competence of the team. While I find these questions to
be quite flawed for the stated purpose, I really do wish you and others in
this space luck!

------
mhkool
This quiz is not a programming quiz but a Python quiz.

------
nsaslideface
If you only fail the regex, unicode, and hash security question you ought to
get a badge of innocence you can print and cut out

------
cousin_it
15/15\. Some questions felt like they were trying to trap me. Or maybe I'm
just tired, I've had a long day of work.

Congratulations on making this! It's less fun for me than algorithm puzzles,
but I can see it working well for hiring purposes. I'd love to see some
software company use it and report the results.

------
arohner
The quiz wouldn't pass security review, FWIW. The answers are shipped with the
javascript, and validation is done client side, so they're just an 'inspect
element' away.

~~~
perfmode
I'd cap scores at 5/15 for applicants who automate their responses.

I especially enjoyed the post-response explanation of the time and memory
bounds of iterative deepening.

It would be a shame to miss the opportunity to test one's skills on such a
well put together experience.

~~~
arohner
In a quiz with multiple security questions, I'd give bonus points to an
applicant who found security problems.

~~~
perfmode
Good point.

------
bensummers
On the last two questions, I'm curious why the ability to memorise which
algorithm to use is a useful skill for a professional software engineer, let
alone a useful interview question. Isn't the best answer "I would look up the
best algorithm by ..."?

~~~
ammon
If you understand the graph traversal algorithms in question, there's nothing
to memorize. You can just think through the problems. Is it important to
understand graph traversal algos? I don't think it is for everyone. But a lot
of people who like CS find it interesting. And if you work on, say, a web
crawler or a game AI, then you'll need them.

~~~
bensummers
The last two questions are little more than "what is the name of the algorithm
I should use to solve this problem?".

This doesn't test understanding in any way. How is it useful to determine
whether someone can work on the examples you give, let alone the average
software engineering job?

~~~
ammon
The goal of this quiz is to be a little challenging and fun and maybe
educational. It's not to judge whether someone can do a software engineering
job!

The answers to the graph problems are indeed fairly straight forward. But
asking about why one might use a BST in place of a sorted list prompts
interesting discussion. And going into Dijkstra's vs A* and iterative
deepening depth first search is (I think) pretty interesting!

------
Confusion
Concerning 12: timing attacks are not a relevant threat for hash function
computations. See [https://github.com/codahale/bcrypt-
ruby/pull/43#issuecomment...](https://github.com/codahale/bcrypt-
ruby/pull/43#issuecomment-15797932). Supported by our own tptacek here
[https://twitter.com/tqbf/status/866115075110825984](https://twitter.com/tqbf/status/866115075110825984)

~~~
tptacek
Whoah. Careful! Timing attacks aren't relevant _to password hashes_ , because
the user doesn't control the hash, only the input to the hash, whose output is
unpredictable. But cases like the TripleByte quiz, in which a user is directly
submitting a hash to check (typically: an HMAC on a message) are totally
relevant; in fact, they're the most common kind of legitimate timing attack.

~~~
Confusion
Yes, sorry, my comment is sloppily phrased. I should have been specific. And
then I may have realized I was wrong, because it wasn't about password hashes.

(It seems that tweet and the link were fresh in my memory: I automatically
interpreted the question as being about password hashes, although the code
actually does not imply that at all. And the linked thread is clear about the
difference between password hashes and other hashes, but it seems the 'simple'
message was more available to me than the deeper truth)

------
quiz_dude
Question for ammon : What's the time frame for expanding to remote jobs?

Question for other HN readers : How much did you score on the quiz? I scored
10/15 and it shows that I'm better than 50% of engineers i.e I'm somewhere
right in the middle. Not very encouraging, but if I brushed up on the graph
algorithms, I could have done better.

~~~
ammon
The truth is that there's just a lot less demand for remote engineers, and
among companies that do hire remote, it's usually for very specialized roles.
(There are obviously exceptions.) Looking at our stats, about 5% of the
companies we work with are interested in remote engineers. We're not going to
expand to remote jobs until we have that number up to a point where we can
provide a good experince. I don't have a time-frame, but not in the next 3
months (over the next 3 months we're focused on expanding to other cities)

~~~
quiz_dude2
Follow up question : In your faq, you mentioned that you do not interview
candidates who need visa sponsorship. Any plans to change that part?

~~~
ammon
Unfortunately probably not :( I would love to, but the jobs are just not
there. H1Bs are just too hard to get.

What I do hope to do is expand out of the US, and get around the issue that
way.

------
psyc
Seems extremely language-semantics specific.

------
chris54721
In the 3rd question, if you give the wrong answer, it says Java is pass-by-
reference as well, though IIRC it is always pass-by-value. Also JS passes
primitives by val as well if I'm not mistaken.

~~~
ammon
Well, objects in Java are only accessible via references. So the result is
behavior identical to Python and JS (primitives are passed by value, objects
are passed by reference)

------
yellowapple
> claims this is a generalist programming quiz

> first half focuses entirely on weird Python quirks.

Wew.

On the plus side, I still somehow managed to get 9 out of 15 right, which
apparently puts me above 50% of all programmers.

------
philh
Mildly annoyed at myself for getting question 8 wrong: the true answer was
what I thought that code would be doing, but the bytes didn't look like valid
UTF-8. I had a brainfart and thought that continuation characters were always
valid ASCII, so a string containing only characters >= 0x80 wouldn't be valid.

The (much saner) reality is that continuation characters are never valid
ASCII.

10 I admit I got through elimination: three answers were obviously wrong, one
could have gone either way.

------
steven777400
I'm not very familiar with Python but I liked this quiz. I got two wrong
(13/15), once for a stupid mistake and once for not knowing the algorithms
well enough. In a couple cases I didn't know the right answer, but was able to
determine that all other answers were wrong, which worked.

Overall, I think this is a good level of knowledge that isn't too nitpicky but
has enough meat to really test if someone knows something.

------
sowbug
This was fun. It's been a while since I took a multiple-choice test, and it
called to mind the Cluss Test <[https://www.recompile.se/~teddy/cluss-
test>](https://www.recompile.se/~teddy/cluss-test>). This test was fairly
cluss-resistant, as I don't recall making any inferences from the test's
format or language rather than its content.

------
MichaelBurge
14/15 - I missed the one where Python doesn't copy the row before appending it
to the matrix.

------
mikejmoffitt
This is a quiz about python gotchas.

------
estomagordo
I first found out about Ammon and Triplebyte through this YC video interview.
I thought it was interesting, so I'll share:

[https://www.youtube.com/watch?v=haxZDcTWdOo](https://www.youtube.com/watch?v=haxZDcTWdOo)

------
ifree
Too many language specific aspects.

------
JackFr
Reminded me why I dislike Python...

------
pmorici
Where do the percentiles come from that are displayed at the end of the quiz?
Are these based on a previous test sample group or are they being updated as
more people take the quiz?

------
dollaholla
Is there a JS equivalent of something like this out there?

~~~
ammon
If people like this, we'll be creating more version (in different languages,
and drilling into different areas)

~~~
dotancohen
Judging by other people's comments, this would be a good quiz if it was
written in their favorite language.

The quiz doesn't seem too hard to port (ha, I've heard "it won't be hard to
write" before). I think that a good approach might be to let the user see the
code in multiple languages via tabs or an interactive select element, like the
MSDN docs do.

------
jimmaswell
What's the deal with the warp searching question? There are both depth and
breadth first algorithms that can handle cycles. Bit annoying since the
example I had in mind was Djikstra's but it turned out that was classified as
a BFS instead of DFS like I thought it was. Finding the shortest path from A
to D in 4 steps for example seemed more "depth" to me, but maybe the algorithm
as a whole doesn't neatly fit into either.

~~~
WoodenChair
I think you're misunderstanding the point of the question. BFS is guaranteed
to find you a shortest path in terms of "# of hops" in an unweighted graph.
DFS is not.

------
scott00
Is this intended to be taken with access to references and a python
interpreter, or closed book?

~~~
ammon
Either way. It's just supposed to be fun / interesting

------
sharemywin
I only got 50 percentile which I thought wasn't bad for not knowing python

------
bstamour
I would have done better had I known how python does parameter passing...

------
pfarnsworth
I took the Triplebyte quiz on Facebook and after finishing, they didn't even
bother giving the score. It was very outputting, and felt like a trap, asking
for an email address instead of giving the score. I won't ever be doing
business with them.

~~~
ammon
Ah, you're talking about going through our regular process and looking for a
job? In that case, we try to make it clear that what you're doing is applying
for a job (and we require an account creation at the beginning of the
process).

This quiz posted here is something we created because some people (like you?)
are applying to our process just to answer the questions. So we created this
version (which does not require an account creation or ask for an email) and
totally gives you a score and shows what we think the answers are.

~~~
unusximmortalis
I took the 35 question quiz. At the end it told me I passed and I shoul wait
for feedback on how to move next but after a day I got an email informing me I
failed.

------
mrkgnao
I like the idea, but my first reaction was that this is a test of how well you
know Python's quirks (like the problems with not deep-copying things).

But then I realised that that's not true. For example, call-by-value and call-
by-reference are pretty pervasive across languages: many of those examples
would've worked the same in Java, say. It's not familiarity with Python, but
rather familiarity with a certain kind of language (which admittedly
constitutes the majority of those used in industry ATM) that the test demands,
at a time when even Java is getting nice FP-like abstractions and the
JavaScript community is cooking up all sorts of ways to bring the benefits of
that kind of thinking to their own work (from React/Redux all the way to Ramda
and the like).

If you're more used to languages that "get out of the way" by eliding what
could very well be termed "implementation details" (e.g. is there any
reason[0] to use call-by-reference in the absence of global mutable state
given a "sufficiently smart optimizing compiler"?), I'd predict (n = 1) that
you'll be more likely to make mistakes.

I would've done far better on this quiz back when I was playing with
matplotlib as an eighth- or ninth-grader: apart from the token _map_
implementation, the quiz really favors knowledge of counterintuitive behavior
common in "mainstream" imperative languages over an understanding of
"composability" that users of modern functional languages are used to. (And
no, that doesn't only mean Haskell or "ultra-Haskells" like Idris, but also
languages like OCaml, F#, and so on.)

It would be much nicer if the quiz could be less about the candidate coaxing
her preferred meaning out of a language implementation and more about testing
the meanings a candidate knows how to implement with the help of the language.

[0]: For instance, the standard reaction to things like

    
    
        sum (map (\x -> x ** 2) (map (\y -> sin (y * pi / 10)) [0..9]))
    

is that a single for-loop is better than this for "real-world purposes". That
is very false: the Haskell _vector_ package is usually capable of efficiently
fusing the code above into exactly what one would've written by hand.

[https://www.schoolofhaskell.com/user/commercial/content/vect...](https://www.schoolofhaskell.com/user/commercial/content/vector)

At the risk of going all peak-HN, these things are more a problem with
implicit, nonuniform behavior which well-designed languages solve with
abstractions like the Copy trait in Rust or even C++ move semantics.

------
golergka
Failed two questions in the first part because I don't understand Python tree
syntax and don't know what does it pass by reference and what by value.

Would be great if authors translated it to at least a couple of other
languages.

------
greatNespresso
Thanks a lot for that short quizz !

------
lerie
its a python quiz.

------
nottorp
Someone please change the title to "15-question python programming quiz". Or
python and js? I stopped at the 2nd python "trick" question.

Also, remove the "generalist" reference. Generalist those questions aren't.

~~~
Tharkun
A bit harsh to make a generalist judgement if you quit after two questions. I
don't know any python and still did pretty well.

~~~
nottorp
It was their 'generalist' statement that made me quit.

------
RodericDay
Expected to dislike it, but ended up liking it quite a bit.

------
s3nnyy
I admire triplebyte's effort and the content they produce. Their narrative is
really data-driven common sense: some engineers fit to some companies but not
to others. Especially enjoyed: [http://blog.triplebyte.com/who-y-combinator-
companies-want](http://blog.triplebyte.com/who-y-combinator-companies-want)

I am a programmer and I run
[http://www.coderfit.com](http://www.coderfit.com), a tiny recruiting agency
in Zurich / Switzerland (reach out to me via e-mail address in my HN-handle if
you look for a tech job in Zurich). Recruiting is really, really hard and I am
happy to see platforms like [http://interviewing.io](http://interviewing.io)
and [http://triplebyte](http://triplebyte) popping up that give programmers
without classic CS background a chance.

