3 ms·
Did they mean HashMap or were they using a fancier word for key/val store? Were they expecting you to account for collisions? If you ever have an array of a f
by cheapsteak 11y ago
Did they mean HashMap or were they using a fancier word for key/val store?
Were they expecting you to account for collisions?
If you ever have an array of a few thousand or hundred thousand items, knowing how to make a hashmap can be pretty useful for performance even in js
- lhnz 11y agoThey were Java developers so I think they were coming at the interview from the perspective of Java developers. I wish I'd known this beforehand as I could have markedly improved my answers by bearing this in mind and explaining myself better. For example later on they were trying to test me on JavaScript type irregularities. I did not realise that `typeof null === 'object'` or think this was important in practice (although I expressed no surprise as when I'm trying to test any JavaScript type I generally use a high-level interface to avoid JavaScript 'wat' moments). They seemed to think I'd be doing if-elses at the top of each function in order to perform the type checks that Java would have given me for free. I mentioned that 'flow' would be a better idea if you weren't happy with duck typing, but this probably sounded like I was trying to dodge the question to a Java developer. In practice when you're writing JavaScript code, it's popular to be lax about this kind of thing and write code like `config || {}.property`. In conclusion: I think that Computer Science is useful but less useful here. I'm actually now mid-way into some Coursera algorithms courses for my own personal learning as I think they'll be very valuable in other tasks. I think the problem was that you could tell that they were primarily Java programmers by the topics that they gave importance. I'd say there's a strong chance that they'll hire somebody with a similar skill set to themselves and will not end up writing natural, best practices JavaScript. People hiring in languages and domains they do not know well can bias themselves with the wrong kinds of questions and opinions. This seems to be a common interview failure case.