Last Updated: September 6, 2019
This page contains instructions on how to prepare for the MPCS Programming Placement Exam. If you are registered for this exam, please make sure you read this page carefully.
It is your responsibility to complete the items on this checklist before the exam. If you do not, it will very likely impact your performance in the exam. Please read this list carefully.
❏ You have read and understand the instructions in this page.
If anything is unclear, do not wait until the day of the exam! Contact us as email@example.com.
❏ You have read the exams from previous years.
Links to past exams are provided in this page.
❏ You understand and are aware that the exam will be carried out on Ubuntu Linux 16.04 machines.
No UNIX experience is required to do the exam. Ubuntu 16.04 provides a user-friendly desktop environment similar, but not identical, to the desktop environments found on Windows and Mac machines. Popular developer tools, like Eclipse and Sublime Text, are installed on the exam machines. This page includes suggestions on how to familiarize yourself further with the exam machines.
❏ You have familiarized yourself with the input/output requirements of the exam problems, using your programming language of choice.
❏ You have familiarized yourself with the online Kattis system which is used to administer the exam, and you have submitted your Kattis username to the MPCS.
❏ You have verified that your language of choice is supported on Kattis (see this page for list of supported languages). You understand that you must do the exam in the supported language you are most proficient in. In the past, some students have incorrectly assumed that they had to do the exam in the language they expect to use the most in the MPCS. That is not the case: please do not learn a new language just for this exam. Use the language you are most comfortable with.
❏ You have solved at least one past exam problem successfully on the online Kattis system, using your programming language of choice.
The last four items are very important! Kattis is a web-based system that we use to administer the exam, and which includes a public website where anyone (including you) can solve programming problems using the exact same interface you will encounter during the exam. In fact, our past placement exams are all available on the public Kattis website, and you can work on them from any location (you do not need to wait until you are at UChicago). This page includes instructions on how to familiarize yourself with the Kattis system. Take into account that, at the exam, we will assume that you are already familiar with Kattis!
In the programming placement exam, you will have 90 minutes to write programs that solve a series of programming problems of varying difficulty. You will have access to a single computer. During the exam, network access (both to the Internet and to other machines in the room) will be disabled. This exam is meant to be done entirely on a computer, and you are expected to write code that compiles and runs correctly.
The exam will have five problems. To pass the exam, we expect students to solve three problems (with, at most, only minor issues or errors). Partial credit may be awarded for partial solutions. Students who want to place into Advanced Programming must solve at least four problems. Students who want to waive the Core Programming requirement need to solve all five problems.
Please note that, to pass the exam, students must submit solutions to at least two problems during the exam, where the solution compiles, runs, and passes at least one sample test case. Students who do not meet this requirement will automatically fail the exam, regardless of any credit awarded for partial solutions.
During the exam, you will submit your solutions through Kattis, a web-based system that will run your solution with a series of test cases, and will tell you whether your solution passed the test cases or not. Although the results of the test cases will be a factor in evaluating your solution, your code will also be stored in a database for further evaluation by a human grader.
Kattis has a public website that you can access at any time before the exam. This website provides the exact same interface you will encounter during the exam. All our past placement exams are available on this section of the Kattis website:
On that page, click on an academic year, and then on the “Problem list” link. This will show you a list of all the problems from that year's exam. To submit a solution to a problem, you will need to create an account on the general Kattis site:
Please note that, although the Kattis site allows you to log in with your Google/Facebook/LinkedIn account, at the exam you will need to log in with your username and password. For instructions on how to find your Kattis username (and set your password), visit this page.
You should also read the documentation provided by Kattis, specially their tutorials on submitting solutions:
To reiterate: this is the exact same system you will encounter during the exam. Although it is fairly user-friendly, the input/output requirements of the problems trip some people up the first time they work on an exam problem. The best thing you can do to prevent this from happening is to solve some of the past exam problems on Kattis well in advance of the placement exam.
As you will see on the Kattis site, all the exam problems require you to write a program that will read some input, which you must then process in a way specified in the problem statement, and produce an output in a specific format. You must write your solution in a single file (Java programmers, note that you can include additional top-level classes in a single source file as long as they are unqualified: just "class", without "public")
The format of the input and output is described in each exercise, and you must follow them rigorously. Each problem includes some sample input/output data that you can use to test your solution. Take into account that we will also test your solution with larger test cases.
All input is read from standard input (i.e., it is read “from the console”). You can assume that all input is correct and meets the specifications given in the problem statement; do not waste time validating the input. All output should be printed to standard output. Anything printed to standard error will be ignored (i.e., you can use standard error to print debugging statements).
As you work through past exam problems, you'll notice that the input/output requirements are very similar across problems. In particular, it is useful to think of the input as a stream of tokens (with each value, or token, separated by a space or a newline). All modern programming languages include libraries to easily read in this kind of data, without having to read in the file byte by byte or doing any complicated parsing. In particular, you may want to look at:
- C: fscanf()
- C++: The iostream library, including the << and >> operators.
- Python: file.read().split()
- Java: StreamTokenizer
Note: You are not limited to using just the above mechanisms. They are just suggestions; if you have another preferred method of reading tokenized input in your programming language of choice, you are welcome to use it (as long as it doesn't require using external libraries not included with the language's standard library).
All the machines are GNU/Linux Ubuntu 16.04 machines, and include the following compilers and interpreters:
- OpenJDK Java 1.8.0_131
- GCC 5.4.1
- Python 2.7.12 and 3.5.2
- Ruby 2.3.1p112
- Mono C# compiler 4.2.1
- PHP 7.0.4
The following programming tools are also provided:
- Eclipse 3.8.1 (with C/C++ Development Tools)
- Sublime Text 2
- GEdit (a barebones text editor)
- GNU Make 4.1
- GDB 7.11
- GNU Emacs 24.5.1
- vim 7.4
Since network access will be disabled, you will be provided with local copies of the Java API documentation, C/C++ reference documentation (from cppreference.com), Python documentation, the Ruby core and standard library documentation, and the PHP manual.
No UNIX experience is required to do well in the exam. All the problems can be solved by using just a barebones text editor to write and edit code, and then submitting that code through the Kattis website; no special tools or libraries are required. If you would like to familiarize yourself with the exam machines before the exam, you have two options:
Logging into a CS machine any day before the exam. The exam machines use the standard software environment installed in all the desktop computers operated by the Department of Computer Science. If you are on campus any day before the exam, you will find CS Linux machines in the Computer Science Instructional Laboratory in Crerar Library (note: you will need a valid UChicago ID card to enter Crerar Library). You can log into any of these machines using your CNetID, and will have access to the exact same software environment you will encounter during the exam.
Using the CS department's Ubuntu 16.04 VM. The department provides students with a Virtual Machine (VM) image that approximates the software environment found on the CS Linux machines. This provides a convenient mechanism for familiarizing yourself with our computing environment without having to install Linux on your own machine.
You can download the CS department's VM image here: https://howto.cs.uchicago.edu/vm:index. That page also includes instructions on how to install and run the VM.
Using an Ubuntu Live CD or bootable USB drive. If you are unable to run a VM on your computer, you can also run Ubuntu on your computer by booting your computer from a “Live CD” or a bootable USB drive with Ubuntu on it. You can find instructions on how to do this here: http://www.ubuntu.com/download/desktop. Please note that, while this will allow you to familiarize with the desktop environment in Ubuntu, the software environment provided in these "Live CD"s or bootable USB drives may not have the same tools and compilers that are installed on the CS Linux machines and on the CS VM.
During the exam
The exam will include five problems. The difficulty of the problems will be similar to the sample exams from previous years. In this exam, we need to see evidence that you know how to write code that compiles and runs correctly: Three partial solutions (as long as they compile and run) are actually much better to us than a single solution (even if it is 100% correct). The more code we see from you, the better.
We suggest you follow this strategy during the exam:
Select a problem that you feel you can solve easily, and write a solution.
Manually test the solution with the sample input provided. Since all programs must read from standard input, when your program runs it will be waiting for input to be entered on the console. You can just copy-paste the sample input and press Control-D to signal the end of input. Check whether it produced the exact same output shown on the handout. If it does not, your solution is incorrect.
If your output matches the output shown in the handout, submit to Kattis. You will get a “judgement” from Kattis. You can find a description of the Kattis “judgements” here: https://open.kattis.com/help/judgements
If you get an “Accepted” judgement, you're done with this problem. Move on to the next one.
If you get anything other than “Accepted”, it's likely that your solution is substantially correct, but is failing on a corner case. Additionally, “Time Limit Exceeded” judgements can be triggered by a solution that uses an algorithm that is too inefficient.
Don't obsess over this! If your solution (1) compiles, (2) runs, and (3) solves the problem correctly for the sample input/output shown in the handout, then your solution is very likely 95% correct. Move on to the next problem, and revisit any non-Accepted problems if you have time at the end.