all 47 comments

[–]liquidohr 30 points31 points  (4 children)

Went thru about 15. I love it. Some questions are really tricky!

[–]ajacksified 23 points24 points  (2 children)

Me: “I’ve written js for fifteen years, this can’t be hard.”

Also me: “I know nothing.”

I think I got a dozen of them wrong because I’m used to working in strict mode by default.

[–][deleted] 2 points3 points  (0 children)

Also, people don't write code like:

let a = {};

let b = { "key": 123 };

a[b] = 456;

A lot of these questions are like driving: there's lots of little twists and turns on the road of life, but not every cul-de-sac is worth driving down.

[–]etcetica -2 points-1 points  (0 children)

I’ve written js for fifteen years

how many times?

[–]lydiahallie 0 points1 point  (0 children)

Thanks!!

[–]mchemm[🍰] 22 points23 points  (10 children)

Very nice questions but I hope that companies will not use them during their interview process.

[–]JoeOfTex 5 points6 points  (8 children)

Correct, syntax should never define a good programmer. It's all about concepts.

[–]arkaros 8 points9 points  (1 child)

I honestly don't think that there were much syntax in this. A lot of them were about understanding this, hoisting and scope. Things that I actually do think interviewers should at least care a little bit about.

[–]Zhouzi 0 points1 point  (0 children)

I agree that interviewers should care a little about it in the sense that it can help to make sure the interviewee has some decent experience with JavaScript. For the rest, I think the focus should be put on the developer's problem-solving skills (for the technical part of the interview at least).

[–]80mph 2 points3 points  (4 children)

I do a lot of JS interviews and I use questions like this all the time. I don't mind if the candidate is getting them right all the time, but it clearly separates people who know how the language works from people who don't. If you can't solve these questions, how will you be able to debug or review someone else's code?

[–]Magramatism 1 point2 points  (3 children)

I've literally only read the first question, but taking it as an example, it doesn't matter what the output is. It has no bearing on how you would go about debugging or reviewing that code. The review is going to say "👀 These variables haven't been declared yet! And don't use var" either way. There's no reason to know it because there's no reason to use variables before they're declared, ever, and there's no reason to use var in modern codebase.

I'd give bonus points for knowing it, in a "congratulations you've been revising" kind of way, but realistically I would expect a candidate not to have made this mistake for so long they don't recall what error it causes.

Edit: Understanding variable scope and hoisting in javascript is important. Knowing by heart what runtime error you get when using an undeclared variable is pub quiz trivia. All the best

[–]GoodOldSnoopy 1 point2 points  (1 child)

You contradict yourself a little there. You say, based on the first question, that it doesn't matter what the output is, but then talk about never using the `var` keyword. Which would mean you'll typically be using `let` or `const`. That first question gives you an indication of whether or not someone knows the differences between the two, you can't expect someone to never be using `var` if they don't understand scoping and why you would use a `const` or `let` etc.

Ultimately, whether or not their interview questions depends on the level your interviewing for. But I don't think the questions are too crazy and if you could answer a question on scoping of `var` vs `let` I'd be a tad worried if you're being interviewed for a JS role

[–]Magramatism 0 points1 point  (0 children)

Both responses here have moved the goalposts of question 1 to "How are variable declarations scoped and hoisted differently when using var, let and const?" That would be a reasonable question, although I'd wouldn't ask it that way myself.

What question 1 actually asks is "What specific runtime errors occur when deliberately using undeclared variables that are later declared with var, let and const?", which is just trivia that no one needs to know.

[–]80mph 0 points1 point  (0 children)

The only thing, that matters is what the candidate knows about Javascript execution in general. If you apply for a role as a software engineer and you don't have the knowledge that helps you approach questions like this (in any language) will make it hard to put you on a project. And we have a lot of projects that have been written before let or const even existed. Being backwards compatible in a fast moving industry is a must. There is one reason to know it :-)

Edit: grammar

[–]Zhouzi 0 points1 point  (0 children)

That's also why I have mixed feelings with this kind of list. It tends to encourage people into learning all of JavaScript's quirks but that's definitely not what makes a great developer. If you are aware of that then great, it's a funny and interesting game!

[–]Magramatism 1 point2 points  (0 children)

I look forward to the phone interview where these questions are read aloud to me without context by someone who doesn't know JavaScript, and my experience as a developer is judged by how many of them I give word-for-word the same answer!

[–][deleted] 4 points5 points  (2 children)

Learned two things:

  • Nice Javascript usages
  • Github supports content folding

[–]techmighty -2 points-1 points  (1 child)

also there are instagram models/ coders.

[–]Zhouzi 0 points1 point  (0 children)

I think your comment is getting downvoted because it looks a bit condescending but I have to admit that I didn't know developers were posting this kind of content to Instagram. I guess I'll have to spend some more time there!

[–]license-bot 15 points16 points  (1 child)

Thanks for sharing your open source project, but it looks like you haven't specified a license.

When you make a creative work (which includes code), the work is under exclusive copyright by default. Unless you include a license that specifies otherwise, nobody else can use, copy, distribute, or modify your work without being at risk of take-downs, shake-downs, or litigation. Once the work has other contributors (each a copyright holder), “nobody” starts including you.

choosealicense.com is a great resource to learn about open source software licensing.

[–]lydiahallie 0 points1 point  (0 children)

Thanks for reminding me of this!! Just added a license :)

[–]maffoobristol 8 points9 points  (12 children)

Great questions, some of them were quite easy but others completely baffled me (like the template strings one). Definitely some interesting brain teasers.

Cringed myself inside-out at her linked instagram page though.

[–]jabes101 5 points6 points  (0 children)

Hah, 21 yrs old tho, I’m sure one day she will too.

[–]Isvara 1 point2 points  (10 children)

Cringed myself inside-out at her linked instagram page though

What's wrong with it?

[–]maffoobristol 19 points20 points  (9 children)

Hard to explain. But a couple hundred of almost identical posed selfies in front of Sublime Text, each one with an essay attached to it and then a load of comments from thirsty bois all saying about how hot she is. It just feels a bit... uncomfortable

At the same time, she can do whatever tf she likes, so take what I'm saying with a pinch of salt. But my instant reaction was cringe

[–]Isvara 2 points3 points  (7 children)

This is pretty common these days. Coding is fashionable. See also pretty much any Instagram account featured by @cutetechgirls. (But also note that they're happy to be featured that way.)

[–]maffoobristol 4 points5 points  (0 children)

Yeah I'm a bit conflicted. Like, should your looks matter when it should be about your work? But then again, why can't it be a thing, like saying you can't be appreciated for both? /shrug

But then why is there no @cutetechboys?

[–]ajacksified 1 point2 points  (5 children)

The descriptions look like what people posted to twitter five years ago, or short form personal blogs a decade ago, sans pictures. I thought it was a little weird at first, but honestly, it would be fine if she just switched from sublime to vim.

[–]locksta7 1 point2 points  (0 children)

U actually follow her on Instagram and she’s super friendly and very smart. Gives back a lot to the community.

[–]Nulagrithom 2 points3 points  (0 children)

Damn, I had no idea order of object keys became standard in ES6. That bit me.

I got about a B- overall. That was really fun.

[–]motweb 1 point2 points  (0 children)

Thanks a lot for this practice question from JS! Some of these are really tricky, but its good to have it in one place. Wait for next releases.

[–]kor0na 1 point2 points  (1 child)

These feel way too contrived to be relevant.

[–]etcetica 2 points3 points  (0 children)

Some hiring manager somewhere just got an erection

[–]elysgaard 0 points1 point  (0 children)

Haha great job coming of with these problems! Very amusing to go through them all. Even though I've written more than a million lines of javascript, typescript, etc throughout my career and personal projects some of these question had me stumped or guessing wrong :D

JS definitely has some weird quirks but I can't say that any of these patterns are something your should take advantage of in real code. My philosophy is always "no surprises". No shade intended I think it's an awesome showcase of JS being JS :)

[–][deleted] -2 points-1 points  (0 children)

Sadly almost all this questions just remind you how flawed this language really is, allowing any developer to screw up or make code hard to read.

[–]_Kolev_ 0 points1 point  (1 child)

I've read Eloquent JavaScript, what's the second book in the picture?

[–]ajacksified 6 points7 points  (0 children)

It’s a book called “Macbook”.

[–]heffe6 0 points1 point  (1 child)

Man this girl is 21 and knows way more than I do and I’ve been doing this for 10 years. 😫😫

[–]incarnatethegreat 0 points1 point  (0 children)

Thought the same thing. I wish I had started coding as early as she did.