Totally Annihilated by Easy Coding Questions

Just had my first ever professional interview for a Java Dev. The questions were so easy. Basic logic checks that any n00b coder should be able to get right. Once he pulled up the questions my heart rate skyrocketed, and I bombed every one tragically. He would explain the answer in real time, and I would just be like... oh, yeah, obviously. With interviews being so rare nowadays, how can I be sure this never happens again.