Any downsides in using JavaScript for coding interviews? I would like know your experience using it. I am aware of the fact that there are some data structures not available out of the box in JS. How to navigate this issue during the interviews? YoE: 10 yrs TC: 185K
Pick only if you’re comfortable with it - n dimensional matrix/ priority queue for instance if going to be tricky.
How to deal with a priority queue based question then? Can I code the solution assuming there is a priority queue DS out of the box?
If you're in an interview where you don't have to run the code, or one with external libraries, it should be fine
no heaps, no treemap. everything else should be fine though
I love javascript for coding interviews! Its so much less typing than c#/java. No semicolon, declaring map, set, object, array is just so much simpler in js compared to c#! For the missing data structures, i have said something like js doesnt have a native support for priority queue so I would import some external package in real world but for the sake of the interview, I will use the api of java/c# priortiy queue. This approach only works where you dont have to actually run your code.
Btw I haven’t had much success with my interviews, so may don’t do what I said 🤷♀️
I like the simplicity of writing code in JS too. I hope what you suggested is acceptable.
I use JS for all my whiteboard interviews. It's been fine.
Did you have any interviews where you had use to an editor and output mattered?
Not in JS. I did one in Java, though I don't remember if they asked me to do Java or I did. I feel like JS doesn't really have much of an advantage when you have an editor at hand.
Did dozens of interviews using js. Got multiple offers from faang and other big tech (fb included) It is perfectly fine. For priority queue just make up an api. If they expect you to run code (most dont) then I would implement a very simple pq with a sorted array and make it clear that there is better way to do it
Make sure to avoid complicated syntax. I once nearly rated lower candidate for having something like arr = [] for c in container { arr[i] = c]} <-- arr[i], assign ith without pre-allocating I thought that will cause NPE or something but when tested in console, apparently it works. SO AVOID STUFF LIKE THAT, you can get someone worse than me who will assume npe without testing
I've always used JavaScript and never had a problem. I also have never asked a question where JavaScript wasn't a feasible choice.
Have you used it in FAANG and top tech interviews? How did you deal with problems that involved priority queues and stuff?
I used it in Google, One problem i faced is there are less interviewers in JS. So my interview got scheduled after few extra days than normal languages