UCLA · CS32 · Introduction to Computer Science II

CS32: nail every assessment, not just read the notes

Your complete guide to University of California, Los Angeles's introduction to computer science ii course. See where the marks are, work real practice questions, and study with an AI tutor that knows CS32.

4 credit points Lower division undergrad Offered Winter 2026 ~35% exams Computer Science Department

Sia generates CS32 practice questions, walks through data abstraction and linked lists step by step, and quizzes you on the material the heaviest assessments weight most heavily.

Spot the bug

Find what is wrong

Multiple choice · the fix is revealed after you answer

What is the worst-case running time of this function on a vector of n integers?

    bool hasDuplicate(const vector<int>& v) {
        for (size_t i = 0; i < v.size(); i++)
            for (size_t j = i + 1; j < v.size(); j++)
                if (v[i] == v[j]) return true;
        return false;
    }
The fix

The inner loop runs n-1, n-2, ..., 1 times across the outer iterations.

That sums to n(n-1)/2 comparisons, which is O(n squared).
Early return helps only when a duplicate exists; the worst case has none.
Sorting first gives O(n log n); a hash set gives O(n) expected: both are standard exam follow-ups.

The trap: Counting the nested loop as O(n) because the inner loop starts at i+1. Halving the constant does not change the order. classic slip!

your whole grade
Where your grade comes from Coursework 65% · Exams 35%

One exam decides 35% of your grade. A score below 40 may fail the course. This whole page is built around that.

Overview

What CS32 is, and where it sits

CS 32 Introduction to Computer Science II is UCLA's data structures course in C++ and the second course in the CS sequence. The offering documented here is Winter 2026, taught in three lecture sections by Carey Nachenberg and David Smallberg with eight discussion-section teaching assistants.

The quarter opens with data abstraction, pointers, dynamic arrays and resource management, then linked lists, stacks and queues, inheritance and polymorphism and object-oriented design. Recursion, templates, iterators and the STL follow, then algorithmic efficiency and sorting, trees, tables and hash tables, priority queues and heaps, and graphs.

The grade is four projects worth 1%, 8%, 8% and 8%, five homeworks worth 15%, Midterm 1 9%, Midterm 2 16% and a three-hour final 35%. Project and homework marks are capped at 30 points above the mean exam score, and a final below 40 may fail the course regardless of total.

How it differs from its first-year siblings. Project 4 lands in finals week and Midterm 2 is nearly twice the weight of Midterm 1, so the last four weeks carry most of the grade. The homeworks are deliberately part-graded without telling you which problems count; doing them all is the intended exam preparation.

Always treat your own course outline and the exam timetable as authoritative.

Difficulty & time commitment

Is CS32 hard, and how much time does it take?

CS32 is manageable if you keep a weekly rhythm and treat the back half as the main event. The pattern is consistent: it starts gently and steepens, and the heaviest assessment is the part that separates grades.

Difficulty
3.5 / 5
Moderately hard. Gentle early, demanding back half. Hard to fail with steady work; a top grade takes consistent practice.
Coursework
65%
Coursework carries most of the grade. The heaviest single component is the exam at 35%.
Weekly time
~14 hrs
Around 14 hours per week including class, across lectures, study and assessment.
Classes, resource management and linked listssteep
Inheritance, recursion, templates and sortingsteady
Trees, hash tables, heaps, graphs and Project 4steep

The difficulty curve and the assessment weighting point the same way: the back half is harder and worth more. Front-loading effort there is the highest-return decision in the course.

Is this course for you

Who tends to do well, and who tends to struggle

You will likely do well if

  • You finished CS 31 comfortable with pointers and classes.
  • You can plan a multi-week project and start Project 4 before finals week.
  • You do every homework problem, not just the ones you guess are graded.
  • You enjoy reasoning about running time and invariants.

You may struggle if

  • Pointers and dynamic memory were shaky in CS 31; they are assumed from week 1.
  • You bank on projects to offset exams; the 30-point cap and the 40-point final rule prevent it.
  • You leave Project 4 until after the final.
  • You submit code that compiles on only one of the two required compilers.
do this ↘
What top students do differently
  • Implement each structure from scratch once (linked list, BST, hash table, heap) before using the STL version.
  • Keep a big-O table of every operation on every structure covered.
  • Practise recursion by writing the base case first, on paper.
  • Use Midterm 2's 16% weight as the signal: weeks 5-7 material is where the grade is decided.

Syllabus

The 9 topics, week block by week block

The exam-weight marker on each topic shows where the marks concentrate. The amber topics carry the highest exam weight.

1

T1 · Data abstraction and C++ classes

Weeks 1-2

Review, classes, pointers, dynamic arrays, resource management.

2

T2 · Linked lists, stacks and queues

Weeks 2-3

Node-based structures and their operations.

3

T3 · Inheritance and polymorphism

Weeks 3-4

Base and derived classes, virtual functions, OO design principles.

4

T4 · Recursion

Week 5

Recursive thinking and recursive data.

High exam weightQuiz me on recursion →
5

T5 · Templates, iterators and the STL

Week 6

Generic programming and the standard containers.

High exam weightQuiz me on templates →
6

T6 · Algorithmic efficiency and sorting

Weeks 6-7

Big-O, elementary and divide-and-conquer sorts.

7

T7 · Trees and tree-based tables

Weeks 7-8

Binary search trees, traversals, tables.

High exam weightQuiz me on trees →
8

T8 · Hash tables

Weeks 8-9

Hashing, collisions, load factor.

9

T9 · Priority queues, heaps and graphs

Weeks 9-10

Heap operations and graph representations and traversals.

How it's assessed

Assessment structure

ComponentWeightFormat & timing
Project 11%Warm-up C++ project. Week 2, due 11pm. 12.5% per hour late.
Project 28%Data-abstraction project. Week 4, due 11pm. 12.5% per hour late.
Project 3 (two parts)8%Two-part project on recursion and STL. Weeks 7-9, due 11pm. 12.5% per hour late.
Project 48%Large capstone project. Week 11 (finals week), due 11pm. 12.5% per hour late.
Homeworks (five)15%Five written homeworks with small programs; not every problem is graded and you do not know which. Weeks 3-10. 12.5% per hour late.
Midterm 1 (about one hour, week 4 evening)9%About one hour, evening sitting. Thursday of week 4, 6-7:30pm window. Mandatory.
Midterm 2 (about one hour, week 7 evening)16%About one hour, evening sitting. Thursday of week 7, 6-7:30pm window. Mandatory.
Final exam (3 hours, Saturday end of week 10)35%Three-hour cumulative final. Saturday at the end of week 10, 11:30am-2:30pm. A score below 40 may fail the course.
Project 11%
Warm-up C++ project.
Project 28%
Data-abstraction project.
Project 3 (two parts)8%
Two-part project on recursion and STL.
Project 48%
Large capstone project.
Homeworks (five)15%
Five written homeworks with small programs; not every problem is graded and you do not know which.
Midterm 1 (about one hour, week 4 evening)9%
About one hour, evening sitting.
Midterm 2 (about one hour, week 7 evening)16%
About one hour, evening sitting.
Final exam (3 hours, Saturday end of week 10)35%
Three-hour cumulative final.
  • The eight components sum to 100. Two hurdles apply: a final exam score below 40 may fail the course regardless of total, and the combined project and homework score (scaled to 100) is capped at 30 points above the mean of the three exam scores. Regrade requests must be made within one week.
  • Two mandatory evening midterms of about one hour in weeks 4 and 7 on lecture material, and a three-hour cumulative final on the Saturday ending week 10. Expect code-reading, complexity and data-structure design questions.
read this! If you read nothing else

This is a coursework course. Coursework carries 65% of the grade and the final exam (3 hours, saturday end of week 10) is the single heaviest piece at 35%, so steady work across the semester decides your result more than any one sitting. A score below 40 may fail the course.

Final exam timing: During the examination period. Confirm the exact date and venue on your exam timetable.

How to actually pass it

A weekly rhythm, two checklists, and the traps to avoid

The course rewards consistency over cramming, and practice over re-reading. Here is the loop that works, then what to have nailed before each exam.

The weekly loop

Before lecture
Skim the corresponding Walls and Mirrors chapter or Nachenberg slides.
Lecture
Write down every invariant and edge case the instructor names.
Project week
Build incrementally and test each class before moving on.
Friday
Work the discussion problems and finish the homework set.

Before the mid-semester checklist

  • Implement a linked-list insert, delete and traversal without leaks.
  • Write a class with a destructor, copy constructor and assignment operator.
  • Explain virtual functions and when polymorphism applies.
  • Write and trace a recursive function on a list or tree.

Before the final heaviest topics

  • Give the big-O of each sort and each container operation.
  • Insert, search and delete in a binary search tree.
  • Explain hashing, collisions and load factor.
  • Perform heap insert and remove and a breadth-first graph traversal.

The mistakes that cost marks

01

Memory leaks and double frees. Resource management is week 1 and is tested on every exam after.

02

Off-by-one recursion. Missing or wrong base cases are the most common recursion error.

03

Starting Project 4 late. It is large, due in finals week and loses 12.5% per hour.

Teaching team

Who teaches CS32

The bios below are factual. We do not rate lecturers; any star ratings are submitted by students who have taken CS32.

Instructor (Lecture 1)

Carey Nachenberg

Student ratingNo student ratings yet
Instructor (Lectures 2 and 3)

David Smallberg

Student ratingNo student ratings yet
Teaching Assistant

Missy Bridgwater

Student ratingNo student ratings yet
Teaching Assistant

Han Zhang

Student ratingNo student ratings yet
Teaching Assistant

Hanyu Wang

Student ratingNo student ratings yet
Teaching Assistant

Jiahao Zhang

Student ratingNo student ratings yet
Teaching Assistant

Edward Ng

Student ratingNo student ratings yet
Teaching Assistant

Chengyue Wang

Student ratingNo student ratings yet
Teaching Assistant

Yuanhao Ban

Student ratingNo student ratings yet
Teaching Assistant

Johanna Bai

Student ratingNo student ratings yet

Teaching team as listed in the course materials reviewed. AskSia does not rate lecturers; star ratings are submitted by students who have taken CS32.

Formula & concept sheet

The vocabulary and formulas you must own

Data abstraction
Separating what an operation does from how it is implemented.
Linked list
Nodes connected by pointers.
Polymorphism
Calling a derived-class function through a base-class pointer.
Recursion
A function defined in terms of smaller instances of itself.
Big-O notation
An upper bound on growth of running time.
Binary search tree
A tree with ordered keys allowing logarithmic search on average.
Hash table
An array indexed by a hash of the key.
Heap
A complete binary tree satisfying the heap-order property.
Graph traversal
Visiting vertices in breadth-first or depth-first order.

Set texts

The prescribed reading

The syllabus references map straight onto these.

Data Abstraction and Problem Solving with C++: Walls and Mirrors

.

Where it fits

Prerequisites, related courses & why it matters

Prerequisite: CS 31. 4 units; lecture 4 hours, discussion 2 hours, outside study 6 hours per week.

Why it matters beyond the grade. Data structures and complexity are the substance of technical interviews and of every systems course that follows; CS 32's projects are the first portfolio-scale C++ code most students write.

FAQ

Frequently asked questions

Is CS 32 hard?

Moderately hard on the six-factor rubric: 60% exams with a 40-point final hurdle, a capped assignment score and a large Project 4 due in finals week.

What is the assessment breakdown?

Project 1 1%, Project 2 8%, Project 3 8%, Project 4 8%, homeworks 15%, Midterm 1 9%, Midterm 2 16%, final 35%, per the Winter 2026 syllabus.

Who teaches it?

Carey Nachenberg (Lecture 1) and David Smallberg (Lectures 2 and 3) in Winter 2026, with eight discussion-section teaching assistants.

Is there a required textbook?

No. Carrano and Henry's Walls and Mirrors (6th to 8th edition) is recommended, and Nachenberg's online slides cover the material.

Which homework problems are graded?

Not all, and the syllabus says you will not know which; the intent is that you do every problem.

When is Project 4 due?

In Winter 2026 it was moved to Tuesday 17 March, during finals week, after the final exam on 14 March.

Study CS32 with Sia

Work through data abstraction, linked lists, inheritance and the rest of the course with a tutor that knows it and quizzes you on the topics the assessments weight most heavily.

Start studying with Sia