According to the book "Programming Interviews Exposed":
In general, though, a suit is overkill for a technical job interview. A standard technical interviewing outfit for men consists of nondenim cotton pants, a collared shirt, and loafers (no sneakers or sandals). Unless the job you're interviewing for has a significant business or consulting aspect whereby formal dress will be required, you generally don't need to wear a jacket or a tie. Women can dress similarly to men.
There are a few ways of finding out the appropriate attire for an interview. You can ask a friend that knows the place, or if there is a 3rd-party recruiter you're talking to, I wouldn't feel shy in asking them about this area of interview prep.
If you don't have a friend, or 3rd party recruiter, is there another way that you could ask directly without coming off weird? Please include the exact language you would use in the question.
To me, I would rather "play it safe" and be over-dressed at a casual office, than be under-dressed at a conservative office. Is it better just to play it safe?
On the other hand I read in "The Google Resume" (emphasis mine):
'[Tech companies] pride themselves on their funky and innovative culture, and they want people who will fit into this. "You have to prove why you are there, and that you know you fit within their community, that you enjoy the lifestyle," said Andre, a (successful) Apple candidate. "The moment my interviewer said, 'We are very informal' I took off my tie."'
Based on some of the answers below, it's better to play it safe and go with a suit. Should we be conservative in the kind of suit as well? In the market you could find a navy stripe suit, modern fit, light colors, etc. Is it better to play it safe in this regard as well, and not choose a funky color or a light-colored suit?