ReplayIt
VS Code extension · Free
Animate and record your code editing sessions in VS Code.
Learn something useful today. Read clear guides, test what you know, prepare for interviews, watch algorithms run, and use practical tools for the things you want to do.
Read a guide, test yourself, prepare for an interview, watch an algorithm run, or find a tool that makes your day a little easier.
Daily challenge
One programming question a day. It takes a minute, and every answer comes with an explanation.
The commands you keep looking up, gathered in one place and explained in plain words.
Browse all cheat sheetsThe questions interviewers really ask, with short, clear answers and code you can read in a minute.
See all questionsA closure is a function together with a reference to the variables of the scope it was created in. The function can still read and update those variables after the outer function has returned.
Closures are behind private state, function factories, memoization, and most callbacks.
function createCounter() {
let count = 0;
return () => ++count;
}
const next = createCounter();
next(); // 1
next(); // 2any, unknown, and never?TypeScriptMid-levelany turns type checking off for that value. unknown also accepts any value, but you must narrow it (with typeof, instanceof, and so on) before using it, so it is the safe choice for untrusted input.
never is the type of values that never occur, such as the return of a function that always throws. It is useful for exhaustive checks.
type Shape =
| { kind: "circle"; radius: number }
| { kind: "square"; size: number };
function area(shape: Shape): number {
switch (shape.kind) {
case "circle":
return Math.PI * shape.radius ** 2;
case "square":
return shape.size ** 2;
default: {
const unreachable: never = shape; // error if a case is missing
return unreachable;
}
}
}HashMap work internally?JavaMid-levelA HashMap stores entries in an array of buckets. It uses the key's hashCode() to pick a bucket and equals() to find the right key inside it. When several keys land in the same bucket, they are chained, and since Java 8 a crowded bucket turns into a balanced tree.
When the number of entries exceeds the capacity times the load factor (0.75 by default), the map doubles its capacity and redistributes the entries. Lookups and insertions are O(1) on average.
git merge joins two branches with a merge commit and keeps the history exactly as it happened. git rebase replays your commits on top of another branch, which gives a linear history but creates new commits with new hashes.
Golden rule: do not rebase commits that others have already pulled. Rebase your own local work, merge shared branches.
Interview prep, coding problems, cheat sheets, projects and quizzes, as PDF.
Watch sorting, data structures, graph searches and pathfinding run step by step, with the line of code each step runs and a sentence explaining why.
You don’t need a syllabus, a schedule, or a big block of free time. Just follow what interests you. The next useful thing is one click away.
Find your next useful thingFind a topic that makes you want to know more.
Read, play, and learn in the way that suits you.
Put a new idea or skill to work in your own way.
Our typing speed tool helps you build real touch-typing habits, a few minutes at a time. Keep your eyes on the screen and watch your speed climb.
Try the typing testMore free tools for developers
Record code demos that type themselves, see how your React components and Spring beans fit together, create many files at once, and write common code faster with snippets.
See all productsVS Code extension · Free
Animate and record your code editing sessions in VS Code.
VS Code extension · Free
See every React component in your project, organized by how they depend on each other.
VS Code extension · Free
Explore the Spring beans of your project: dependency levels, injection hierarchy, and REST endpoints.
VS Code extension · Free
Cut or copy your code, then watch it type itself back, character by character.
VS Code extension · Free
Clean, practical code snippets for React, JavaScript, TypeScript, CSS and Java.
VS Code extension · Free
Type a list of paths, one per line, and create all the files and folders in one step.
All free. If they help you, buy us a coffee (opens in a new tab).