Ask HN: “Expert Level” JavaScript questions?
31–40 of 54 posts
Re: Ask HN: “Expert Level” JavaScript questions?
#32Good advanced JS questions (in my opinion) will involve things that are useful but also challenging, like details about promises, prototypical inheritance (that one is debatable, since some JS experts avoid that), the browser event loop, etc.
Re: Ask HN: “Expert Level” JavaScript questions?
#33Not exactly what you want, but that's still what I'd ask.
That will tell me more about the candidate's abilities than syntax questions or other silly things like that. INCLUDING how good they are at syntax and silly things (the way they speak will show it).
What I like about these kind of open-ended problems, is that it accounts for variety of backgrounds and skillsets. People can surprise you with solutions and ideas you'd never have thought about.
It does require 2 things: 1) make it absolutely clear that this isn't a question with a predefined answer. 2) you have to be open minded about how the candidate answers.
Most frontend devs will go through their frameworks of choice, project structures, backend tooling preferences, how they sketch a UI, how they work with designers, etc. I had one once walk me through a complete system architecture analysis. We gave them an offer to lead our devops team ;)
Re: Ask HN: “Expert Level” JavaScript questions?
#34A year later another guy from "same book store" asked me to center text in a div during a live screen share.
So, YMMV and its all parlour tricks anyway.
just.apply(you, ['who', 'knows', 'anyway]);
[1] https://jsfiddle.net/ronilan/c27n8f2j/Re: Ask HN: “Expert Level” JavaScript questions?
#35Reimplement things from scratch. I’d recommend implementing Promises from scratch as well as several Async [0] functions like auto or series. Both are questions I’ve asked of senior level JS/Node engineers. This isn’t exhaustive but it’s good practice for sure. Good luck! [0] https://github.com/caolan/async
That must be downright hilarious, depending on how the question is asked. Promises are an absurdly complicated construct considering how little they actually do. If you don't give the candidate the expected spec, 95% of candidates won't get even close. If you do, working through the answer will take long enough that the candidate (and honestly, the interviewer) might get bored.
If you simplify the problem space a lot and ask for a minimal "promise-like"-ish construct, then It can be an interesting coding exercise I guess.
Re: Ask HN: “Expert Level” JavaScript questions?
#36There are some weird corners of JavaScript that I went years without knowing. Did you know object literals support getter and setter methods[1]? As other commenters will point out, such quirks are as easy to look up as they are irrelevant to actual software development. [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid... "Defining getters and setters"
Re: Ask HN: “Expert Level” JavaScript questions?
#37Earlier quoted context omitted.
.map(fn) calls its callback with three arguments, the value, the index, and the full array. Then parseInt takes two arguments, the string and the base (radix). "1" of base 0 is 1 "1" of base 1 is NaN "1" of base 2 is 1 The gotcha here is if you map(fn), you're going to get all three arguments sent to the fn, where map(v => fn(v)) explicitly only sends the first one.
I see. I'll remember this example for when someone asks why you need types.
Re: Ask HN: “Expert Level” JavaScript questions?
#38There are the run-of-the mill senior level generic questions about high level knowledge and procedure. I'll ignore those since you asked specifically about expert level general JavaScript knowledge (not specific to node or front end): You might see a dumb question that is just a bunch of spaghetti nonsense you'll have to unravel. Explain what this ridiculous codeblock does. Definitely expect to see closure-based prob…
Re: Ask HN: “Expert Level” JavaScript questions?
#39Senior roles require that you can break down large problems into digestible chunks. "gotcha" questions don't tell an interviewer how good you are architecting, or how well you understand the language. "gotchas" are usually easily Google-able too. I've asked a lot of code structure questions. JS really easily turns into spaghetti code if a dev isn't careful. I like to test candidates on whether they make code understa…
On the other hand, ""gotchas" are usually easily Google-able too." isn't that simple. You don't know what you don't know. We're in a world now when even some extremely senior devs don't know the tools they use. A lot of it can be blamed on the whole "if you know one language you can learn any other in an afternoon!" tenet. Having so few people these days with vertical/deep knowledge of the tools they use gets really annoying when trying to deal with major production issues and no one in the room can debug them in a timely manner.
Almost makes me think that some form of "tech guru" role should start being a thing, and THOSE people could be interviewed with the stream of obscure gotchas...because sometimes you need a tech guru.
Re: Ask HN: “Expert Level” JavaScript questions?
#40A good interviewer will start at a high level and drill down into what you're experienced with, rather than pick an obscure topic and assume you've done your homework. For example, they might ask for a hard problem you've recently solved in your last company. If you say something related to code splitting, you can expect he'll drill down more specifically into webpack, dependency cycles, etc. If you say something rel…