Interviewing for a job is, at best, stressful. Interviewing for a technical position can be that and more. There are certainly some other fields that this applies to, but it is easy to learn to program and still have absolutely no idea how to program. By that I mean, you can get a degree or certificate in programming and have little to no idea of how to actually write software.
There is a flip side to that as well. There is a plethora of free information on the internet. It is entirely possible to learn to program outside of a formal environment like a college or university. Self-taught programmers can be some of the best. You can, of course, also learn bad habits on the internet. There are "copy/paste" programmers, who find the code they need on sites like StackOverflow, and copy and paste it into their programs without understanding what it does, how it does it, or why it does it the way it does.
Given all that, it makes sense for companies to have to go the extra mile when hiring for tech positions. That stress that is inherent in the very idea of an interview, that you're being judged as a person, is compounded by you needing to be tested for technical acumen as well as the more general things like responsibility and people skills.
So what does that mean for you, the interviewee? That means a lot of things. First and foremost, if the company you're interviewing at knows what it's doing, it means you actually need to know your stuff. You can study, and read books, but in the end, if you're not ready for a job, you're not ready for it.
Beyond that it depends on who you're talking to. Every company interviews differently. There will definitely be some technical questions. There might be whiteboard programming, there might be actual in-front-of-a-computer programming. They may be looking for some very specific expertise, and they may just try and figure out how you think. In the end it pays to do your homework. Check up on the company ahead of time and try and prepare for that specific company, not just in general.
There are a number of ways to do this. You can go to sites like Glassdoor.com and see what other people have said about that company's interview process. You can also look into previous work the company has done. If, for example, the company has a lot of Facebook integration in their applications, you should be able to say you're familiar with the Facebook API, and have the knowledge to back it up. That being said, if you aren't very familiar with the Facebook API, don't lie about it.
Knowing what you don't know is also important. It shows a certain level of maturity as a programmer. If you know where your ignorance lies, and aren't afraid to show that, they can get a better idea of your skill and knowledge base, and you can get a better idea of if that position is right for you. An important thing to remember is that you should be having a conversation with your interviewer, not an interrogation.
The flow of information should go both ways in an interview. This goes for non-technical positions as well. You should be trying to find out about them, and asking them questions as well as the other way around. Asking questions is a good way to keep from constantly being on the defensive as well, or at least feeling like you're on the defensive, which goes a long way to keeping calm and presenting yourself well. There is such a thing as a job that just isn't right for you, even if you're qualified and need a job.