Difficulty: Beginner | Prerequisites: Three years of high school maths or Math 112. No prior programming experience required.
CS 124 is a first course in computer science at the University of Illinois at Urbana-Champaign, taught in Kotlin (with Java as an alternative). It covers both the conceptual side of CS (how to think about problems, algorithms, and data) and the practical side (how to write, test, and debug real programs). The course moves from imperative programming through object-oriented programming to data structures and algorithms, with a semester-long Android application project tying everything together. If you are coming in cold, this is where the entire CS sequence begins.
CS 124 teaches you to solve problems by designing algorithms, representing data, and writing programs in Kotlin or Java. The course is split into three major blocks: imperative programming, object-oriented programming, and data structures/algorithms. You will build an Android app across the second half of the semester to practise everything in a real project.
Algorithm
A step-by-step procedure for solving a problem, written precisely enough that a computer can carry it out. Think of it as a recipe: each instruction must be unambiguous, and the order matters.
Iterative algorithm
An algorithm that repeats a set of steps using a loop (for, while) until a condition is met. In simple terms, this means "keep doing this thing until you are done."
Recursive algorithm
An algorithm that solves a problem by calling itself on a smaller version of the same problem, then combining the results. Think of it as Russian nesting dolls: open one, find a smaller one inside, keep going until you reach the smallest.
Computational requirements (time complexity)
A measure of how the running time of an algorithm grows as the input size increases. In simple terms, this means "how much slower does it get when you give it more data?"
Storage requirements (space complexity)
A measure of how much memory an algorithm needs as the input size increases. Think of it as how much desk space you need to work through a problem.
Data representation
How computers encode and store information internally, including numbers, text (strings), and multimedia (images, audio). Computers work in binary, so every type of data must be translated into a format the machine can handle.
Object orientation (OO)
A programming paradigm that organises code around "objects," each bundling together related data and the operations that act on that data. Think of it as building with Lego: each brick has a shape (data) and a way of connecting (behaviour), and you snap them together to make something larger.
Object type (class)
A blueprint that defines what data an object holds and what operations it can perform. In simple terms, this is the template you use to stamp out individual objects.
Encapsulation
The practice of hiding an object's internal details and exposing only what other parts of the program need to use. Think of it as a vending machine: you press a button and get a drink, but you do not need to know how the mechanism inside works.
Inheritance
A mechanism that lets one class (the child) reuse and extend the data and behaviour of another class (the parent). In simple terms, this means a new class can start with everything an existing class already has, then add or change things.
Data structure
A particular way of organising and storing data so that specific operations (searching, sorting, inserting, deleting) can be performed efficiently. Think of it as choosing the right container for the job: a filing cabinet, a stack of trays, or a phone book each make different tasks easy.
Integrated Development Environment (IDE)
A software application that combines a code editor, compiler/interpreter, debugger, and other tools in one interface. CS 124 uses Android Studio.
Version control (Git)
A system that tracks every change made to your code over time, letting you revert mistakes, compare versions, and collaborate. Think of it as an undo history for your entire project, shared with your team.
Test-driven development (TDD)
A practice where you write automated tests for a feature before writing the code that implements it. The cycle is: write a failing test, write just enough code to pass it, then clean up.
Build system (Gradle)
A tool that automates compiling your code, running tests, and packaging the result into a runnable application. In simple terms, it is the assembly line that turns your source files into a working app.
Debugging
The process of finding and fixing errors (bugs) in your code. It involves reading error messages, tracing program execution, and testing hypotheses about what went wrong.
Every programming task follows the same cycle, and understanding this cycle is itself a skill the course teaches:
Read and understand the problem. Before touching code, make sure you know exactly what is being asked. Misreading the specification is one of the most common sources of errors.
Formulate a plan. Decide how to solve the problem, including how to handle edge cases and unusual inputs. This is where algorithm design lives.
Express the plan precisely. Translate your plan into code the computer can execute. Precision matters: computers do exactly what you tell them, not what you meant.
Test and evaluate. Run your solution and check whether it fully solves the problem.
Debug and iterate. Your first attempt will almost certainly fail. Read the feedback, identify what went wrong, adjust your plan, and try again.
This cycle, reading comprehension, planning, precise expression, accepting mistakes, and fixing them, is transferable well beyond programming.
CS 124 is organised into three consecutive units. Quizzes 1 through 5 cover the first block, quizzes 6 through 9 cover the second, and quizzes 10 through 15 cover the third. The catch-up grading policy does not bridge across these boundaries (more on that below).
Imperative programming (Quizzes 1 to 5). Variables, operators, conditionals, loops, functions. You learn to tell the computer what to do, step by step.
Object-oriented programming (Quizzes 6 to 9). Objects, classes, types, encapsulation, inheritance. You learn to organise code into reusable, modular pieces.
Data structures and algorithms (Quizzes 10 to 15). How to store, organise, and process data efficiently. You learn to reason about tradeoffs between different approaches: which algorithm is faster, which data structure uses less memory, and why.
Two fundamental approaches to designing algorithms appear throughout the course:
Iterative: uses loops to repeat a block of code. Straightforward for tasks like summing a list or searching through items one by one.
Recursive: a function calls itself with a smaller input, working toward a base case that stops the recursion. Useful for problems that have a naturally self-similar structure (e.g. traversing a tree, computing factorials).
You will need to reason about both the time complexity (how long does it take?) and the space complexity (how much memory does it use?) of each approach.
Computers store everything as binary (zeroes and ones). CS 124 covers how this applies to:
Numbers: integers, floating-point values, and the limits/precision issues that arise from binary encoding.
Strings: sequences of characters, and how text is stored and manipulated.
Multimedia: images and audio, and how they are represented digitally.
The four ideas you need to hold together:
Object orientation: code is organised around objects rather than around functions or procedures.
Object types (classes): the blueprints from which objects are created, defining their fields (data) and methods (behaviour).
Encapsulation: keeping internal state private and exposing a controlled public interface, so that other code cannot break your object's invariants.
Inheritance: letting a new class extend an existing one, reusing its logic and adding or overriding behaviour.
A core conceptual skill the course develops: given two algorithms or two data structures that solve the same problem, which should you choose? The answer depends on the tradeoffs:
Faster lookup vs faster insertion
Less memory vs faster execution
Simpler code vs better performance at scale
Learning to reason about these tradeoffs is one of the main things that separates computer science from "just programming."
The practical side of the course introduces a professional-grade toolchain:
Android Studio (IDE): where you write and debug code.
Git (version control): tracks changes and enables collaboration.
Gradle (build system): compiles and packages your project.
checkstyle / ktlint (coding conventions): enforces consistent code formatting.
Test-driven development: write tests first, then write code to pass them.
Pair programming: two people, one keyboard, alternating who drives. The course enforces this for partnered MP work to ensure both partners learn from every part of the project.
The problem-solving cycle taught in CS 124 is the same cycle professional software engineers use every day, from reading a product spec to shipping tested code. The Android project specifically mirrors industry practice: you build one application incrementally over weeks, living with your earlier decisions and improving on them, rather than starting from scratch each time. This is how most real software is built.
"Computer science is just programming." Programming is the tool; computer science is about designing solutions (algorithms) and reasoning about their efficiency. The conceptual side matters as much as the code.
"If my code runs, it is correct." Code can produce the right output for some inputs and fail on edge cases. Testing and reasoning about correctness are separate, essential skills.
"Recursion is always better than iteration (or vice versa)." Each approach has strengths. Some problems are more naturally recursive; others are more naturally iterative. The right choice depends on the problem, the data, and the performance requirements.
"Prior programming experience determines success." The course reports only a 2% grade gap between students with and without prior experience. Consistent daily practice matters far more than what you knew coming in.
⚠️ The course is cumulative. Every concept builds on the previous ones, so falling behind on early material (variables, conditionals, loops) will compound through objects and into data structures.
⚠️ Quizzes include programming questions and debugging challenges, not just multiple choice. You will write and fix real code under time pressure, without access to the internet or course staff.
⚠️ Catch-up quiz grading does not cross unit boundaries. Quiz 5 (end of imperative) and Quiz 9 (end of objects) cannot be retroactively boosted by the next quiz, because the next quiz covers different material.
⚠️ Understanding runtime and design tradeoffs between algorithms and data structures is a stated learning objective. Expect quiz questions that ask you to compare approaches, not just implement them.
⚠️ You must be able to explain OOP concepts (object orientation, types, encapsulation, inheritance) in your own words, not just use them in code.
True or false: A recursive algorithm always uses less memory than an iterative one.
Fill in the blank: __________ is the practice of hiding an object's internal details and exposing only a controlled public interface.
True or false: Time complexity measures how much memory an algorithm needs.
Fill in the blank: In test-driven development, you write the __________ before writing the code.
True or false: Inheritance allows a child class to reuse and extend the behaviour of a parent class.
Answers: 1. False (recursion often uses more memory due to the call stack). 2. Encapsulation. 3. False (that is space complexity; time complexity measures running time). 4. Tests. 5. True.
Q: What is the difference between an iterative algorithm and a recursive algorithm?
A: An iterative algorithm uses loops to repeat steps until a condition is met. A recursive algorithm solves a problem by calling itself on a smaller sub-problem, working toward a base case. Both can solve the same problems, but they differ in structure, readability, and memory usage.
Q: Name the four core object-oriented programming concepts covered in CS 124.
A: Object orientation, object types (classes), encapsulation, and inheritance.
Q: Why do computer scientists care about both time complexity and space complexity?
A: Because improving one often comes at the cost of the other. An algorithm might run faster by using more memory (caching results), or use less memory by recomputing values each time. Understanding both lets you choose the right tradeoff for a given problem and set of constraints.
Q: What does encapsulation protect against?
A: It prevents other parts of the program from directly accessing or modifying an object's internal state in ways that could break its intended behaviour. Only the public interface is exposed, so the internal implementation can change without affecting the rest of the codebase.
Q: Describe the problem-solving cycle used in programming.
A: Read and understand the problem, formulate a plan (including edge cases), express the plan as precise code, test and evaluate the result, then debug and iterate until the solution is correct.
This material is the foundation for every subsequent CS course at Illinois. CS 128 and CS 225 assume fluency with the concepts introduced here, particularly OOP, recursion, and basic algorithm analysis. The data-structures-and-algorithms block connects directly to CS 225 (Data Structures), which goes deeper into trees, graphs, hash tables, and complexity analysis.
The problem-solving process itself connects to every field that uses computation: data science, machine learning, systems engineering, and beyond. Learning to reason about tradeoffs between approaches is a skill that scales from small homework problems to large-scale system design.
CS 124, CS124, UIUC, University of Illinois, Intro to Computer Science, introduction to computer science, Kotlin, Java, algorithm, iterative, recursive, recursion, loop, data structure, object-oriented programming, OOP, class, object, encapsulation, inheritance, polymorphism, time complexity, space complexity, Big O, Android Studio, IDE, Git, version control, Gradle, build system, test-driven development, TDD, debugging, pair programming, checkstyle, ktlint, coding conventions, machine project, CS 124 Fall 2024, Geoffrey Challen