This is a general outline of the key concepts (arranged by topic) that you should know for the Exam 03.

Format

The exam will have the following format:

  1. Code Snippets: Write Shell commands or Python code to perform certain tasks. (4 Points)

  2. Short Answers: Briefly answer questions about:

  3. Programming: Write some C code that uses system calls. (6 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.

Scripting

  1. What is Unix?

  2. What are the principles of functional programming?

  3. What is concurrency and what is parallelism?

Shell

How do you construct a unix pipeline to do the following:

  1. Extract a fields or characters.

  2. Search based on a pattern.

  3. Count the number of lines.

  4. Search a directory based on a pattern or file attribute.

  5. List the processes on the current machine.

Python

  1. How do you use map, filter, and lambda?

  2. How do you use list comprehensions?

C

Compiler Pipeline

  1. 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 the difference between a shared library and a static library?

  2. How do you write a Makefile that utilizes rules and variables for a program that consists of multiple files?

Memory Allocation

  1. What is the difference between a struct and a union?

  2. How much memory is allocated when we declare an int, float, double, char, array, string, or pointer?

  3. When we declare a variable, where is the data allocated (stack, heap, data, code)?

  4. How do we dynamically allocate memory? How do we deallocate that memory?

  5. How do we detect and fix memory errors such as: segmentation faults, invalid reads, uninitialized memory, and memory leaks?

Data Structures

  1. What is singly-linked list?

    • How would we insert an entry into a linked list?

    • How would we search for an entry in a linked list?

    • How would we remove an entry in a linked list?

    • What are the time and space complexities of the insert, search, and remove operations?

  2. What is hash table?

System Calls

  1. What exactly are system calls?

  2. What are some reasons why system calls related to files, processes, and networking would fail?

    • How do we check these failures?

    • How do we get the error message related to these failures?

Files

  1. What is the difference between open and fopen?

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

  3. How do we get the inode information for a file?

  4. How would you use system calls in C to accomplish the following tasks:

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

    • Check if a file is a readable, writable, or executable?

    • Check the size of the file?

    • Check the last modification time?

Processes

  1. What is a process?

    • What attributes or components does it have?

    • What system calls can you do with them?

  2. What happens during 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?

  3. How do we prevent a fork bomb?

    • How do we prevent zombies?

    • Why would we want to prevent these situations?

  4. What is a signal?

Networking

  1. What is networking?

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

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

  4. What is HTTP?

    • What system calls does a typical HTTP client perform? What messages does it send and receive?

    • What system calls does a typical HTTP server perform? What messages does it send and receive?

  5. How would you modify echo_client_refactored.c to implement a port scanner?