Skip to main content
Berkeley
Electrical Engineering and Computer Sciences
4 credits

Berkeley CS 61B: Data Structures

CS 61B is Berkeley's data structures course, taught in Java, covering lists, trees, hashing, graphs, sorting, and asymptotic analysis. It's the second course in the 61 series and the one most cited in industry-interview prep. Its projects, including the famous build-your-own-world and Gitlet (build a mini Git), are substantial software engineering exercises.

Fennie is independent and not affiliated with UC Berkeley. This is an unofficial study guide.

What makes it hard

The projects are the heart and the workload: Gitlet alone takes many students 30+ hours, with an autograder and limited tokens that force you to test your own code. Exams demand fluency in asymptotics and data structure internals, and the midterm difficulty is a perennial topic on the Berkeley subreddit.

What you'll cover

  • Java and object-oriented design
  • Linked lists, trees, and balanced search trees
  • Hashing and hash tables
  • Heaps and priority queues
  • Graph algorithms
  • Sorting and asymptotic analysis

The CS 61B study guide

How to study for Berkeley CS 61B, step by step.

  1. 1

    Start Gitlet the week it drops

    Gitlet runs 30-60 hours for most students, and the limited autograder tokens mean you can't debug by resubmitting. Students who start the release week consistently report a completely different experience than late starters.

  2. 2

    Write your own tests for every project

    With token-limited autograding, your test suite is your real safety net. Building tests also forces the design thinking that 61B projects are actually teaching.

  3. 3

    Learn invariants, not implementations

    For each structure (BSTs, heaps, hash tables), be able to state the invariant and explain why each operation preserves it. Exam questions probe that understanding far more than memorized code.

  4. 4

    Keep asymptotics review running all semester

    Big-O fluency decays without contact. A few minutes of runtime-analysis practice per week beats relearning it before each exam, and the midterms lean on it hard.

  5. 5

    Work the TBP and HKN exam archives

    Berkeley's student-run past-exam archives are the canonical 61B prep. Work old midterms timed and on paper; midterm difficulty is a perennial subreddit topic for a reason.

Today's CS 61B plan

Sample
65 min

What a Fennie Daily Plan looks like for CS 61B. Yours is built from your syllabus and adapts every day to your deadlines and progress.

  • Review: Java and object-oriented designReview · 25 min

    Work back through the CS 61B material on java and object-oriented design. In the app, Fennie builds this from your own notes and syllabus.

  • Practice: Linked lists, trees, and balanced search treesPractice · 20 min

    Targeted problems on linked lists, trees, and balanced search trees, the kind CS 61B actually tests.

  • Quick quiz: Hashing and hash tablesQuiz · 10 min

    Five generated questions to expose weak spots on hashing and hash tables before the exam does.

  • Preview: Heaps and priority queuesPreview · 10 min

    A first pass over heaps and priority queues so the next session starts from familiar ground.

Get my real CS 61B plan free

First plan free, no card required. Fennie is independent and unaffiliated with your school.

FAQ

Is CS 61B harder than CS 61A?

Most students say the workload is heavier in 61B because of the projects, while 61A is more conceptually disorienting. If recursion broke your brain in 61A, 61B feels more concrete, but budget serious hours for Gitlet and the other projects.

How long does Gitlet take in CS 61B?

Commonly 30-60 hours across a few weeks. It's a design-heavy project with limited autograder tokens, so writing your own tests is essential. Students who start the week it's released consistently report a far better experience.

Do I need 61A before 61B?

CS 61A (or equivalent programming background) is the expected preparation. The Java is taught from scratch, but the course assumes you already think in functions, recursion, and basic program design.

More Berkeley courses