You wanna solve or avoid millions bugs? Instead of hiring people capable of memorizing how to invert binary trees and similar bs, companies when interviewing and hiring should focus on real hands-on experience, should value developers who empower and demostrate best practices and good code craftsmanship.
Ask candidates to write and review real production code.
It is just unbelievable how low is set the bar when it comes to writing high quality code even at so called FAANG. You can just imagine how bad it gets for any other random company out there.