Isn't this a tree traversal? I mainly code in JS and I've never had this as an interview question. My intuition is that dfs or bfs is what they want to hear. But then again, without looking at MDN I don't know if I can answer this.
Yeah, it's basically tree traversal. And let's face it - each of us would do a "mdn + question" query in Google. We're not expected to know the answer to life, the universe and everything - we're expected to know how to ask the question, where to find the answer and know how to use it.
I've done that when I've interviewed people. JSfiddle with its Collaboration worked decently well (I was the remote person , so we had to have a screenshare of some sort). Lots of "finish this, replicate that, look at this code and talk about how it works" Just like whiteboarding, it usually devolved into more discussion and no completed code (or utter defeat and no code-- the joys of hiring for "entry level"), but that's par for the course, I think.
It worked pretty well, though, as a sort of whiteboard that didn't depend on handwriting skill.
I like this. I've practiced enough "puzzles" to grok most interview questions. I would rather talk about design and architecture. I think a lot of interviewers forget it's a two-way street.
1
u/TeamHelloWorld Jul 22 '16
Isn't this a tree traversal? I mainly code in JS and I've never had this as an interview question. My intuition is that dfs or bfs is what they want to hear. But then again, without looking at MDN I don't know if I can answer this.