Read the original in CodeThat.today
A lot of times when we have upcoming interviews there are cases when you will be asked to do a technical task ...
For further actions, you may consider blocking this person and/or reporting abuse
To reverse a string why not just...
Try not to aggregate the interviewer. They need to see more than one liners. If you wrote that for example I would ask you to implement
array.reverseYou stated this was an exercise to warm up specifically for a JS interview.
There are many ways to solve the problem - each demonstrating different areas of knowledge. A good interviewer would appreciate the knowledge and use of modern JS techniques (arrow function, spread operator) - since, after all, it is a JS specific interview.
Why would you ask someone to re-implement
array.reversein a test that is about Javascript? Any implementation you could make is likely to be slower than the built in one. That question would belong in a test about algorithmsI would say that any live coding interview questions tend to test you about algorithmic thinking. It's not only about the language. Also, If you can manage to code a dynamic programming task but not a simpler one like array reverse then the interviewer might think something is fishy here.
If that is what they want to test, they should ask for such. As this is framed as a JS interview it would be in the candidate's best interests to highlight their skill in Javascript over general programming ability unless asked otherwise.
If I were interviewing for a JS position, and the candidate's solution proceeded to reinvent the wheel, I would question why they had done it that way. On the basis of that answer I would decide whether or not they're a good fit for a specifically JS position
It is framed as a Javascript interview but it's not all about Javascript. Javascript may be hot now, but not tomorrow. Algorithms stay longer. That is the mindset.
Unfortunately, not all interviewers are kind to tell you what kinds of tests they will ask you. They could ask you anything. The idea is to be prepared as much as possible.
Thank you for the post. 🙂
On (2) filter number,
I've just modified as following
The output is the following.
.
It might be better to add null checking on filtering. :)
I continue reading 3)... 🍣
Thank you.
Cool!