In my experience before you start working for a company you have no opportunity to look at the code-base (I've asked and for reasons of confidentiality everyone has always said no, I think that is fair), so during the interview process what do you think are the most important questions to ask to find out what kind of state the code is in (after all, if it's a dog, then you are going to be on of the poor unfortunates who has to walk it every day)?
UPDATE:
A check-list: Ask;
- What they think of the codebase. And when you do, pay close attention to facial expressions and the time it takes for them to respond. [Anon]
- What is the company's CMM level [DPD] (and if you hear Level 5 run the other way [Doug T])
- What lifecycle they use [DPD] (And if you do hear "Agile", that's when you start asking some penetrating questions to try to figure out if by "Agile" they mean "Agile or "cowboy coding" [Carson63000])
- What tools they use to asses code quality? [DPD]
- What tools they use for development? [DPD] (Look for refactoring tools and continuous build servers)
- What source code (version control) system they use, and a good follow up is to ask why they use it. [Zachary K].
- What are their testing procedures like? [Karl Bielefeldt] (Look especially for teams that use mocking frameworks and place an emphasis on thorough automated unit testing through established frameworks like NUnit / JUnit; don't be put off by teams that don't use test driven development TDD, but be wary if they don't consider testing to be integral to and the cornerstone of solid software development. Look for teams with dedicated testers.)
- What kinds of assignments are given to new developers? To experienced developers? [Karl Bielefeldt]
- How many people work on a project? [Karl Bielefeldt]
- Is refactoring allowed? Encouraged? [Karl Bielefeldt]
- What quality-related process or architecture changes are under consideration or have been made recently? [Karl Bielefeldt]
- How much autonomy do individuals have over their modules? [Karl Bielefeldt]
- Will you be developing newer projects (greenfield development) or legacy projects (brownfield development)? (Greenfield development is generally more fun and has less problems as you aren't cleaning up with someone else's mistakes).
- Is the employee turnover rate is high in the organization or the team? (This often indicates lower quality of code) [M.Sameer]
- Some programming problems of your own; but avoid seeming like a jerk. [Sparky]
- How do the developers collaborate and how is knowledge shared amongst the team? (This should match your personality; I would say a mixture of solo and pair work is probably best, with the ratio matching your social needs)
- How close their database is to 3rd Normal Form (3NF), and if it deviates where and why? (If they say "3NF???", leave. If not, and there might be good reasons for it not, then find out what they are).
NOTE: I've accepted Anon's answer because after about a week the community thinks that it is the best one - I think this suggests that it is just something that you somehow need to develop a sixth-sense for. But, I think everyone has had something valuable to say.