Answer the question
In order to leave comments, you need to log in
Are tricky interview questions appropriate?
I am interviewing JS developers of different levels and I have doubts about the appropriateness of such questions, for example.
What is the difference between these two calls and what will happen in the browser?
(function() {
function loop() {
console.log('loop');
setTimeout(loop);
}
loop();
})();
(function() {
function loop() {
console.log('loop');
return Promise.resolve().then(loop);
}
loop();
})();
Promise.resolve(1).then(res => console.log(res));
Promise.resolve(1)
.then(Promise.resolve(2))
.then(res => console.log(res));
Promise.resolve(1)
.then(res => Promise.resolve(2))
.then(res => console.log(res));
Answer the question
In order to leave comments, you need to log in
Weird question.
Everything is fine in an interview. You do not forget that the interview is not an exam.
This is a dialogue between two sides. If the candidate does not like the question, he can get up and leave.
If he does not know the answer, he can compose something, and if you are a competent specialist, you will see that he guesses here or knows for sure.
I have a small questionnaire for interviews, in which almost every second question comes with a little catch, and by the completeness of the answers, I understand how deeply the candidate fumbles. But I do not always need to find someone who will answer all 100% of the questions in detail.
I just appreciate that the candidate knows, and what he encountered so regularly that he directly remembers the details without a manual.
Therefore, questions that may relate to deep nuances can not be asked to everyone in a row, but when you want to clarify how deep the rabbit hole is. Put before a difficult question one simpler in this topic and see if it makes sense to ask a more difficult one. Well, it’s worth globally assessing how important the correct answer to this topic is - it happens that you just didn’t have to deal with and deal with this, but on occasion, the answer is really immediately googled, and it’s not necessary to know this by heart
Specifically, these questions are quite appropriate. But I would formulate them in such a way as not to confuse a person, he is already stressed, and with the current hunger in the market, there is no point in weeding out smart people just because they are a little confused.
1) This is about knowing the difference between how the queues of micro and macro tasks are emptied.
2) This is for knowledge of promises
It is quite covered by the usual questions about how it all works.
It is appropriate if you have this in your code, if you never see a similar example in your code and next to it, then the meaning of the question?
If you are interviewing some kind of middle, then check his thinking, why not.
there are questions that, if the person does not answer, you will still take, so to speak, tasks with an asterisk. But if there is a candidate who will answer such a question, then you simply give preference to him, and not to the one who did not answer. This is when the candidates answered the same basic questions in the same way and the others are equal
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question