Educational Cards

Learn from video content, text, and interactive tasks

Filters
Clear
Network-shaped failures without fragile parsing

HTTP layers deliver bytes on the wire; JSON parsers want text ; base64 wraps binary inside ASCII....

Intermediate Defensive APIs: validation, sanitization & exceptions
Whitelist vs blacklist at simple parsers

A whitelist allows only known-good characters ( [a-z0-9_-] for slugs). A blacklist bans known-bad...

Beginner Defensive APIs: validation, sanitization & exceptions
Exceptions signal contract violations cleanly

Return codes like -1 or sentinel strings collide with legitimate data: a temperature of -1 might be...

Beginner Defensive APIs: validation, sanitization & exceptions
Normalising calculators and tokens

Human-entered expressions mix Unicode spaces, x for multiplication, and locale-specific decimals....

Beginner Defensive APIs: validation, sanitization & exceptions
Assertions vs validator contracts

assert condition documents internal invariants you believe should already hold: “this tensor is 2-D...

Intermediate Defensive APIs: validation, sanitization & exceptions
Space complexity: recursion stack vs buffers

Auxiliary space counts extra memory beyond the input itself: recursion stack frames, temporary...

Intermediate Asymptotics & empirical timing
Amortisation snapshot: list append

CPython list is a dynamic array : appending usually takes O(1) time, but occasionally triggers a...

Intermediate Asymptotics & empirical timing
Experiments spanning input sizes

Asymptotic claims are about limits; empirical curves show where limits matter for your hardware and...

Intermediate Asymptotics & empirical timing
Checking sorted-order invariants cheaply

Monotonicity checks appear in time-series QA (“is this slice non-decreasing?”), in merge routines...

Beginner Asymptotics & empirical timing
Linear scans vs logarithmic hunts

Searching for a value in an unsorted Python list requires a linear scan in the worst case—you might...

Beginner Asymptotics & empirical timing
Empirical timings with perf_counter

time.perf_counter() returns a float timestamp from a monotonic clock suitable for deltas : subtract...

Beginner Asymptotics & empirical timing
Nested loops imply quadratic explosions

A double loop over indices (i, j) with i, j < n runs Θ(n²) iterations if the inner body is O(1)....

Beginner Asymptotics & empirical timing