<story><title>Show HN: 15-question programming quiz with answers</title><url>https://quiz.triplebyte.com/</url></story><parent_chain><item><author>graphememes</author><text>This is very python specific. While I got a 15&amp;#x2F;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.&lt;p&gt;This isn&amp;#x27;t a generalist quiz, nor is it a good baseline for interviewing candidates for the hiring process, this wouldn&amp;#x27;t tell me anything about the application of their skillset.</text></item></parent_chain><comment><author>squeaky-clean</author><text>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).&lt;p&gt;It basically relied on this fact...&lt;p&gt;&lt;pre&gt;&lt;code&gt;    x = 256
    x is 256  # True

    y = 257
    y is 257  # False
&lt;/code&gt;&lt;/pre&gt;
Which for one, you shouldn&amp;#x27;t use `is` to compare integers in Python. I wish I could have just written that as my answer.&lt;p&gt;Secondly, you need to be aware the CPython uses an integer cache which causes the answers to be different. You&amp;#x27;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.&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;stackoverflow.com&amp;#x2F;questions&amp;#x2F;15171695&amp;#x2F;whats-with-the-integer-cache-inside-python&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;stackoverflow.com&amp;#x2F;questions&amp;#x2F;15171695&amp;#x2F;whats-with-the-...&lt;/a&gt;&lt;p&gt;There wasn&amp;#x27;t any point to the quiz, so it&amp;#x27;s okay that they put in silly questions like that. But it&amp;#x27;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&amp;#x27;s.</text></comment>
<story><title>Show HN: 15-question programming quiz with answers</title><url>https://quiz.triplebyte.com/</url></story><parent_chain><item><author>graphememes</author><text>This is very python specific. While I got a 15&amp;#x2F;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.&lt;p&gt;This isn&amp;#x27;t a generalist quiz, nor is it a good baseline for interviewing candidates for the hiring process, this wouldn&amp;#x27;t tell me anything about the application of their skillset.</text></item></parent_chain><comment><author>MaulingMonkey</author><text>I consider myself barely Python literate (I&amp;#x27;ve modified maybe 5 python scripts in my life) but also managed 15&amp;#x2F;15.  Most of the relevant core semantics are extremely common to dynamically typed scripting languages:&lt;p&gt;- Reference semantics for pretty much everything, except perhaps basic types such as integers - but those are generally &amp;quot;immutable&amp;quot; (e.g. no 5.add(6) mutating the &amp;quot;original object&amp;quot; in-place) making by-reference vs by-value moot.&lt;p&gt;- Arguments &lt;i&gt;copy&lt;/i&gt; the reference, they do not alias the original reference.&lt;p&gt;- Mutating functions, if the return value isn&amp;#x27;t being used, are either being misused (e.g. the code has a bug) or mutate the original object in-place.&lt;p&gt;- Closures alias the same variables&lt;p&gt;This could be JavaScript, ActionScript, Ruby, Powershell, Squirrel, PHP, ... hell, even a lot of the compiled statically typed languages share similar semantics.  I&amp;#x27;d expect someone coming from, say, a pure C&amp;#x2F;C++ background to have some trouble though, which is perhaps the point you&amp;#x27;re getting at.</text></comment>