EraCode practice

Public coding challenges

Browse community-shared practice across technologies. These pages are teasers only — skill maintenance still happens when you attempt the full challenge inside EraCode.

Accessible focus: programmatically focus an error summary

intermediateMulti-PartJavaScript

Practice a small JavaScript accessibility pattern: move keyboard focus to an error summary after validation so screen reader and keyboard users get immediate context.

Testing: Verify a function was called with the right args (Jest spy)

intermediateMulti-PartJavaScript

Quick check-in on JavaScript testing: understand when to use a spy and implement a tiny Jest assertion to verify call arguments.

Stabilize context value to prevent wasted re-renders

intermediateMulti-PartReact.js

Quick performance-focused drill: identify when context updates cause unnecessary renders, then fix a small Provider so its value stays referentially stable across renders unless the data actually changes.

Request Flow in SQL: Consistent Reads with a Transaction Snapshot

intermediateMulti-PartSQL

Practice treating a SQL transaction as the “request scope” so multiple queries in one request see a consistent view of data.

DynamoDB Item Size: Pick the Right Shape

intermediateMulti-PartAWS

Quick daily practice on AWS data structures: choose an efficient DynamoDB attribute type and implement a tiny helper that builds a compact DynamoDB item from a JS object.

Snapshot testing a dict result with pytest

intermediateMulti-PartPython

Quick practice on Python testing: assert a stable snapshot of a function’s returned dict using pytest.

Route users by locale with CloudFront Viewer Country

intermediateMulti-PartAWS

Practice an internationalization pattern on AWS: using CloudFront geolocation to pick a locale-specific origin path without changing your app code.

Lambda Cold Start: One-Time Init with Lazy Global Cache

intermediateMulti-PartAWS

Practice a lifecycle/initialization pattern in AWS Lambda: doing expensive setup once per execution environment and reusing it across invocations.

Stop Recursive Step Functions Executions Safely

intermediateMulti-PartAWS

Practice preventing accidental recursion in AWS Step Functions by using execution metadata to short-circuit loops.

Whitelist DTO validation: forbid unknown fields

advancedMulti-PartNestJS

Security/validation micro-practice: prevent mass-assignment by rejecting requests that include properties not defined in your DTO.

Daily NestJS Math: Safe numeric parsing with pipes

advancedMulti-PartNestJS

You’ll answer one advanced conceptual question about numeric validation in NestJS, then fill a single missing piece in a custom pipe that parses a route param into a finite number with bounds.

Iterate route params into static pages (generateStaticParams)

intermediateMulti-PartNext.js

Practice iterating over a dataset to prebuild dynamic routes in the Next.js App Router using generateStaticParams.

Mock Next.js navigation in a client-component test

intermediateMulti-PartNext.js

Quick daily practice on testing Next.js client components: mock the App Router navigation hook so you can assert route changes without a real browser.

Abortable async: cancel a fetch with AbortController

intermediateMulti-PartTypeScript

Quick practice on handling async side effects safely by making a request cancellable with AbortController.

Default vs Named Imports: Fix the Component Import

intermediateMulti-PartReact.js

Quick check on ES module import shapes in a React codebase: identify correct import usage and patch a single broken import so the app renders.

Request-Scoped Dependency via g (Tiny DI)

intermediateMulti-PartFlask

Practice Flask context-based dependency injection by attaching a request-scoped service to the application context and retrieving it inside a route.

A11y Quick Win: Announce Route Changes in the App Router

intermediateMulti-PartNext.js

Practice a small but meaningful accessibility improvement in a Next.js App Router layout: add an aria-live announcement so screen reader users get feedback when navigation completes.

CSP for inline styles: add a nonce to your Cloudflare Worker HTML response

intermediatecodingCloudflare

Return an HTML page from a **Cloudflare Worker** where a `<style>` tag is allowed by CSP without using `unsafe-inline`. - Generate a per-request nonce and apply it to the `<style>` tag. - Set a `Content-Security-Policy` header that allows only that nonce for `style-src`. - Keep everything else simple (just return the HTML + headers).

Durable Object: Maintain a unique visitor set per day

intermediatecodingCloudflare

Implement **one data-structure update** in a Cloudflare **Durable Object**. - Store a **set of unique visitor IDs** for a given day in Durable Object storage. - When a visitor ID is recorded, it should be added only once (idempotent). - Return the updated **unique count** for that day.

Daily SQL Pattern: Greatest-N-Per-Group (Latest row per user)

intermediateMulti-PartSQL

Practice a common SQL idiom for picking the latest record per group using a window function, plus a quick concept check about trade-offs.

Top-K by Count with a Heap

intermediateMulti-PartPython

Quick practice on Python data structures: understand heap behavior and implement a small top-K selection using a heap.

Blueprint-local error handling

intermediateMulti-PartFlask

Practice a Flask idiom: keeping error handling scoped to a Blueprint instead of global app-wide handlers.

Daily JS: Count Items with a Map

beginnerMulti-PartJavaScript

Quick practice on JavaScript data structures: using Map for frequency counting, plus a short concept check.

Preserve filters while navigating (URLSearchParams + router)

intermediateMulti-PartNext.js

Quick practice on Next.js navigation: keep existing query params when routing to a new path.

Browse by technology