What do you think of my exam?

This is a discussion on What do you think of my exam? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Below I'm posting a midterm exam I took about a month ago; the class is Operating Systems Concepts and Design. ...

  1. #1
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572

    What do you think of my exam?

    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

    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 */
    Arrive(desiredDir);
    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;
    Depart(desiredDir);
    printf("car %d is off the bridge\n", pid);
    }

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

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

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


    PART A:

    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).

    PART B:

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

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  2. #2
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    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.

  3. #3
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    >>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..

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  4. #4
    Registered User manofsteel972's Avatar
    Join Date
    Mar 2004
    Posts
    317
    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
    "Knowledge is proud that she knows so much; Wisdom is humble that she knows no more."
    -- Cowper

    Operating Systems=Slackware Linux 9.1,Windows 98/Xp
    Compilers=gcc 3.2.3, Visual C++ 6.0, DevC++(Mingw)

    You may teach a person from now until doom's day, but that person will only know what he learns himself.

    Now I know what doesn't work.

    A problem is understood by solving it, not by pondering it.

    For a bit of humor check out xkcd web comic http://xkcd.com/235/

  5. #5
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    >>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 I also had to learn MIPS, and had never used it since.

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  6. #6
    Bob Dole for '08 B0bDole's Avatar
    Join Date
    Sep 2004
    Posts
    618
    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.
    Hmm

  7. #7
    chococoder
    Join Date
    Nov 2004
    Posts
    515
    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...

  8. #8
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,825
    > 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.

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

  9. #9
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,592
    > 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?

  10. #10
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,825
    > 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. 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.

  11. #11
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,592
    I guess it's time to put the stone tablets, ink wells, quills and chalk boards on ebay then....

  12. #12
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    >>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

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  13. #13
    Bob Dole for '08 B0bDole's Avatar
    Join Date
    Sep 2004
    Posts
    618
    >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.
    Hmm

  14. #14
    former member Brain Cell's Avatar
    Join Date
    Feb 2004
    Posts
    472
    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?
    My Tutorials :
    - Bad programming practices in : C
    - C\C++ Tips
    (constrcutive criticism is very welcome)


    - Brain Cell

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. new problem with class
    By jrb47 in forum C++ Programming
    Replies: 0
    Last Post: 12-01-2006, 07:39 AM
  2. Lab exam
    By hawkins786 in forum C Programming
    Replies: 11
    Last Post: 05-24-2005, 11:24 AM
  3. Exam of programming
    By GanglyLamb in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 01-15-2005, 02:40 PM
  4. The AP Exam.....
    By RoD in forum A Brief History of Cprogramming.com
    Replies: 32
    Last Post: 02-10-2003, 08:46 PM
  5. Computer Science Exam Tomorrow!!!
    By cozman in forum C++ Programming
    Replies: 14
    Last Post: 05-23-2002, 08:23 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21