An interview isn't a surprise attack, they're usually scheduled days in advance. Good interviewers will usually characterize what kind of questions you can expect to receive ahead of time. I'm sorry that you've had bad experiences during interviews, but the process is difficult for both parties. It can be very difficult to assess both candidates and companies without spending an inordinate amount of time in the process. CoderPad offers a particular cost-benefit tradeoff, and longer take-home assignments offer another. Onsite projects offer yet another, etc.