Practice problems

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

Showing 41–60 of 145 problems

Jv

Class composition and inheritance

How can it use either rule without being a discount rule itself?

Intermediate
Jv

Paths and text files

Which file is selected?

Intermediate
Jv

Threads, shared state, and atomicity

What total should two successful atomic increments leave?

Advanced
Jv

Combining asynchronous results

What value does the transformed future hold?

Advanced
Jv

References, garbage collection, and leaks

Can the object be collected while the reachable map keeps it?

Advanced
Jv

Understanding JVM performance

Which measurement describes steady traffic after startup?

Advanced
JS

Your first JavaScript program

What appears in the console?

Beginner
JS

Variables with let and const

Each pack holds four cards. Print the number of cards after packing the input number of packs.

Beginner
JS

Types, conversions, and equality

Is this comparison true or false?

Beginner
JS

Strings and template literals

What does the example greeting display?

Beginner
JS

Branches and loops

Count the multiples of 3 between 1 and the given limit, inclusive.

Beginner
JS

Functions and scope

Convert the whole minutes into seconds and add the extra seconds.

Beginner
JS

Arrays and objects

Return an array of titles whose read property is false, in the original order.

Beginner
JS

Promises and async functions

Predict the order of the three log lines in the example.

Intermediate
JS

Destructuring, rest, and spread

How many items does a contain?

Intermediate
JS

Map, filter, and reduce

What array results?

Intermediate
JS

The DOM and browser events

What does querySelector return?

Intermediate
JS

JavaScript modules and imports

How do you write the import?

Intermediate
JS

Fetch, HTTP errors, and cancellation

Does fetch normally reject solely because the response is 404?

Intermediate
JS

Map and Set in JavaScript

What number is produced?

Intermediate