I have been in many an interview and given more than a few for developer positions. Here are my experiences and expectations from both sides.
From the perspective side of going into an interview, this is what I do to prepare. Why do I prepare? Preparation shows enthusiasm to wanting to work and a good attitude towards doing a job. When you are out of work, your job is finding work. You take the proper steps to complete that "job" like any other job. So this is what I always do.
1) Make sure my resume is in order. I typically have a 2 page general technical resume about my skill sets and a general bit of job history in what I've previously done. I also spend time making my resume look neat, organized, and free of grammar problems. I have it read over and corrected by others if need be.
2) I read about the position/company I am applying towards, and if need be tailor a special resume for the position. Which usually includes expanding details of what I've done previously that may share commonalities with the position in terms of daily job duties required. It's basically emphasizing my job experience in the past that may align with the new position.
3) I look over my wardrobe and typically go shopping within my current budget to pick out nice fitting new slacks, dress shoes, dress socks, belt, and a long-sleeve button down shirt. Possibly a tie as well. I have a few rarely worn sports coats that I can slip on if needed for an interview in a place that usually requires a tighter dress code from their employees. If the place is casual dress, I skip the tie and coat. If it's business casual I wear the tie. If it's semi formal (ie the employees are expected to wear at least a tie) then I wear my sports coat. If the place expects me to wear a suit every day I don't bother with the position. Period. I know where I want to work and any place that makes me as a developer wear a suit every day is not a place I want to work.
4) While reading up on the company and position, I take down notes which includes specific questions about the place I am going to work.
5) I read up on the relevant type of coding info type questions that the position would ask of me. I know development, but like most developers the go to resources like Google, Stack Overflow, and other code developer sites are where I usually end up looking for a solution. Too much to keep memorized. However, it doesn't hurt to cram in the basics all over again in my head in a format that is good for answering "text book" style questions that pop up in an interview.
6) I make sure I have a good hair cut and trim nails. Before the interview I shower and make sure I look as nice and presentable as possible. I don't wear any strong smelling cologne nor deodorant.
7) I practice smiling and talking in front of a mirror and do a mock interview or two with friend/family that can spare the time.
8) I go in with school "portfolio" folder with 5 printed copies of my resume. I also have some scratch paper, and some printed samples of code I've done. I also bring in a thumb drive of code samples I've done in the past. Nothing that would be considered private info from previous positions, but general code routines like library style routines or web page examples.
9) During the interview it is about smiling, being polite, not using "guarding" style mannerisms like crossing your arms or legs for too long. I try to present a cheery and good attitude to the interview the entire time. I turn my phone off as well. I answer all questions to the best of my ability. Anything I don't know the answer off the top of my head I say I don't know, but I explain how I would find the answer. An interviewer is not looking always to see if I am a robot that has every facet of coding info memorized exactly in my head. They want to see how well I can resolve a problem.
Usually the only reason I don't get an offer on the spot after an interview is typically one of the following:
1) Pay/benefits are mutually agreeable. It happens sometimes I value myself more than what a company is willing to pay. If the offer is close I am will to negotiate some every time. If the company low balls me I politely thank them and see myself out the door. It hasn't happened often, but it has happened.
2) The company is looking for a robot with everything memorized in their head. Some places have positions that must be filled with very specific people. I don't always meet that. It happens. I thank them and move on.
When I interview others I do everything above in what I look for in a candidate. I look to see if the person made an effort to present themselves as a potential candidate for a given position. While I wouldn't hire or not hire someone based off how well they dressed for the interview solely, if I have two or more equally viable potential candidates that have applied for the position, the one that looks to go to the extra effort is going to be the one I pick first. Unlike some interviewers, I don't try to grill applicants with nuanced minutia of coding knowledge questions. Seeing people "squirm" in an interview does not give me any jollies. I usually come prepared with 3-4 simple coding questions and 2-3 "harder" ones based on how well the candidate has answer the easier ones. Even if the candidate doesn't answer the question just right, that is not what I am looking for. I am looking for how the candidate approaches the problem. Are they bullshitting and lying to me? Some have done that and flat out made up an answer. That is a big "see you out the door and don't let it smack you on the ass on your way out" reaction from me if a candidate does that. A person that does the instant response of "Don't remember, next question please" gets basically the same response from me as the bullshitter gets from me.
What I want is someone to take a moment to think, possibly ask a clarification question, and if they can't figure it out say they don't know right now, but either explained how they did something similar before and how they solved it, or what steps they would take to solve it. I also like to ask a couple of personal questions to see the personality of the person as well. A little arrogance that may be from confidence doesn't put me off unless there is a complete lack of respect from the other person. Which I haven't seen often, but I have seen. So basically as an interviewer these are the things I look for in a candidate.
1) Knowledge and ability to do the job. Someone that can't hack it won't get it.
2) Personality. As noted previously, no one wants to work with an asshole.
3) Preparation and effort for the interview. If the previous two categories are equal between candidates, this is the tie breaker for me.