View Full Version : What do you think of my exam?

12-02-2004, 02:51 PM
Below I'm posting a midterm exam I took about a month ago; the class is Operating Systems Concepts and Design. The Lecturer is pretty dumb, but the exam was just funny. I just got my grade today and got a 105/110.

Number 6 and 7 are really funny - How the hell can you grade that objectively? The only tough one was the last one - but not that tough. And one mre thing, the exam was timed - we had 50mins - but open book, notes, internet :rolleyes:

1. A process may be in one of 5 states. Name each state with a short description.

2. What should be in the PCB? Why?

3. List 4 instructions that should be privileged, and why.
For example, you can include "turn off all interrupts".

4. Do you want to program on a system that uses thread model many-toone, one-to-one, or many-to-many? Why?

5. In lecture we said that, if the semaphore operatons Wait and Signal
are not executed with certain atomic instructions, then mutual exclusion
might be violated. Assume Wait and Signal are implemented as:

void semWait(semaphore S) {
while (S.count <=0) ;
S.count = S.count -1;

void semSignal(semaphore S) {
S.count = S.count +1;

Describe a sequence of events where two threads could both be in
a critical section of code guarded by a single mutex semaphore as a
result of a lack of atomicity.

Give another version of code that will work, mark which instructions need to be executed atomically.
Question 5 answers

6. What thing are you happiest that you have learned so far this semester in this course? Describe it. What can you do now that you know it? (Maybe a concept, maybe an increase vocabulary, etc. It have have caused you to say, "Oh,
that is how that works!", "Oh, that is what that means!", etc.)

Be sure your answer is in your own words and is enough to prove you understand whatever you claim to have learned.

7. List your group members for project 1. Briefly describe the most challenging bug that your group enountered in project 1, how your group found it, and how long it took your group to find it. Which of your group members do you think will give the best answer to this question?

8. Question 8 text You can use any synchronization IPC method we covered in class. You can use pseudo-ish code or actual code.

If you use semaphores and pseudo code,
Declare a semaphore as: semaphore theNameYouPick;
Initialize a semaphore as: theNameYouPick=initialValue;
Wait on a semaphore as: semWait(theNameYouPick);
Signal on a semaphore as: semSignal(theNameYouPick);

You may want to write something in the answer box and occationaly "preview" it to prevent blackboard from timing out. You may also want to keep a copy of your answer as it develops on your local machine in case of a system crash.

State any references you use.

A bridge is undergoing repairs and only one lane is open for traffic.
To prevent accidents, traffic needs to be synchronized.
A car can only cross the bridge if there are no cars going in
the opposite direction on the bridge. (A car can begin to cross the
bridge if going with the current flow of traffic.)
Sensors at either end of the bridge detect when cars arrive
and depart from the bridge and these sensors control traffic lights.

Consider a partial solution:
sharedmemory int numCars=0;
enum trafficDirection={open, north, south}
sharedmemory trafficDirection currentDir=open;

Car(trafficDirection desiredDir) {
pid_t pid=getpid();
printf("car %d wants to go %d\n", pid, desiredDir); /* I know, I know ... pretend it prints ok */
printf("car %d is traveling %d on the bridge\n", pid, desiredDir); /* I know, I know ... pretend it prints ok */
/* take some time to travel */ sleep 1;
printf("car %d is off the bridge\n", pid);

Arrive(trafficDirection desiredDir){
while (currentDir != desiredDir || currentDir != open);

Depart(trafficDirection desiredDir) {
if (numCars==0) currentDir=open;

Consider a main program that starts a bunch of Cars randomly picking which
direction they want to travel in.


The code above does not have any synchronization statements.
Give an interleaving of some (for example of 2 processes) which would
cause a collision (two cars traveling on the bridge in opposite directions
at the same time).


Add synchronization to avoid collisions. (Use psuedo code, but express
all the important steps: declaration, initialization, etc.). Give your
improved program below.

12-02-2004, 03:01 PM
That's it?? The last one looks a little rough, but the others don't seem too bad. Not that I could remember a lot of what I learned in that class, but it never seemed like rocket science. #7 is just to fsck the lazy team members. That can be a good and a bad thing.

12-02-2004, 03:52 PM
>>That's it??<<

yeah thats it. I mean - its a joke of a class...or rather a joke of a professor. Does this look like a university exam? and this is a 300 level class!! I didn't learn much but at least I will get a good grade..

12-02-2004, 05:43 PM
Is that how easy most of your classes are? I don't attend classes but I have watched a few lectures on webcasts. Learned about MIPS assembly and Structured programming in SCHEME. I am sure it gets tougher ;)

12-02-2004, 05:48 PM
>>Is that how easy most of your classes are?<<

no. Most of the classes are actually valuable and all are much much harder - this is just a fluke, or rather the teacher is.

>>Learned about MIPS assembly<<

Well that was usless :p I also had to learn MIPS, and had never used it since.

12-02-2004, 06:17 PM
Totally unrelated but my US History I class (freaking gen ed) exam is pretty insane, but the professor gave us 4 questions, 3 of which will be on the final. Giving us 1 1/2 hrs to complete all three essays.

1. During the first four decades of the nineteenth century the United States looked increasingly like three different regions rather than one united country. Compare the three regions and account for those differences.

2. Although ultimately slavery is the fundamental cause of the Civil War, the growing division between the slave states and the non-slave states between 1848 and 1860 can be seen in events. What are the key events and how did each contribute to the spirit of division?

3. What were the differences between Presidential Reconstruction under President Johnson and Congressional Reconstruction (Radical Reconstruction) ? Why did each fail? What contributions did Congressional Reconstruction make to the areaa that had been in rebellion?

4. What was Jacksonian Democracy and how democratic was it? How did Jackson's two terms as president contribute to the formation of a new two-party system?

Also to sort of keep it on topic, in my OOP class a couple semesters ago our final consisted of writting a program in a blue book with pencil. :(

12-03-2004, 06:09 AM
you get a list of exam questions beforehand?
What's the point in even bothering to grade the exam, everyone with a bit of memorising can get 100% that way, so all you're testing is peoples' capability for cramming answers and not their knowledge of the subject being tested...

12-03-2004, 06:55 AM
> Giving us 1 1/2 hrs to complete all three essays.

And you got the questions how far in advance?

None of those are very difficult, especially if you spend about an hour or so researching each one on the web.

>how democratic was it?
That's pretty stupid. There's no "scale of democracy" or anything.

12-03-2004, 07:37 AM
> the exam was timed - we had 50mins - but open book, notes, internet
Sure has come a long way since my day - the only thing I could take to an exam was what I had actually learnt.

Is it even possble to fail this exam and still have a pulse?

> I just got my grade today and got a 105/110
Not bad for such a relaxed exam - but tell me, what was the lowest score?

12-03-2004, 07:43 AM
> Sure has come a long way since my day - the only thing I could take to an exam was what I had actually learnt

That's because they hadn't invented movable type when you were in school. :p Seriously, though - that depends on the exam. It was pretty rare that we were allowed to use notes in our tests when I was in school, and I can't recall ever being allowed to use the web.

12-03-2004, 07:51 AM
I guess it's time to put the stone tablets, ink wells, quills and chalk boards on ebay then....

12-03-2004, 10:36 AM
>>but tell me, what was the lowest score?

I believe the lowest score was a 68 - but there might have been lower.

>>Not bad for such a relaxed exam

I got 5 points off on the last question as my solution only allowed a single car through and not "streams" of cars :(

12-03-2004, 04:29 PM
>you get a list of exam questions beforehand?

It's his way of curving the class, giving the questions to the final exam a week in advanced.

every other exam was like this, but without giving us the questions.

Most professors do curves that are easier than this, like just dropping the lowest test grade.

Brain Cell
12-03-2004, 08:30 PM
open book, notes, internet
My college is too retarded that it still couldn't (or didn't) provide internet access to the students , not even in the library. But we still have open books and notes exams..

To be honest , i've never heard of a university that allow its students to access the internet during the exam.

Sure has come a long way since my day - the only thing I could take to an exam was what I had actually learnt.
and a pen ofcourse ;)

how old are you btw?