It's probably a contrarian opinion in the age of coding katas, dojos, challenges, courses, "academies", and such but I think the best way to improve is to actually work on things that interest and challenge you personally. You'll always be your own harshest critic, but at least when using your own projects for training you're working on something real and without the artifice of challenges someone else thought up.
If you were baffled by the challenge itself, that's probably because you never encountered that particular problem before. This is fine, everybody's got to make decisions about how to spend their resources, including what to learn. If you feel this was something you should have known how to do, take it as a sign and go find out more about that subject.
On a larger scale though, I think interviewing coding challenges are starting to have the same drawbacks as the millions of, say, Javascript coder academies out there: it's that form of artifice which distances the challenges from the real world. Instead, and I believe increasingly, they measure something entirely separate from solving actual programming problems: solving coding challenges in a vacuum.
It's becoming our industry's form of standardized testing. You can learn to do well at it, but beyond a certain level of expertise I'm skeptical this is coupled to actual engineering prowess.
You might say: "okay, but if this is a skill I need to know in order to get hired, so be it", and that's a valid perspective. Google will guide you to a plethora of training sites. But I'm beginning to wonder if it makes sense at all to work for people who expect standardized outcomes in these tests.