Practice problems

Choose a topic, work through an example, and reveal a hint or worked answer when you’re ready.

Showing 1–20 of 28 problems

{}

What happens when code runs?

The program adds 3 to the input score before comparing it with 6. Predict the exact message.

Beginner
{}

Debug by tracing state

The sample should sum every number. What is the first incorrect state, and how would you fix it?

Beginner
{}

Test boundaries and edge cases

A locker room allows a group size from 1 through 8 inclusive. Decide which boundary values are accepted.

Beginner
{}

How an HTTP request works

Match each successful server response or failure to the interface message that fits.

Beginner
{}

Build an accessible HTML structure

Choose an element for each user operation.

Beginner
{}

Design a responsive layout

A card needs 280px of space. Can two cards and a 16px gutter fit a container that is 560px wide?

Beginner
{}

Tables, keys and constraints

An entry references an existing book and stores pages read. Identify the constraints needed to reject missing books and negative counts.

Beginner
{}

Files, folders, and the terminal

Where does the shell look for lessons?

Beginner
{}

Bits, bytes, and binary numbers

What decimal value does it represent?

Beginner
{}

Git commits and diffs

Does a commit automatically include the latest edit?

Beginner
{}

Scope and lifetime

Can the caller still use the list?

Beginner
{}

Evaluate a machine learning model

A model flags eight items. Six are relevant, and there are ten relevant items altogether. Calculate precision and recall.

Intermediate
{}

Model Android UI state

Decide which user-visible state to show when the app receives a successful response with zero results.

Intermediate
{}

Model SwiftUI screen state

A user changes a title and taps Cancel. Which title should the list show?

Intermediate
{}

Unicode and UTF-8

How long is Aé in bytes?

Intermediate
{}

Value copies and shared references

Which outer list shows the added value?

Intermediate
{}

The call stack

Which function resumes immediately after B returns?

Intermediate
{}

Floating-point precision

What integer can represent their exact combined price?

Intermediate
{}

SQL joins and missing rows

Which books appear when Books is the left side of a left join?

Intermediate
{}

Database indexes

Which field is a natural index candidate?

Intermediate