Many talented people are rejected because of the bad HR process and system. Moreover algorithms are far away from being something really important, it always can be practiced and re-learned fast, while huge motivation, creativity and many other skills are not something can be copied from the books for couple of weeks.
Big companies receive many requests and to physically be able to handle such large flow they have to add many additional steps and strong simple rules starting from CV scanning till algorithm test and basically without any personal opinion they would just take someone with a higher score since they don't care about you at all and will never waste their time trying to understand you as a person.
Dreams are good, but expectations are bad. Don't let attachments keep you in the past, let them go. Never expect anything from yourself and never expect anything from others. Be free. Very often we think that something would be very great for us, we imagine a lot and we starting willing it too much. Problem here is not only you might get a rejection but you also might be very disappointed and often in such cases people blame others. Your expectations are only yours expectations.
Rejection is not the end of life, what happened, it happened, you can't change it, don't waste your time and energy on what you can not control or can not change.
Keep looking around, keep improving yourself, keep going forward and never look back. It also doesn't mean you should take all advices and criticism you got during last interview, however, if you know you failed somewhere and you could do better, then, of course, learn on own mistakes and never repeat them again.
Probably find a job in a startup, that's the only place where dreams can become true and everyone will really care about you. Later you always can give that "dream" company a second chance.
Failures are the most important part of our lifes, that how we learn. Thank anyone in your life who stayed on your way because they all made you stronger. The key which distinguish successful people from the majority is that successful people are always rising after falling no matter what and how difficult it could be.