The lesson based on your experience could be the advice you gave. But it could also be: Don't get your expectations too high. If you have achieved something in your programming career already, you've done it. Something to be proud of. "Bad" interviewing practices of top companies, and the outcomes that follow, don't and shouldn't undermine your self-worth. Just take the whole interviewing experience as a chance to me…
You're not wrong, but if one needs to put a premium on their time it's a little more complicated than that. Particularly if you need to take time off and travel for an interview, it'd be nice if the whole thing was more than a minor social experience.