CJCoding With Joseph
15free / daySign inCreate account
TitleAction
1
Build A Little, Test A LittleYou write the smallest piece of a program that can be run, run it, fix it, and o...
easy○ Not StartedProblem SolvingSolve
2
Two Kinds Of DivisionWhat does this line print?...
easy○ Not StartedPrintingSolve
3
The Step Before Any CodeThe problem-solving toolkit has seven steps. Before you visualise anything, brea...
easy○ Not StartedProblem SolvingSolve
4
A Recipe Is A PlanA recipe turns "make dinner" into a list of smaller jobs: chop the onions, boil ...
easy○ Not StartedProblem SolvingSolve
5
The Bicycle Nobody TestedYou bolt together a frame, two wheels, brakes and gears that were never tried on...
easy○ Not StartedProblem SolvingSolve
7
Sandwich Before The ClubInstead of starting straight on a three-layer club sandwich, you first make a pl...
easy○ Not StartedProblem SolvingSolve
10
Fail Early Fail OftenWhat does the toolkit's advice "fail early, fail often" ask you to do while writ...
easy○ Not StartedProblem SolvingSolve
11
What The Cards Stand ForThe deck visualises a problem with real objects: a stack of numbered cards laid ...
easy○ Not StartedProblem SolvingSolve
13
What Input Hands BackThe program runs `age = input('How old are you? ')`, the user types 42 and press...
easy○ Not StartedUser InputSolve
14
Type Of A Decimal LiteralWhat does this line print?...
easy○ Not StartedPrintingSolve
16
A Separator Of NothingWhat does this call print?...
easy○ Not StartedPrintingSolve
17
Reversed By A SliceWhat does this line print?...
easy○ Not StartedListsSolve
19
Counting From The EndWhat does this program print?...
easy○ Not StartedListsSolve
21
What The Slice IncludesWhat does this program print?...
easy○ Not StartedStringsSolve
23
Two Decimals Of PiWhat does this line print?...
easy○ Not StartedPrintingSolve
24
Braces Inside The QuotesWhat does this program print?...
easy○ Not StartedStringsSolve
25
Making A Virtual EnvironmentWhat does the terminal command `python -m venv .venv` do?...
easy○ Not StartedCommand LineSolve
26
First Item Of ArgvThe program is started with `python report.py data.csv 3`. What does `sys.argv[0...
easy○ Not StartedCommand LineSolve
29
Window Without MainloopA tkinter program creates a window and a button wired with `command=save`, and t...
easy○ Not StartedMenus & ValidationSolve
30
Pack Or Gridtkinter widgets can be placed with `pack()` or with `grid()`. What is the differ...
easy○ Not StartedMenus & ValidationSolve
31
Opening With WThe file `notes.txt` already holds three lines. The program opens it with `with ...
easy○ Not StartedFilesSolve
35
What Recursion Error MeansThis program stops with `RecursionError: maximum recursion depth exceeded`. What...
easy○ Not StartedRecursionSolve
37
Stripping The EdgesThe menu reads a choice with `.strip()` because the user may add spaces and the ...
easy○ Not StartedMenus & ValidationSolve
39
Slowest Growth To FastestWhich list puts these complexity classes in order from the slowest-growing (best...
easy○ Not StartedBig-OSolve
40
Dropping What Does Not MatterAn algorithm does `n^2 + 3n + 8` steps for an input of size n. What is its Big-O...
easy○ Not StartedBig-OSolve
43
Why Binary Search Needs OrderBinary search looks at the middle item and discards half of the list at each ste...
easy○ Not StartedData Structures & AlgorithmsSolve
50
Last In Or First InA stack and a queue differ in which item comes out next. Which answer pairs each...
easy○ Not StartedData Structures & AlgorithmsSolve
52
Why In-Order Comes Out SortedIn a binary search tree every key in a node's left subtree is smaller than the n...
easy○ Not StartedData Structures & AlgorithmsSolve
53
Children In An Array TreeA complete binary tree is stored in a plain list with the root at index 0. Where...
easy○ Not StartedData Structures & AlgorithmsSolve
55
Bind Listen AcceptA TCP server and a TCP client are written with the `socket` module. Which calls ...
easy○ Not StartedNetworkingSolve
56
Text Does Not Fit In A SocketSending the string `'hi'` through a socket with `send` fails, while `send('hi'.e...
easy○ Not StartedBytesSolve
62
Assign And Test In One GoWhat does the walrus operator `:=` do, and what does this program print?...
easy○ Not StartedOperatorsSolve
6
Edges Of The JigsawPeople doing a jigsaw usually start with the straight-edged border pieces, becau...
medium○ Not StartedProblem SolvingSolve
8
One Loop Shape Two Problems"Print the even numbers up to 50" and "print the prime numbers up to 50" are sol...
medium○ Not StartedProblem SolvingSolve
9
Why Integration Bugs Hurt MostEvery part of a program seems fine on its own, yet the program fails once the pa...
medium○ Not StartedProblem SolvingSolve
15
Division That Comes Out EvenBoth divisions here come out exactly, with nothing left over. What do the two li...
medium○ Not StartedPrintingSolve
20
Length Of A Nested ListWhat does this program print?...
medium○ Not StartedListsSolve
22
Asking For A Key That Is Not ThereThe record has two keys. What happens when the program looks up a key that is no...
medium○ Not StartedDictionariesSolve
27
Why Reach For ArgparseA program could read its options straight out of `sys.argv`. What does `argparse...
medium○ Not StartedCommand LineSolve
28
A Flag Without A ValueAn option is declared with `parser.add_argument('--verbose', action='store_true'...
medium○ Not StartedCommand LineSolve
32
What With GuaranteesWhy does the deck open files with `with open('input.txt') as f:` rather than a p...
medium○ Not StartedFilesSolve
33
Load Versus Loads`json.load` and `json.loads` both turn JSON text into Python values. What is the...
medium○ Not StartedJSONSolve
34
Reader Versus DictReaderA CSV file begins with the header line `name,age` followed by the row `Maya,19`....
medium○ Not StartedCSVSolve
36
Calling The Parent ConstructorWhat does the `super().__init__(name, grades)` line do inside `HonourStudent`?...
medium○ Not StartedClassesSolve
41
Three Cases Of Linear SearchLinear search walks a list of n items from the front until it finds the target. ...
medium○ Not StartedBig-OSolve
42
When Quicksort Goes QuadraticQuicksort is usually O(n log n). What is its worst case, and which pivot choice ...
medium○ Not StartedData Structures & AlgorithmsSolve
44
Finding Duplicates Two WaysTo decide whether a list of n numbers holds a duplicate, one program compares ev...
medium○ Not StartedData Structures & AlgorithmsSolve
45
The Hidden Cost Of RecursionA recursive sum of a list of n items makes one nested call per item. Besides tim...
medium○ Not StartedBig-OSolve
48
Remembering SubproblemsThe naive recursive `fib(35)` takes seconds because it computes the same values ...
medium○ Not StartedData Structures & AlgorithmsSolve
49
Array Or Linked ListCompare an array (a Python list) with a singly linked list that keeps only a poi...
medium○ Not StartedData Structures & AlgorithmsSolve
51
Why Pop From The Front Is SlowA queue built on a plain Python list removes the front item with `items.pop(0)`....
medium○ Not StartedData Structures & AlgorithmsSolve
57
Waiting At The SocketThe deck says that `accept()` and `recv()` are blocking calls. What does that me...
medium○ Not StartedNetworkingSolve
58
When Async Pays OffWhen does `asyncio` make a program faster, and why does one ordinary blocking ca...
medium○ Not StartedConcurrencySolve
60
Two Threads One CounterTwo threads each add 1 to a shared `counter` 100,000 times, and the final value ...
medium○ Not StartedConcurrencySolve
12
Finding One Card In A Hundred ThousandWith 100 shuffled cards you find a given number by flipping through them one at ...
hard○ Not StartedProblem SolvingSolve
18
A Hint Is Not A GuaranteeThe deck writes type hints such as `name: str = 'Giselle'`. This program assigns...
hard○ Not StartedType HintsSolve
38
Is A Or Has AIn the deck, `class HonourStudent(Student)` extends `Student`, and every `Studen...
hard○ Not StartedClassesSolve
46
Picking The StrategyMatch each problem to its strategy, in order: placing eight queens by trying a s...
hard○ Not StartedData Structures & AlgorithmsSolve
47
When Greedy Change FailsGreedy change-making takes the largest coin that still fits at every step. With ...
hard○ Not StartedData Structures & AlgorithmsSolve
54
Height Decides The CostSearching a binary search tree costs O(h), where h is the height of the tree. Wh...
hard○ Not StartedData Structures & AlgorithmsSolve
59
Three Sleeps At OnceThree coroutines each `await asyncio.sleep(...)` for 2, 1 and 3 seconds and are ...
hard○ Not StartedConcurrencySolve
61
Four Cores One InterpreterTwo threads each crunching numbers on a four-core machine take as long as one th...
hard○ Not StartedConcurrencySolve