A Hashmap isn't "better." For example, if you need to optimize for memory, running a bubble sort on a character array will be the most compact solution.
Likewise, if you profile, there's no guarantee that a hashmap is faster or slower, or even more readable. It gets into the nitty-gritty of how memory allocation works and the overhead of maintaining a hashmap versus whatever optimized character sorting algorithms are part of your runtime.
Anyway, I've found that companies that want to ding me for those kinds of things aren't worth working for. IMO, we're better off having an industry-standard licensing board. Plenty of other industries do the same thing.
Edit: I've also spent an afternoon with a FAANG's set of practice programming challenges. I won't go into details out of respect for confidentiality, but they weren't unreasonably difficult. I only want to work with people who can solve "most" of them. (No one's perfect.)
The best analogy is like being a musician or an athlete. Anyone can learn to play an instrument or play a sport, but to be a professional musician or athlete requires something that takes more than practice. No one's excluded from those industries due to lack of talent, but the people without the talent have to take the jobs that support the musicians and athletes.
Likewise, if you profile, there's no guarantee that a hashmap is faster or slower, or even more readable. It gets into the nitty-gritty of how memory allocation works and the overhead of maintaining a hashmap versus whatever optimized character sorting algorithms are part of your runtime.
Anyway, I've found that companies that want to ding me for those kinds of things aren't worth working for. IMO, we're better off having an industry-standard licensing board. Plenty of other industries do the same thing.
Edit: I've also spent an afternoon with a FAANG's set of practice programming challenges. I won't go into details out of respect for confidentiality, but they weren't unreasonably difficult. I only want to work with people who can solve "most" of them. (No one's perfect.)
The best analogy is like being a musician or an athlete. Anyone can learn to play an instrument or play a sport, but to be a professional musician or athlete requires something that takes more than practice. No one's excluded from those industries due to lack of talent, but the people without the talent have to take the jobs that support the musicians and athletes.