CS 212 Software Development

CS 212-01, CS 212-02 • Fall 2019

Exam 2 Review

Exam Format

The exam should take around 1 hour to complete, but you will have the entire class time of 1 hour 45 minutes to complete the exam. Please plan to complete the exam in a single sitting.

The exam questions may consist of:

The order you see questions and possible answers may be randomized. Most questions will be automatically graded by Canvas, except short answer and code snippets which will be graded manually by the instructor.

The exam will be conducted on Canvas on the lab computers and NOT on your laptops. You may access to the following official Java 12 documentation during the exam:

You can also access the following documentation:

The exam is otherwise closed-book closed-note. You may not reference any other websites other than Canvas and the approved websites above, e.g. you may not look at the class website, Github, StackOverflow, or Google. You may not open any other program other than the the browser, e.g. you may not open Eclipse or run Java. You may not reference your cell phone or tablet during the exam (even if you take a bathroom break). You may not look at the monitors of your fellow classmates.

You may ask the instructor for one piece of blank paper during the exam to use as scratch paper, but must turn in this paper at the end of class. You may not use your own paper.

You will be asked to completely clear the tables of all items except for the piece of scratch paper, and a pencil. This includes any bags, food or drinks, or cell phones.

You may ask the instructor for clarification on a question during the exam.

 There is a 0 tolerance cheating policy: any use of unauthorized materials will immediately result in a 0 on the exam. As stated in the syllabus, honor code violations may also result in an immediate F for the entire course.

Exam Retake

You will have an opportunity to retake the entire exam during the next class period. The retake format is the same as before (e.g. only access allowed websites).

However, in addition to the allowed websites, you can also consult the instructor for hints if you do not know how to fix an answer. The instructor will also go through hints for difficult questions on the board during the retake process. You will also have access to the answers on your original attempt, but the order of questions may not be the same!

You will be able to earn back a percentage of points that you missed on your original attempt. The exact percentage is determined by the exam average. The exact formula used is as follows:

Original Percentage + ( Retake Percentage - Original Percentage ) x Retake Percent

For example, suppose you earned an 80% on your original attempt and improved that to 90% on the retake. If the retake percentage is 50%, then your final score will be:

80% + ( 90% - 80% ) x 50% = 80% + ( 10% ) x 50% = 80% + 5% = 85%

It is impossible to earn a lower score due to the retake process. If your retake score is lower than your original score, we will use your original score instead.

Exam Topics

The exam will cover topics on all of the lecture slides, homework assignments, quizzes, and additional resources covered thus far in class. This includes:

Week Topic and Code Slides and Video Quizzes Homework Recordings
7 DebuggingMultithreading Basics AssertionsLoggingMultithreading - IntroductionMultithreading - SynchronizationMultithreading - Liveness Assert Statements (Original, Practice) • Logging (Original, Practice) LoggerSetup Tue 12:45p Tue 4:45p Thu 12:45p Thu 4:45p
8 SynchronizationWork Queues Custom LocksVolatile KeywordWork Queues Thread Basics (Original, Practice) • Synchronization (Original, Practice) ReadWriteLock Tue 12:45p Tue 4:45p Thu 12:45p Thu 4:45p
9 Work Queues Directory Size Calculator Work Queues (Original, Practice) PrimeFinder Thu 12:45p Thu 4:45p
10 Regular Expressions Web BasicsRegular Expressions Web Basics (Original, Practice) • HTTP (Original, Practice) • Regex Basics (Original, Practice) LinkParser N/A
11 SocketsServlets Dynamic WebpagesServlets N/A HtmlCleaner Tue 12:45p Tue 4:45p Thu 12:45p Thu 4:45p
12 ServletsSessions N/A Jetty (Original, Practice) HeaderServer Tue 12:45p Tue 4:45p Thu 12:45p Thu 4:45p
13 SQL Relational DatabasesStructured Query Language (SQL) SQL Joins (Original, Practice) • SQL Grouping (Original, Practice) N/A Tue 12:45p Tue 4:45p Thu 12:45p Thu 4:45p

See the Schedule for more information. Anything listed above that is crossed-out will not be included on the exam. Where possible, the practice quiz (does not count towards grade, unlimited attempts, and can see correct answers) is linked instead of the original quiz.

Example Topics

The following are some example topics that you may want to make sure you understand. This is a non-comprehensive list. Some of these topics may not appear on the exam and some topics not covered here may appear on the exam.

  • You should understand how to use assertions in Java using the assert keyword, and where it is (or is not) appropriate to use.

  • You should understand how to configure and use Log4j2 for logging and debugging. If given a configuration file, you should be able to determine where log messages will go (file or console), which level log messages will be output (all, info, debug, etc.), and in what format.

  • You should understand the pros and cons to multithreading, and when to use multithreading.

  • You should understand the different states of a thread, and how methods such as start(), join(), wait(), and notifyAll() affect a thread’s state.

  • You should understand how to use the synchronized keyword, and how the object used for the lock affects the number of threads that may enter a code block.

  • You should understand how to use a custom read/write lock instead of the synchronized keyword to protect access to shared data.

  • You should understand how to use a thread pool and work queue, and how they work.

  • You should understand how to create and use worker threads (using the Runnable interface or Thread class) versus how to create and use work (or tasks, Runnable objects) to be used with a work queue.

  • You should understand how to use the Pattern and Matcher classes in Java to handle regular expressions, and the difference between the find() versus matches() methods.

  • You should understand how to create character classes, such as [a-z] and [^0-9], in regular expressions.

  • You should understand how to use predefined character classes such as \w, \W, \s, \S, and . in regular expressions.

  • You should understand how to use the ?, *, and + quantifiers in regular expressions.

  • You should understand the difference between a greedy versus reluctant quantifier in regular expressions.

  • You should understand how to create and use capturing groups and non-capturing groups in regular expressions.

  • You should understand how to use the i, m, and s flags.

  • You should understand how to use the ^, $, \A, \z, and \b boundary matchers.

  • You should understand the different ways to use the ? character in a regular expression. For example: (?i) to turn on the i flag, (?:i) to create a non-capturing group that matches the i character, [?!] to create a character class that matches the ? and ! characters, i? to match the i character 0 or 1 times (greedy), and i+? to match the i character 1 or more times (reluctant).

  • You should understand basics about the Internet versus the Web, and the different components of a URL.

  • You should understand how to create and use basic sockets to connect to a server.

  • You should understand how to create basic HTTP requests.

  • You should understand and be able to create basic HTML.

  • You should understand the difference between static and dynamic web pages.

  • You should understand the basic client-server architecture used by Jetty and servlets.

  • You should understand how to create dynamic web pages using Jetty and servlets.

  • You should understand how to create, use, and modify cookies using Jetty.

  • You should understand the benefits of relational databases.

  • You should understand how to create and use statements in the Data Definition Language (DDL) of SQL. This includes the CREATE, ALTER, and DROP statements.

  • You should understand how to create and use different types of columns in SQL. This includes the INTEGER, TINYINT, SMALLINT, BIGINT, NUMERIC, FLOAT, DOUBLE, CHAR, VARCHAR, ENUM, DATE, DATETIME, and TIMESTAMP types.

  • You should understand how to use the PRIMARY KEY, FOREIGN KEY, UNIQUE, DEFAULT, NOT NULL, and AUTO_INCREMENT keywords when creating columns and tables in SQL.

  • You should understand how to create and use statements in the Data Manipulation Language (DML) of SQL. This includes the SELECT, INSERT, UPDATE, and DELETE statements.

  • You should understand how to use different types of JOIN clauses to combine results from multiple related tables in SQL. This includes INNER JOIN, NATURAL JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN, NATURAL LEFT OUTER JOIN, and NATURAL RIGHT OUTER JOIN.

  • You should understand how to sort results using the ORDER BY clause in a SELECT statement.

  • You should understand how to filter results using the WHERE clause in a SELECT statement.

  • You should understand how to combine columns using the CONCAT() function and give columns aliases using the AS clause in a SELECT statement.

  • You should understand how to combine rows using the GROUP BY clause (and aggregate functions) in SELECT statement.

  • You should understand how to use aggregate functions like GROUP_CONCAT(), COUNT(), AVG(), and SUM() in a SELECT statement.

SDS Accommodations

Students may receive exam accommodations, such as additional testing time or a more private exam setting, through Student Disability Services. If you are planning on using these exam accommodations, please read the following.

Requests

I must receive a notification for accommodation from SDS regarding this exam at least one week before the exam itself. You may have SDS proctor the exam, but you will be expected to take the exam on the same day as the rest of the class.

Exam

For exams proctored by SDS, Canvas will be configured to automatically allow you to (1) begin the exam at your scheduled appointment time and (2) give you the additional time stipulated by your SDS alternative testing contract.

You may take the exam on your own laptop or on a computer provided by SDS. The allowed websites will be linked directly from the exam; no other websites, resources, or materials may be accessed. If necessary, you can bring your own piece of scratch paper and turn it in directly to the professor when you are done.

I will actively monitoring email for questions from your proctor, but there might be up to a 20 minute delay if your appointment happens when I am in class or in code reviews.

Retake

You may decide whether to use SDS accommodations for the exam retake. The retake generally takes less time than the original exam; most students decide not to use SDS accommodations for the retake process. Since you are allowed to ask for help during the retake, this allows you to receive more immediate help and feedback.

If you do choose to use SDS exam accommodations for the retake, I will prepare some general hints you can use during the retake. The SDS proctor can send me your questions via email, but I may not be immediately available to answer those questions during your scheduled time.

It may also be possible to combine SDS exam proctoring and attending class for the retake (so you get both extra time and in-class help), but this depends on both SDS and instructor availability. To inquire further, please make a private post on Piazza.