Is it wrong to impose a challenging time constraint on exams?
The objective of an assessment can vary from one lecture to another. Quite often, the point is simply to validate whether the expected learning outcomes of the lecture have been met. For instance, if an expected outcome is to know almost by heart how to write an array sorting program, then it's quite reasonable to ask to write a small amount of lines of code in a fixed amount of time.
If, on the other hand, the expected outcome is at a higher level of understanding (in the sense of Bloom's taxonomy), for instance by asking to design and assess a new data structure to handle a new problem, then it could be more reasonable to expect more time.
The problem you are referring to by "would never have such extreme time constraints in real life" is addressed with the notion of authentic learning (Rule, 2006), which identifies the four following themes for a learning to be authentic:
1) the activity involves real-world problems that mimic the work of professionals in the discipline with presentation of findings to audiences beyond the classroom;
2) open-ended inquiry, thinking skills, and metacognition are addressed;
3) students engage in discourse and social learning in a community of learners; and
4) students are empowered through choice to direct their own learning in relevant project work.
Authentic learning comes with its upsides and downsides (the reference linked acts as a survey paper, if you are interested), so it's not necessarily the best approach. In particular, (Lombardi, 2007) note that the reliance on traditional instruction is not simply a choice made by individual faculty—students often prefer it. For instance, not everybody wants to be tested on writing code in a highly complex environment, using bugged code written by other people, implementing specifications that are sub-optimal, but the client want them in this way, which could be a typical real world situation.
I don't think you should complain about time constraints, but if you believe that authentic learning would be more beneficial to you and your fellow students, you should probably discuss with the professor about the objective of the assessment.
Lombardi, M. M. (2007). Authentic learning for the 21st century: An overview. Educause learning initiative, 1(2007), 1-12.
Rule, Audrey C. (2006). The Components of Authentic Learning. Journal of Authentic Learning, Volume 3, Number 1, Pages 1-10, August 2006
This is not really an answer but some educated guess. Most instructors do not plan to impose a challenging time constraint for exams. Usually we tend to overestimate how easy is the exam. The younger is the instructor, the more optimistic he/she is about students and more eager to write interesting questions. For subjects that require lots of drilling, tight time constraints are helpful in the sense one can immediately screen out the students who did lots of homework/problem solving from those who have to think from scratch.
In my experience, challenging time constraints are a hindrance because they induce panic, which inhibits the ability to reason through a problem and make a thoughtful answer to it.
I'm currently tutoring two students on grammar for a business English class. Their teacher sets 100 questions for each 50 minute exam. That comes down to 30 seconds for each question. This tactic makes a mockery of all my attempts to teach them the logic and reason behind grammar. The students barely have enough time to figure out what's being asked of them, let alone apply any rules or reasoning principles.
The students feel this is unfair; they learned the rules, did the homework (which average 300 questions per set), and now they're failing the tests because they can't go through the whole process of reading a problem, conjuring up the correct rule, and finding the correct answer in 30 seconds. This causes bitterness and low morale. It makes them feel that all the work they put in to the homework was a waste of time.
It's not feasible in the standard method of testing to give students unlimited time, and most schools don't have the resources to set aside computer labs for exams so CS students can write code on them. But there's no reason to make the time constraints more of a problem than they need to be. Make the questions easier; put fewer questions; and split long questions into multiple parts, which are graded independently. I've found all of these reduce the pressure, and the second two options let you still put challenging problems on the exam.
In short, yes, I do think it's wrong to impose a challenging time constraint on an exam. Not only because it's unrealistic, but also because it puts artificial limits on the students' performance, which the students will recognize as artificial and react badly to. Unless you're trying to teach people to program on the bridge of the Starship Enterprise during a Red Alert while an anomaly is sucking the ship in, lighten up the time limits.