CS3600 — Week 2 Review Quiz

Coverage: Lab 2 (fork(), wait(), write to files; strace/top) and Chapter 2 (Computer System Overview).

How to submit

  1. Create a text file named wk2_review_quiz.txt in ~/cs3600/3/.
  2. Put one answer per line using A/B/C/D only. For True/False, use A=True, B=False.
    B
    C
    D
  3. Save the file; do not email. It will be collected from your course folder.

After saving, make sure faculty can collect your quiz by running:

chmod g+r ~/cs3600/3/wk2_review_quiz.txt

Questions

  1. Immediately after fork(), what are the return values in parent and child?
    A) Parent: child's PID (>0); Child: 0
    B) Parent: 0; Child: child's PID
    C) Both return 0
    D) Both return child's PID
  2. Which call lets the parent reap the child and decode its exit status to avoid a zombie?
    A) wait()/waitpid()
    B) sleep()
    C) kill()
    D) signal()
  3. According to Lab 2, which low-level I/O calls are used to write to log?
    A) fopen, fprintf, fclose
    B) open, write, close
    C) ifstream, <<, .close()
    D) open, fwrite, fclose
  4. True/False: A zombie process disappears only after the parent calls wait() (or exits and is reaped by init/systemd).
    A) True
    B) False
  5. In Lab 2, the child’s exit code is specified to be:
    A) fib(n)
    B) n
    C) 0 on success, 1 on failure only
    D) The PID of the child
  6. Where does the quiz instruct you to place the Week 2 quiz file?
    A) ~/cs3600/3/
    B) ~/cs3600/2/
    C) ~/cs3600/1/
    D) Any directory is fine
  7. True/False: The Lab 2 spec asks you to trace behavior with strace and observe process state with top.
    A) True
    B) False
  8. True/False: Parent and child share the same address space after fork().
    A) True
    B) False
  9. Which command shows processes and states, including Z for zombies?
    A) strace
    B) top
    C) ldd
    D) nm
  10. The purpose of a cache is to:
    A) Permanently store binaries
    B) Reduce average access time using locality
    C) Replace main memory
    D) Encrypt memory contents
  11. The interface that forms the boundary between hardware and software is the:
    A) ABI
    B) ISA
    C) BIOS
    D) API
  12. Which sequence describes the instruction cycle?
    A) Decode → Fetch → Execute
    B) Fetch → Decode → Execute
    C) Execute → Fetch → Decode
    D) Fetch → Execute → Decode
  13. True/False: Privileged instructions run in user mode.
    A) True
    B) False
  14. Which is NOT typically a system bus line?
    A) Data
    B) Address
    C) Control
    D) Power‑Management Policy
Answer format: one letter per line in wk2_review_quiz.txt (A/B/C/D). True/False uses A = True, B = False.