I don’t know much about how airplane cockpit door work, but as far as I know this door now a day is bullet proof and next to impossible to break down during in flight. Next to impossible to break down because nobody on board would have weapons to break it down, and even if there’s a federal agent with guns, can’t easily shoot it down either.
So again I’m don’t know much about the operation process, but I’m sure it is possible that if there are more than one pilot, one can lock out the other pilot by either systematically denied access to get back in, such as the pilot from the outside entering the code to get in, but inside the other person have a few seconds to denied it, and kept on denying it. If the door have a physical handle, then it’s worst, even if outside have to the code to get in and fast enough to open the lock, but the physical handle lock it, makes the automatic code entries useless because is locked with a lever from the inside.
So with all these being said, what happened to GermanWing airplane that crashed confirmed appears to be a co-pilot suicide want to bring all 150~ people on board with him. The co-pilot also been confirmed had a history of mental illness problem, and GermanWing said that all their pilot goes through passing grade of mental medical test, apparently not this co-pilot. So who is held responsible? I say start with GermanWing or the airline industry, what kind of medical test saying PASSED when this co-pilot clearly have mental illness.
Now back to the door airplane cockpit door issue. How to improve? well some say get pilot diaper, it’s a joke, but not funny, this case pilot doesn’t need to leave their seat, well what if the other pilot trick him and kill him or injured him to commit this act? same thing. Some recommend to build a toilet inside the cockpit, but again not really feasible. How about training and extensive medical illness test? Well to me, the real solution is remote flying, meaning if the plane is in trouble and strange activities detected the remote location would get notified and a remote pilot can override the pilot up in the air by locking it, then have the plane circling up the sky until things has been rectified, and if possible have the remote pilot land plane nearest airport.
Final words. Rest in peace GermanWing flight that crashed into France remote mountain, please help us solve the mystery and prevent this occurrences.