Answering this question too specifically can lose you a lot of money, or an opportunity. Naming a figure that's too low can result in a lower offer, or even loss of the opportunity if your answer creates doubt about your value. A figure that's too high can immediately disqualify you.
This is one of the few questions where formulaic, memorized verbiage may be the best approach.
First, as soon as you apply for a job make sure you understand the range of typical salaries for the position and geographic area, because this may be one of the first questions you will be asked in a phone screen, which could happen at any time.
You can research salaries via websites like Salary, Payscale, Glassdoor, Indeed, CareerOneStop, JobSearchIntelligence, a simple Google search, and sometimes via word of mouth. Use more than one source, since a broader range may give you more negotiating flexibility.
When the question is asked, respond with "Can you tell me what range you have budgeted for the position?"
If they tell you a range, say something like, "That seems like a reasonable ballpark. I'm sure once we agree I'm the right person for the job, we'll be able to agree on a salary that's fair."
If they won't state their range and put the question back onto you, say something like, "I've done some research and I'm seeing salaries anywhere from X to Y. I'm sure once we agree I'm the right person for the job we'll be able to agree on a salary that's fair."
More Help with Common Interview Questions
Earlier posts in this series explored the common interview questions "What are your weaknesses?", "Where do you see yourself in five years?", "Why did you leave your job?" and "What's the biggest mistake you've made on the job?"
For tips on dozens of interview questions, plus a comprehensive guide to the whole interview process, check out my book (found in my profile above).