<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Afterdiff: new answers and Shorts</title>
  <link href="https://afterdiff.com/"/>
  <link rel="self" href="https://afterdiff.com/feed.xml"/>
  <id>https://afterdiff.com/</id>
  <updated>2026-11-29T00:00:00Z</updated>
  <author><name>Vikram Rana</name></author>
  <entry>
    <title>&quot;Can you win&quot;</title>
    <link href="https://afterdiff.com/questions/js-coding/can-you-win-variant-of-leetcode-jump-game-i-ii-medium-level-dsa"/>
    <id>https://afterdiff.com/questions/js-coding/can-you-win-variant-of-leetcode-jump-game-i-ii-medium-level-dsa</id>
    <updated>2026-11-29T00:00:00Z</updated>
    <summary>Each number is the longest jump allowed from that position, and you win if you can get from the first position to the last. Walk left to right keeping…</summary>
  </entry>
  <entry>
    <title>Given a text and a query of two words plus an integer k…</title>
    <link href="https://afterdiff.com/questions/js-coding/given-a-text-and-a-query-of-two-words-plus-an-integer-k-return"/>
    <id>https://afterdiff.com/questions/js-coding/given-a-text-and-a-query-of-two-words-plus-an-integer-k-return</id>
    <updated>2026-11-29T00:00:00Z</updated>
    <summary>First say how you read it, because the question leaves three things open: what a word is, what &quot;distance&quot; counts, and what &quot;indices&quot; means. A sound…</summary>
  </entry>
  <entry>
    <title>LeetCode-style: calculate the distance a robot has moved…</title>
    <link href="https://afterdiff.com/questions/js-coding/leetcode-style-calculate-the-distance-a-robot-has-moved-given-a"/>
    <id>https://afterdiff.com/questions/js-coding/leetcode-style-calculate-the-distance-a-robot-has-moved-given-a</id>
    <updated>2026-11-29T00:00:00Z</updated>
    <summary>Keep the robot&apos;s position (x, y) and the direction it faces as a step (dx, dy), starting at the origin facing north (0, 1). A move adds the direction to…</summary>
  </entry>
  <entry>
    <title>LeetCode-style: &quot;high five problem&quot; variant (sort +…</title>
    <link href="https://afterdiff.com/questions/js-coding/leetcode-style-high-five-problem-variant-sort-average-scores"/>
    <id>https://afterdiff.com/questions/js-coding/leetcode-style-high-five-problem-variant-sort-average-scores</id>
    <updated>2026-11-29T00:00:00Z</updated>
    <summary>Group the scores by student in a Map, sort each student&apos;s scores from high to low, average the first five, and sort the result by student id. Two details…</summary>
  </entry>
  <entry>
    <title>Rabin-Karp string-matching DSA problem (recurring at…</title>
    <link href="https://afterdiff.com/questions/js-coding/rabin-karp-string-matching-dsa-problem-recurring-at-microsoft"/>
    <id>https://afterdiff.com/questions/js-coding/rabin-karp-string-matching-dsa-problem-recurring-at-microsoft</id>
    <updated>2026-11-29T00:00:00Z</updated>
    <summary>Rabin-Karp finds a pattern of length m in a text of length n by comparing hashes instead of strings. Hash the pattern once. Hash the first window of m…</summary>
  </entry>
  <entry>
    <title>The call stack in one minute (Short)</title>
    <link href="https://afterdiff.com/shorts/js-runtime/call-stack"/>
    <id>https://afterdiff.com/shorts/js-runtime/call-stack</id>
    <updated>2026-11-29T00:00:00Z</updated>
    <summary>One customer&apos;s page went blank. The agent&apos;s fix froze it. Both come down to the call stack. A one-minute video from the lesson “The call stack”; the…</summary>
  </entry>
  <entry>
    <title>Build a utility in JS that sends data in batches with a…</title>
    <link href="https://afterdiff.com/questions/js-coding/build-a-utility-in-js-that-sends-data-in-batches-with-a-timeout"/>
    <id>https://afterdiff.com/questions/js-coding/build-a-utility-in-js-that-sends-data-in-batches-with-a-timeout</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Keep the current batch and one timer. push adds the item, and then either the batch is full, so flush now, or it makes sure a timer is running that will…</summary>
  </entry>
  <entry>
    <title>Convert all keys within an object into snake_case/camelCase</title>
    <link href="https://afterdiff.com/questions/js-coding/convert-all-keys-within-an-object-into-snakecase-camelcase"/>
    <id>https://afterdiff.com/questions/js-coding/convert-all-keys-within-an-object-into-snakecase-camelcase</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Convert the key strings with a regex (_x → X for camel, X → _x for snake), then rebuild the object with the new keys. Interviewers then ask for it deep…</summary>
  </entry>
  <entry>
    <title>Dedupe a list of fetched items by ID using a Set of seen IDs</title>
    <link href="https://afterdiff.com/questions/js-coding/dedupe-a-list-of-fetched-items-by-id-using-a-set-of-seen-ids"/>
    <id>https://afterdiff.com/questions/js-coding/dedupe-a-list-of-fetched-items-by-id-using-a-set-of-seen-ids</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>One pass with a Set of ids already seen: skip an item whose id is in the set, otherwise add the id and keep the item. That&apos;s O(n) time, keeps the first…</summary>
  </entry>
  <entry>
    <title>Deduplicate a list of messages without using an object or…</title>
    <link href="https://afterdiff.com/questions/js-coding/deduplicate-a-list-of-messages-without-using-an-object-or-a-set"/>
    <id>https://afterdiff.com/questions/js-coding/deduplicate-a-list-of-messages-without-using-an-object-or-a-set</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>The constraint takes away hash lookups, so first clarify what&apos;s allowed (arrays are fine; is a Map banned too?). The direct answer is messages.filter((m…</summary>
  </entry>
  <entry>
    <title>DFS on HTML nodes</title>
    <link href="https://afterdiff.com/questions/js-coding/dfs-on-html-nodes"/>
    <id>https://afterdiff.com/questions/js-coding/dfs-on-html-nodes</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Depth-first search visits a node, then the whole subtree of its first child, then the next child, and so on. For the DOM, pre-order DFS is tree order…</summary>
  </entry>
  <entry>
    <title>DOM APIs: document.getElementByClassName()…</title>
    <link href="https://afterdiff.com/questions/js-coding/dom-apis-document-getelementbyclassname-document"/>
    <id>https://afterdiff.com/questions/js-coding/dom-apis-document-getelementbyclassname-document</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Walk the element tree depth first from the root&apos;s children (not including the root), and collect the elements that match: for getElementsByClassName…</summary>
  </entry>
  <entry>
    <title>Evaluate a basic arithmetic expression string like &quot;1+3-2&quot;…</title>
    <link href="https://afterdiff.com/questions/js-coding/evaluate-a-basic-arithmetic-expression-string-like-1-3-2-and"/>
    <id>https://afterdiff.com/questions/js-coding/evaluate-a-basic-arithmetic-expression-string-like-1-3-2-and</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Scan the string once, left to right, keeping three things: the running total, the sign of the number being read, and the number itself, built digit by…</summary>
  </entry>
  <entry>
    <title>Extend an async batcher with retry behavior and operations…</title>
    <link href="https://afterdiff.com/questions/js-coding/extend-an-async-batcher-with-retry-behavior-and-operations-such"/>
    <id>https://afterdiff.com/questions/js-coding/extend-an-async-batcher-with-retry-behavior-and-operations-such</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Start from the plain batcher: push adds an item and flushes when the batch is full, or starts a timer that flushes after wait ms. Make send async and…</summary>
  </entry>
  <entry>
    <title>Find common elements between two arrays</title>
    <link href="https://afterdiff.com/questions/js-coding/find-common-elements-between-two-arrays-e-g-arr1-1-2-2-4-5-arr2"/>
    <id>https://afterdiff.com/questions/js-coding/find-common-elements-between-two-arrays-e-g-arr1-1-2-2-4-5-arr2</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>The example shows this is an intersection with duplicates: 2 appears twice in both arrays, so it appears twice in the answer. A Set can&apos;t do that; you…</summary>
  </entry>
  <entry>
    <title>Find the identical DOM node in two identical trees: given…</title>
    <link href="https://afterdiff.com/questions/js-coding/find-the-identical-dom-node-in-two-identical-trees-given-a-node"/>
    <id>https://afterdiff.com/questions/js-coding/find-the-identical-dom-node-in-two-identical-trees-given-a-node</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Two trees with the same shape have the same paths: the target is &quot;child 1 of child 0 of the root&quot; in both. So start at the target and walk up with…</summary>
  </entry>
  <entry>
    <title>Find the leaders in an array (every element greater than…</title>
    <link href="https://afterdiff.com/questions/js-coding/find-the-leaders-in-an-array-every-element-greater-than-all"/>
    <id>https://afterdiff.com/questions/js-coding/find-the-leaders-in-an-array-every-element-greater-than-all</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>The brute force checks every element against all elements to its right, O(n²). The answer they want is one pass from the right, carrying the largest…</summary>
  </entry>
  <entry>
    <title>Fix a buggy fetch helper: the provided function may look…</title>
    <link href="https://afterdiff.com/questions/js-coding/fix-a-buggy-fetch-helper-the-provided-function-may-look-right"/>
    <id>https://afterdiff.com/questions/js-coding/fix-a-buggy-fetch-helper-the-provided-function-may-look-right</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>The function calls fetch(...) but never returns the promise, so callers get undefined: await getUser() resolves to nothing, and errors are unhandled…</summary>
  </entry>
  <entry>
    <title>Flatten a nested array</title>
    <link href="https://afterdiff.com/questions/js-coding/flatten-a-nested-array"/>
    <id>https://afterdiff.com/questions/js-coding/flatten-a-nested-array</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Recursively: walk the array, and replace each element that is itself an array with its flattened contents. The usual follow-up is without recursion: use…</summary>
  </entry>
  <entry>
    <title>Generate table of contents/outline from a HTML page…</title>
    <link href="https://afterdiff.com/questions/js-coding/generate-table-of-contents-outline-from-a-html-page-similar-to"/>
    <id>https://afterdiff.com/questions/js-coding/generate-table-of-contents-outline-from-a-html-page-similar-to</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Walk the DOM in document order and collect the headings (H1–H6) with their level and textContent. Then nest them with a stack: pop while the top of the…</summary>
  </entry>
  <entry>
    <title>Given a stream of comments, detect inappropriate language…</title>
    <link href="https://afterdiff.com/questions/js-coding/given-a-stream-of-comments-detect-inappropriate-language"/>
    <id>https://afterdiff.com/questions/js-coding/given-a-stream-of-comments-detect-inappropriate-language</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Build a trie from the banned list: each node has a map from a character to a child, and a flag for &quot;an entry ends here&quot;. Inserting a word walks or…</summary>
  </entry>
  <entry>
    <title>Given an API getAllLinks(url) that returns all the links…</title>
    <link href="https://afterdiff.com/questions/js-coding/given-an-api-getalllinks-url-that-returns-all-the-links-on-a"/>
    <id>https://afterdiff.com/questions/js-coding/given-an-api-getalllinks-url-that-returns-all-the-links-on-a</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Pages and links form a graph, not a tree, so this is a graph traversal with a visited set. Start from the URL, keep a Set of URLs already seen, and for…</summary>
  </entry>
  <entry>
    <title>Given an array of integers like [1,2,0,4,3] and a starting…</title>
    <link href="https://afterdiff.com/questions/js-coding/given-an-array-of-integers-like-1-2-0-4-3-and-a-starting-index"/>
    <id>https://afterdiff.com/questions/js-coding/given-an-array-of-integers-like-1-2-0-4-3-and-a-starting-index</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Treat each index as a node of a graph with up to two edges: jump arr[i] steps right, or arr[i] steps left, wrapping around the ends. The question is then…</summary>
  </entry>
  <entry>
    <title>How can you execute an array of promises in sequence?</title>
    <link href="https://afterdiff.com/questions/js-coding/how-can-you-execute-an-array-of-promises-in-sequence"/>
    <id>https://afterdiff.com/questions/js-coding/how-can-you-execute-an-array-of-promises-in-sequence</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>First, a correction interviewers want to hear: you can&apos;t run promises in sequence, because a promise is work that has already started. You run functions…</summary>
  </entry>
  <entry>
    <title>How do you make a function that takes a callback function…</title>
    <link href="https://afterdiff.com/questions/js-coding/how-do-you-make-a-function-that-takes-a-callback-function-fn"/>
    <id>https://afterdiff.com/questions/js-coding/how-do-you-make-a-function-that-takes-a-callback-function-fn</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>It&apos;s a higher-order function and a closure: delayed(fn, ms) returns a new function, and that function remembers fn and ms. When the new function is…</summary>
  </entry>
  <entry>
    <title>Implement a Backbone-style StoreData class with key/value…</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-a-backbone-style-storedata-class-with-key-value-pairs"/>
    <id>https://afterdiff.com/questions/js-coding/implement-a-backbone-style-storedata-class-with-key-value-pairs</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Keep two separate maps: one for the data and one for the listeners, keyed by event name (change:name for one key, change for all). set(key, value)…</summary>
  </entry>
  <entry>
    <title>Implement a compose middleware function so that async…</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-a-compose-middleware-function-so-that-async"/>
    <id>https://afterdiff.com/questions/js-coding/implement-a-compose-middleware-function-so-that-async</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Koa middleware is an onion: each middleware receives the context and a next function; code before await next() runs on the way in, code after it runs on…</summary>
  </entry>
  <entry>
    <title>Implement a custom React hook that uses setInterval…</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-a-custom-react-hook-that-uses-setinterval-common"/>
    <id>https://afterdiff.com/questions/js-coding/implement-a-custom-react-hook-that-uses-setinterval-common</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Start the interval in useEffect and return a cleanup that clears it. Without one, every remount adds another interval, and in development &lt;StrictMode&gt;…</summary>
  </entry>
  <entry>
    <title>Implement a Decryption class</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-a-decryption-class-focuses-on-managing-async"/>
    <id>https://afterdiff.com/questions/js-coding/implement-a-decryption-class-focuses-on-managing-async</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>The question gives few details, so state your reading first: decryptEncrypt(key, payload, callback) is asynchronous and calls back with the decrypted…</summary>
  </entry>
  <entry>
    <title>Implement a function which extends Array.prototype</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-a-function-which-extends-array-prototype"/>
    <id>https://afterdiff.com/questions/js-coding/implement-a-function-which-extends-array-prototype</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Assigning a function to Array.prototype.name gives every array that method, because arrays look methods up on their prototype, and inside it this is the…</summary>
  </entry>
  <entry>
    <title>Implement a hand-rolled throttle; one screen prohibited…</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-a-hand-rolled-throttle-one-screen-prohibited-library"/>
    <id>https://afterdiff.com/questions/js-coding/implement-a-hand-rolled-throttle-one-screen-prohibited-library</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Remember when the function last ran. A call runs if wait ms have passed and is otherwise dropped, and use fn.apply(this, args) so methods keep their…</summary>
  </entry>
  <entry>
    <title>Implement a number/character pad like old flip phones</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-a-number-character-pad-like-old-flip-phones-buttons"/>
    <id>https://afterdiff.com/questions/js-coding/implement-a-number-character-pad-like-old-flip-phones-buttons</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Keep three pieces of state: the text so far, which key was pressed last, and when. On a press, look up the key&apos;s letters. If it&apos;s the same key as last…</summary>
  </entry>
  <entry>
    <title>Implement a polyfill of Array.prototype.reduce</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-a-polyfill-of-array-prototype-reduce"/>
    <id>https://afterdiff.com/questions/js-coding/implement-a-polyfill-of-array-prototype-reduce</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Loop over the array carrying an accumulator: start from the initial value, or from the first element when none is given, and replace the accumulator with…</summary>
  </entry>
  <entry>
    <title>Implement a polyfill of Function.prototype.bind</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-a-polyfill-of-function-prototype-bind-handle-the-new"/>
    <id>https://afterdiff.com/questions/js-coding/implement-a-polyfill-of-function-prototype-bind-handle-the-new</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>bind returns a new function that calls the original with a fixed this and the bound arguments placed before the call&apos;s own arguments. The part the…</summary>
  </entry>
  <entry>
    <title>Implement a rate limiter attribute/decoration/annotation…</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-a-rate-limiter-attribute-decoration-annotation-on-top"/>
    <id>https://afterdiff.com/questions/js-coding/implement-a-rate-limiter-attribute-decoration-annotation-on-top</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>A rolling window means: at any moment, count the requests in the last 60 seconds, not in the current clock minute. The direct way is a log: keep the time…</summary>
  </entry>
  <entry>
    <title>Implement an async process queue with concurrency control…</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-an-async-process-queue-with-concurrency-control"/>
    <id>https://afterdiff.com/questions/js-coding/implement-an-async-process-queue-with-concurrency-control</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Keep two things: a list of waiting tasks and a count of running ones. add(task) puts the task in the list and calls next(), which starts tasks while…</summary>
  </entry>
  <entry>
    <title>Implement an event emitter progressively in 3 stages of…</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-an-event-emitter-progressively-in-3-stages-of"/>
    <id>https://afterdiff.com/questions/js-coding/implement-an-event-emitter-progressively-in-3-stages-of</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>The three stages map onto the steps below. Stage 1: on, off and emit over a Map of listener lists, with emit returning whether anyone listened. Stage 2…</summary>
  </entry>
  <entry>
    <title>Implement Array.prototype functions: map, reduce, filter…</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-array-prototype-functions-map-reduce-filter-sort"/>
    <id>https://afterdiff.com/questions/js-coding/implement-array-prototype-functions-map-reduce-filter-sort</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Each method walks the array by index and calls your callback with (element, index, array). map collects every return value into a new array of the same…</summary>
  </entry>
  <entry>
    <title>Implement Array.prototype methods (flat, map, reduce…</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-array-prototype-methods-flat-map-reduce-concat-by"/>
    <id>https://afterdiff.com/questions/js-coding/implement-array-prototype-methods-flat-map-reduce-concat-by</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>map and reduce are loops covered in their own answers (map keeps holes; reduce throws on an empty array without an initial value). flat(depth = 1) walks…</summary>
  </entry>
  <entry>
    <title>Implement classnames</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-classnames-combine-class-names-from-strings-arrays"/>
    <id>https://afterdiff.com/questions/js-coding/implement-classnames-combine-class-names-from-strings-arrays</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Loop over the arguments. Skip anything falsy, add strings and numbers, flatten arrays recursively, and for objects add each key whose value is truthy…</summary>
  </entry>
  <entry>
    <title>Implement concurrency-limited async mapping. One earlier…</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-concurrency-limited-async-mapping-one-earlier"/>
    <id>https://afterdiff.com/questions/js-coding/implement-concurrency-limited-async-mapping-one-earlier</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>First ask which scheduling they want, because two things get called this. A sliding window keeps limit calls running: the moment one finishes, the next…</summary>
  </entry>
  <entry>
    <title>Implement Event Emitter</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-event-emitter"/>
    <id>https://afterdiff.com/questions/js-coding/implement-event-emitter</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Keep a Map from event name to a list of listeners. on adds one, off removes one, and emit calls each listener with the arguments and returns whether…</summary>
  </entry>
  <entry>
    <title>Implement Function.prototype.bind</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-function-prototype-bind"/>
    <id>https://afterdiff.com/questions/js-coding/implement-function-prototype-bind</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Expect the interviewer to ask about new even though the question doesn&apos;t mention it. bind returns a new function that calls the original with a fixed…</summary>
  </entry>
  <entry>
    <title>Implement getByClassName() and getByClassnameHierarchy()</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-getbyclassname-and-getbyclassnamehierarchy"/>
    <id>https://afterdiff.com/questions/js-coding/implement-getbyclassname-and-getbyclassnamehierarchy</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>getByClassName(root, name) is a depth-first walk of root&apos;s descendants, collecting those whose classList contains the name, in document order…</summary>
  </entry>
  <entry>
    <title>Implement JSON.stringify()</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-json-stringify"/>
    <id>https://afterdiff.com/questions/js-coding/implement-json-stringify</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Recurse on the value&apos;s type: null, booleans and finite numbers print as themselves, NaN and Infinity print null, strings are quoted with escapes, arrays…</summary>
  </entry>
  <entry>
    <title>Implement Lodash functions: debounce(), throttle()…</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-lodash-functions-debounce-throttle-clonedeep-groupby"/>
    <id>https://afterdiff.com/questions/js-coding/implement-lodash-functions-debounce-throttle-clonedeep-groupby</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Debounce waits until calls stop for wait ms and then runs once with the last arguments: every call clears the timer and starts a new one. Throttle runs…</summary>
  </entry>
  <entry>
    <title>Implement memoization, then extend the behavior as…</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-memoization-then-extend-the-behavior-as-requirements"/>
    <id>https://afterdiff.com/questions/js-coding/implement-memoization-then-extend-the-behavior-as-requirements</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Start with one argument: a Map from argument to result, returning the cached value on a hit. Then follow the requirements as they change. Several…</summary>
  </entry>
  <entry>
    <title>Implement Promise.all</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-promise-all"/>
    <id>https://afterdiff.com/questions/js-coding/implement-promise-all</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Return a new promise. Wrap every item in Promise.resolve, write each result at its index so the output order matches the input, count fulfilments, and…</summary>
  </entry>
  <entry>
    <title>Implement Promise/Promise-related APIs: Promise…</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-promise-promise-related-apis-promise-promise-all"/>
    <id>https://afterdiff.com/questions/js-coding/implement-promise-promise-related-apis-promise-promise-all</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Promise.all starts nothing itself: every item is already running. It wraps each with Promise.resolve, writes each result by index so the output keeps the…</summary>
  </entry>
  <entry>
    <title>Implement Squash Object</title>
    <link href="https://afterdiff.com/questions/js-coding/implement-squash-object-flatten-a-nested-object-into-a-single"/>
    <id>https://afterdiff.com/questions/js-coding/implement-squash-object-flatten-a-nested-object-into-a-single</id>
    <updated>2026-11-28T00:00:00Z</updated>
    <summary>Recurse with a path prefix. For each entry, if the value is an object, recurse with prefix.key; otherwise write the value under the joined path. Then…</summary>
  </entry>
</feed>
