Hacker News new | ask | show | jobs
by kylemaxwell 5003 days ago
"Competant [sic] developers, even those who don’t specialize in JS, should be able to answer this question in 5-6 minutes. Therefore, this is a quick filter."

This is a false statement. I have programmed for years, but never in Javascript, so I have no clue what "add a cache to a Javascript function" even means. I can quite easily write code "that determines if a number is prime", but the assumption that everybody knows JS even if they don't "specialize" in it is problematic from my PoV.

3 comments

I think it just means add memoization, I don't think there's anything javascript specific about it.
If you want to implement it in a general way you still need to know how javascript supports closures though.
The question actually has nothing to do with JavaScript specifically, it's not much more than 'do you know what memoization is' if I understood it correctly.
I wonder if H1B hires have to go through this process. Does anyone go to India and ask people if they know how to cache an item in Javascript?