Companies don’t want average programmers. They want great programmers, but settle for good ones.
Programming interviews suck, but you’re not being asked to do anything that thousands of other programming candidates haven’t.
If gave you the option to raise your salary by $20,000 with the stipulation you study a book on your own time for 2-weeks, would you take me up on that offer?
Programming Interviews are a skill, and like all skills, it can be learned and improved with enough practice.