Skip to content

Instantly share code, notes, and snippets.

@Michael0x2a
Last active February 19, 2024 04:50
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save Michael0x2a/f37ec731490d62857718f9c9efaaf3da to your computer and use it in GitHub Desktop.
Save Michael0x2a/f37ec731490d62857718f9c9efaaf3da to your computer and use it in GitHub Desktop.
CSE 143 16au study guide

CSE 143 16au study guide

How to study

Programming, to a large extent, is about applied problem-solving, and is not about memorization. This means that the best way to prep for programming exams isn't to sit down and read through the slides -- it's by solving a lot of problems.

As a result, I strongly recommend you do the following when preparing:

  1. Try working through a minimum of 3 to 4 programming problems a day, starting now.

    There are about 12 days left until the exam. If you 4 problems a day, you'll have solved about 30-50 problems by the exam, which will give you a GIGANTIC advantage over people who study last minute. If you have a very busy schedule, at least try and do 1 problem a day.

    This is partially because you'll have much more experience solving problems then people who do last-minute cramming, and partially because we sometimes just reuse problems on practice-it on the final. If you have 30-50 solved problems under your belt, the odds of encountering a freebie on the exam are much higher...

    This way, you'll also have time to ask questions if you run into problems that stump you.

    Try scheduling a 1 hour block each day on your calendar where you plan on just sitting down, and working through problems. (Also be sure to start on HW 8 early, to make sure you have plenty of time to both study AND do your HW).

  2. Allocate a day where you sit down, and work through a bunch of problems from a mystery topic.

    You should try and practice to the point where you can complete the mystery problems reliably and with 100% accuracy. It may be more productive to just sit down one day, and work through a bunch at once so you can drill. (For example, this weekend, maybe try doing a bunch of polymorphism problems)

  3. Try and solve practice-it problems in one shot. Don't "edit and recompile".

    On the final, you won't have a compiler to check your work. Do your best to solve problems on your first try. Use pencil and paper to reason through problems before you hit that "submit" button.

    If you aren't reliably getting practice-it problems correct on your first try, that means you need a lot more practice.

    (That said, to begin with, focus mainly on getting your problems correct to begin with. Once you're relatively comfortable with a topic, prioritize getting problems correct on your first try).

  4. Keep a running list of "things you need to improve on".

    When you make a mistake, overlook something, or notice that you're confused, write it down. Use your running list of mistakes to help guide you on what problem-types you have trouble with and what you need to study more.

    For example, you might find you sometimes get practice-it problems wrong because you forget to add an exception check. That might indicate that on the final, you should be extra careful about reading the instructions.

    Or, you might find that you have difficulty with linked list problems where you need to work over two linked lists. That might be a good thing to ask a TA for help about.

  5. Productive struggle is good; unproductive struggle is bad.

    It's normal to be struggling when working on problems. However, try and have "productive" struggle, not "unproductive" struggle. If you're working on a problem, and feel like you're making steady progress (even if it's slow), then that's "productive" struggle.

    However, if you're stuck and have resorted to making random changes to see if they work, that's "unproductive" struggle. If you hit the "unproductive" stage, then you should set the problem aside, take a break, try working on another problem, try asking somebody for help, etc...

Collection problems

Binary Tree Traversal and Insertion problems

You can find some practice problems here: http://practiceit.cs.washington.edu/problem/search?keyword=tree+traversals

Problem 5 on all of the practice exams also has these problem types.

On the final, try and spend only a max of ~5 minutes each on these problems (so ~10 min total) with `00% accuracy.

Collections mystery

I was able to find only two collections mystery problems involving maps on practice-it:

For this topic, I suggest you make sure you understand how exactly the following data structures behave, how efficient their various methods are, and how they differ from one another:

  • ArrayList
  • LinkedList
  • Stack
  • Queue
  • TreeSet
  • HashSet
  • TreeMap
  • HashMap

Polymorphism mystery

You can find some practice problems here: http://practiceit.cs.washington.edu/problem/search?keyword=polymorphism&language=

You should take your time on these problems on the final to make sure you don't make a silly mistake.

When working on these problems, make sure you have a solid conceptual understanding of what's going on. The cheatsheet we handed out on section should be very useful.

Programming problems

For the binary tree and linked list questions, I've sorted the questions roughly by difficulty. I would strongly recommend you prioritize solving the medium-to-hard questions first, and only try the easy-to-hard questions if you're having difficulty with the harder ones.

Disclaimer: I assessed the difficulty by sort of eye-balling the problems. I might have missed nuances to certain questions that make them easier or harder then I originally thought.

Comparable Programming

This problem requires you to implement the entire class: http://practiceit.cs.washington.edu/problem/view/cs2/exams/finals/final8/Office

The following problems require you to implement only the compareTo method. I'd recommend trying to write the complete class anyways, since that's what you'll likely be asked to do on the final.

Note: practice-it has some more problems on this topic, but I hand-picked ones that looked a little more complex. Some Comparable problems on practice-it ask you to extend a class in addition to implementing Comparable -- you won't be required to do that on this quarter's final.

Binary Tree Programming (traversal)

Note: practice-it has a more problems, but I hand-picked some ones that looked good/seemed tricky. The practice finals also have some good questions, though there'll be some overlap with practice-it. As stated above, prioritize working on the harder ones.

Easy to medium:

Medium to hard:

Binary tree programming (modification)

Same as above -- practice-it has more problems, I picked interesting ones, practice finals have good questions with some overlap, prioritize working on challenging problems.

For this topic, it is absolutely essential that you have a good understanding of the x = change(x) pattern. The style guide has some notes about x = change(x) here (mostly, it lists a bunch of things you shouldn't do/has some examples) that might be helpful.

Disclaimer: the distinction between "medium" and "hard" questions got sort of blurry here for me, so idk if they're really sorted correctly.

Easy to medium:

Medium to hard:

Linked list programming

Same as above.

Also, if you ever find yourself thinking "Gee, I wish I could use an auxilliary stack" when working on a linked list problem, that's often an indicator that the linked plist problem will be easier if you tried solving it recursively.

When solving a problem recursively, you can "store" variables and information on each level/on each stack frame -- this basically gives you an implicit auxilliary stack.

Having an (implicit) stack won't necessarily be useful for all linked list problems though, so don't try and force recursion into places where it doesn't seem natural.

That said, do keep in mind that you can replace code using loops with code using recursion, and vice versa, with enough effort. (The question is, is it actually a good idea to do that...)

Easy to medium:

Medium to hard:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment