I agree as a candidate it can be demoralizing, but thats the exchange usually - prove you can do the job (or something close to it) and you get hired for it. It's just that your job isn't street sweeping or generalized labor -- and it's helpful to know if you're going to be the type who: Couldn't write leftpad without a library, would depend on leftpad as a library, or would understand the implications of using a library like leftpad and rely solely on trusted functions like isEven instead.
Yes, you're a programmer, you will get libraries in your day job - but as your hiring manager, I don't have the time to tell you you won't have access to most of the ones you're familiar with because we're doing real-time or large-scale compute or javascript widgets on embedded devices - I just wanna see you do as asked.
If you decline - I've seen what I needed.