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.

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.

Compose props with intersection types

intermediateMulti-PartTypeScript

Practice composing object shapes in TypeScript using structural typing. One quiz + one tiny coding gap.

Env config: validate and default a feature flag

intermediateMulti-PartZod

Quick Zod practice on environment/config parsing: interpret env strings safely and provide a sensible default.

Path Aliases: Clean Imports in a Next.js App

intermediateMulti-PartNext.js

Practice a focused Next.js modules/imports skill: using a TypeScript path alias to avoid brittle relative imports.

Fast conditional GETs with ETag (Express optimization)

intermediateMulti-PartExpress

Practice an optimization pattern in Express: let clients reuse cached responses by supporting conditional GETs with ETags.

Daily Routing: Match URL Paths with a Compiled Pattern

intermediateMulti-PartPython

Practice a small routing/navigational pattern: choosing the right handler for a URL path using a compiled route table.

Schema-qualified calls to functions in other modules

intermediateMulti-PartSQL

Practice using SQL module-like organization via schemas by calling a function from a different schema safely and explicitly.

Bucket rows with CASE in PostgreSQL

intermediateMulti-PartPostgreSQL

Practice PostgreSQL conditional logic by classifying rows into a small set of status labels using CASE, and sanity-checking the results with simple queries.

Accessible Focus Rings with `focus-visible`

intermediateMulti-PartTailwind CSS

Practice Tailwind CSS accessibility by applying a keyboard-only focus indicator using the `focus-visible` variant—without adding noisy focus styles for mouse users.

Daily Git: Quickly ignore a build artifact (without editing .gitignore)

intermediateMulti-PartGit

Practice Git file I/O hygiene by marking a tracked or untracked build artifact as locally ignored using Git’s index/info exclude mechanism.

Browse by technology