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
Class composition and inheritance
How can it use either rule without being a discount rule itself?
Paths and text files
Which file is selected?
Threads, shared state, and atomicity
What total should two successful atomic increments leave?
Combining asynchronous results
What value does the transformed future hold?
References, garbage collection, and leaks
Can the object be collected while the reachable map keeps it?
Understanding JVM performance
Which measurement describes steady traffic after startup?
Your first JavaScript program
What appears in the console?
Variables with let and const
Each pack holds four cards. Print the number of cards after packing the input number of packs.
Types, conversions, and equality
Is this comparison true or false?
Strings and template literals
What does the example greeting display?
Branches and loops
Count the multiples of 3 between 1 and the given limit, inclusive.
Functions and scope
Convert the whole minutes into seconds and add the extra seconds.
Arrays and objects
Return an array of titles whose read property is false, in the original order.
Promises and async functions
Predict the order of the three log lines in the example.
Destructuring, rest, and spread
How many items does a contain?
Map, filter, and reduce
What array results?
The DOM and browser events
What does querySelector return?
JavaScript modules and imports
How do you write the import?
Fetch, HTTP errors, and cancellation
Does fetch normally reject solely because the response is 404?
Map and Set in JavaScript
What number is produced?