Here is a general outline of the key concepts and commands (arranged by topic) that you should know for Exam 04.

The exam will have the following format:

  1. Identification: Identify commands, Python functions, or system calls that perform certain tasks. (4 Points)

  2. Short Answers: Briefly answer conceptual questions about Unix, Python and system calls. (8 Points)

  3. Debugging: Fix or analyze some Python code that uses system calls. (8 Points)

  4. Programming: Use Unix commands and write some Python code that uses system calls. (5 Points)

Comprehensive

The final exam will be a comprehrensive assessment. This means that everything we have discussed this semester is considered fair game.

That said, the majority of the test will cover the last quarter of the class, as detailed below.

Unix

Concepts

  1. What is Unix?

    • What are the three tenets of the Unix Philosophy?

    • What are filters? What do they do and how are they related to the Unix Philosophy?

  2. What is a shell?

    • What is a shell script?

    • You should know the basics of the shell programming language:

      • variables

      • capturing STDOUT

      • if statement

      • case statement

      • for loop

      • while loop

      • function

      • trap

    • Given the command ./script.py *.txt, who is responsible for expanding the *.txt into all the files that match that pattern?

  3. What is a file?

    • What is an inode and what information does it store?

    • What is the difference between an absolute and relative path?

    • How do Unix file permissions work? How would you set them to restrict access for certain operations and certain classes?

    • What exactly is a file descriptor and what system calls can we do with one?

    • How do we get the inode information for a file? Using the inode information, how do we:

      • Check if a file is a regular file, directory, or symlink?

      • Check the size of the file?

      • Check the last modification time?

    • Describe different reasons why os.stat could fail on a file.

  4. What is a process?

    • What attributes does it have and what system calls can you do with them?

    • What does it mean to signal a process? What do different the different signals do (TERM, INT, KILL, HUP)?

    • Describe the following components of a process.

      • Memory address space
      • Kernel state
      • Execution context
    • Describe why a process is viewed as a unit of allocation by explaining the life cycle of a typical process.

      • After a fork, how does a process determine if they are the child or parent?

      • After a fork, who executes first: parent or child?

      • What happens when a process performs exec?

      • Why is it necessary to perform a wait?

      • What is the purpose of exit?

    • How do we prevent a fork bomb? zombies? Why would we want to prevent these situations?

    • What is a signal? What does a signal do to a process? How do applications handle signal events?

      • How do we send a signal to another process?

      • How do we catch signals and handle them?

      • What happens to system calls if a signal interrupts them?

  5. What is I/O redirection?

    • What three files does every process start with?

    • How do you redirect the output of a command into a new file?

    • How do you redirect the output of a command and append it to a file?

    • How do you redirect the output of one command as the input to another?

    • How do you direct the contents of a file into the input of command?

  6. What is networking?

  7. What is the compiler pipeline?

    • What exactly happens when you compile a program (ie. describe the compiler pipeline)?

    • What is the difference between a dynamic executable and a static executable?

    • What is a shared library? How does the environment variable LD_LIBRARY_PATH affect shared libraries? How do we list the shared libraries an executable requires?

  8. What are regular expressions?

    • You will need to know the basic metacharacters such as

      • .
      • *
      • []
      • [^]
      • ^
      • $
      • ()
      • |
      • \n
      • {m, n}
  9. What is Python?

    • How do we manage control flow in Python? How do we utilize these constructs?

      • Conditionals
      • Loops
      • Exceptions
      • Functions
    • What data structures do we have in Python? What are their basic operations?

      • Lists
      • Dictionaries
      • Sets
  10. What are system calls?

    • What is the difference between user mode and kernel mode? How and when do we transition between the two?

    • What exactly are system calls? What happens when an application performs one?

Commands / Functions / System Calls

  1. git

  2. find

  3. dd

  4. kill

  5. curl

  6. nc

  7. valgrind

  8. test

  9. cut

  10. tr

  11. grep

  12. sed

  13. awk

  14. diff

  15. os.open

  16. os.close

  17. os.read

  18. os.write

  19. os.stat

  20. os.access

  21. os.fork

  22. os.wait

  23. sys.exit

  24. signal.signal

Programming Paradigms

Concepts

  1. What are the differences between the following programming paradigms:

    How does Python support or enable each of those programming paradigms.

  2. What are the principles of Functional programming?

  3. What are the principles of Object-oriented programming?

    • How are constructors defined in Python?

    • How are fields and methods defined in Python?

    • What is the self in Python class methods?

System Calls: Networking

Concepts

  1. What is a URL and what are its components?

  2. How are sockets like files? How are they different?

  3. What sort of system calls do a typical TCP client and server make?

  4. What is HTTP? Describe what a typical HTTP session looks like by diagramming the low-level socket operations performed by the client and the server along with the messages they each send.

  5. You will need to be familiar with the design and implementation of thor.py and spidey.py and answer questions related to them.

  6. You will need to be familiar with simple_echo_client.py and capable of implementing a simple TCP client.

System Calls / Functions

  1. socket.socket

  2. socket.bind

  3. socket.listen

  4. socket.connect

  5. socket.accept

  6. socket.makefile

  7. socket.gethostbyname

Distributed Computing

Concepts

  1. What is concurrency and what is parallelism?

    • Can you have one without the other? Explain.
  2. What are the different forms of parallelism?

    • What is the most difficult part of parallel computing?
  3. What is Condor and what problem does it solve?

    • Explain at a high-level what match-matching is.
  4. What is Work Queue and what problem does it solve?

    • Explain at a high-level how workers interact with the master.