Like any aspect of programming, knowing how to interview is a skill that you need to hone and improve over time. It's not enough to know how to program software. You have to be able to communicate your knowledge clearly and effectively. Here are a few tips.
Apply to many positions. Apply often. Like any skill, your ability to interview well will be improved over time, so go on as many job interviews as you can. Even if you fail to receive an offer, you can learn something from every interview and be better for the experience.
If you're interviewing at a particular company, make sure you know a great deal about that company before the interview.
Try to know more about them than they know about you.
Try to understand fully the job that you're applying for:
Some of these questions you can find answers to before the interview, while some may be best answered during an interview.
Remember that most technical interviews will have technical questions and at least one whiteboard coding challenge. Practice your knowledge and practice writing code on a whiteboard.
Check out this great pdf on Cracking the Coding Skills.
This is not complicated. Figure out how much time it will take you to travel to the interview location 30 minutes early, accounting for traffic, weather, and potential traffic accidents or other stand stills.
If everyone in the company you're applying at wears suits and ties, don't show up in jeans and a t-shirt. Conversely, a suit probably won't be received well at a company where the dress code is that there isn't a dress code.
A good rule of thumb is to dress one notch above the standard of the company. If everyone is in jeans and t-shirts, wear jeans with a casual button down shirt.
Also, remember good hygiene.
If you know the topic that you're being asked about, approach the topic with confidence. No need to apoligize for lack of perfection; no one expects you to be perfect. Approach the topic with a confident attitude.
If you don't know the topic, or you aren't that comfortable in the topic, approach it with humility. Don't BS your way through a topic you're unfamiliar with; a technical interviewer can smell BS a mile away. Be honest and humble when you don't know a particular topic. For example, if you're asked about some suject that you aren't familiar with, you could approach the topic like this:
That's a good question. While I have worked with this, that, and the other, I'm actually unfamiliar with that topic. Could you give me some more details about that subject?
If you aren't quite sure what the interviewer is requesting of you, be sure to ask for clarity. A great way to do so is to repeat what you thought you heard; then the interviewer can either confirm or correct your understanding of the question.
Just because you're the one interviewing doesn't mean that you have no leverage. Many job positions at companies are filling real, urgent needs that a company has. The company needs the position filled just like you need a job. Don't be afraid to negotiate any job offers that you receive. This is especially easy if you have multiple offers on the table.
Follow up. Follow up. Follow up.
Get the email of the interviewer and follow up via. email. Give the company a call. Keep yourself on the company's radar.