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.

Daily C++: Turn exceptions into an error string

intermediateMulti-PartC++

Quick practice on C++ error handling: catching exceptions and returning a safe, user-facing error result without crashing.

Daily TS Text: Safe Prefix Stripping

intermediateMulti-PartTypeScript

Practice a focused string/text task in TypeScript: understand how prefix checks narrow strings conceptually, then implement a tiny utility to strip an optional prefix.

Batch DOM Writes with a DocumentFragment

intermediateMulti-PartJavaScript

A quick performance-focused check-in: avoid unnecessary layout/reflow by batching DOM insertions.

Schema-qualified module calls with dblink

intermediateMulti-PartSQL

Quick practice on using a PostgreSQL extension like a “module”: understand how it’s installed/exposed and write one query that calls it safely.

DRF Mini: Format a computed field with SerializerMethodField

intermediateMulti-PartDjango REST Framework

Quick practice on shaping output JSON in Django REST Framework by adding a computed, formatted field to a serializer.

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.

Browse by technology