Ever thought about how many times to knock on the door when you are heading into a job interview? In Japan, it matters.

A shortage of young people means there are two job openings for every applicant, prompting some Japanese companies to consider hiring foreign workers. But an interview can be an etiquette minefield, particularly for a nonnative. Even Japanese students have to be drilled on the code, so it's all the more important for outsiders to be aware of the rules.

"It's kind of a test of how well you're trying to fit in," said Rochelle Kopp, who runs Japan Intercultural Consulting, which helps multicultural workplaces function better. Here's what you need to know: