Coding drills

Coding rounds

What senior frontend coding interviews actually ask — utility functions, async orchestration, Vue component and composable drills, Nuxt fullstack drills, algorithms at frontend depth, take-home assignments and pairing sessions — with a method for each format and the habits that get scored.

Senior frontend coding rounds rarely ask for red-black trees. They ask you to write a debounce that handles the edge cases, orchestrate async work with a concurrency limit, build an accessible autocomplete in Vue in forty minutes, add a validated API route with a page that consumes it, or pair on a refactor while explaining your reasoning. The material is the everyday craft; the difference at senior level is that your code is correct on the edges, typed, tested in your head, and narrated.

Know

  • Formats: utility-function problems (JavaScript fundamentals), async orchestration, Vue component or composable builds (live, in a sandbox or repo), Nuxt fullstack drills (route plus page plus state), algorithm questions at frontend depth (arrays, maps, trees, strings, DOM traversal), take-home assignments (a small app in a few hours), and pairing or code-review sessions (refactor, find the bug, add a feature to an existing codebase).
  • The method for live coding: restate the problem and the edge cases, agree on the interface (signature, types, behaviour on empty input and errors), write the simplest correct version, walk through it with an example, then improve (complexity, cancellation, accessibility), and finish by naming what you would test. Narrate throughout; silence reads as being stuck.
  • What is scored: correctness on edges (empty, one element, duplicates, unicode, null), clarity (naming, small functions, types), communication, handling of feedback, and knowledge of the platform (built-ins you reach for: structuredClone, Map, AbortController, Intl, Object.groupBy, Array.fromAsync, Promise.withResolvers).
  • Vue-specific expectations: <script setup lang="ts"> with typed props and emits, defineModel, composables for logic, no reactivity leaks (toRef/toValue for arguments, cleanup in onScopeDispose), accessibility by default (labels, roles, keyboard), and awareness of SSR when the sandbox is Nuxt.
  • Nuxt-specific expectations: useFetch/useAsyncData with keys, server/api with validation and createError({ status }), useState instead of module state, middleware for redirects, routeRules for caching, and nuxt-auth-utils for sessions.
  • Take-home expectations: a README that explains decisions and trade-offs, tests where they matter, commits that tell a story, no over-engineering, and a "what I would do with more time" section.

How the pages fit

PageDrill
JavaScript utilitiesdebounce, throttle, memoize, deep equal, deep merge, groupBy, chunk, once, event emitter, LRU cache, pick/omit, retry
Async and data processingconcurrency pool, promiseAll by hand, timeout, retry with backoff, cancellation, in-flight dedupe, async iteration, tree ↔ flat list, normalisation
Vue component drillstodo with filters, autocomplete, modal with focus trap, tabs, data table, infinite list, form with validation, useDebounce, useLocalStorage, useIntersectionObserver
Nuxt drillsvalidated API route plus page, auth middleware and session, error page, SEO route, cached route rules, plugin, shared state, mini layer
Algorithms at frontend depthcomplexity, hashing, two pointers, sliding window, stacks and queues, trees and DOM traversal, recursion, binary search, tries, light dynamic programming
Take-home and pairingscoping, README, tests, commits, code review drills, refactoring, pairing etiquette, the evaluator's rubric

How it works

The five-step live-coding script, with a worked debounce:

1. Restate  "debounce(fn, wait) returns a function that delays fn until wait ms have passed without a call;
             each call resets the timer; the last arguments win; `this` is preserved; and it exposes cancel/flush."
2. Interface  function debounce<T extends (...args: any[]) => void>(fn: T, wait: number): T & { cancel(): void; flush(): void }
3. Simplest correct  timer + clearTimeout + setTimeout(fn.apply(this, args))
4. Walk through  calls at t=0, 50, 120 with wait=100 → fn runs once at t=220 with the t=120 args
5. Improve + tests  cancel, flush, leading option; tests with fake timers: resets, last-args, cancel, flush, `this`
export function debounce<T extends (...args: any[]) => void>(fn: T, wait: number) {
  let timer: ReturnType<typeof setTimeout> | undefined
  let pending: { args: Parameters<T>, self: unknown } | undefined

  const debounced = function (this: unknown, ...args: Parameters<T>) {
    pending = { args, self: this }
    clearTimeout(timer)
    timer = setTimeout(debounced.flush, wait)
  } as T & { cancel: () => void, flush: () => void }

  debounced.cancel = () => { clearTimeout(timer); timer = undefined; pending = undefined }
  debounced.flush = () => {
    if (!pending) return
    const { args, self } = pending
    debounced.cancel()
    fn.apply(self, args)
  }
  return debounced
}
Gotcha· Optimising before it is correct

Reaching for a clever one-liner or an O(n) approach before the straightforward version works is how candidates run out of time with nothing to show. Correct first, then better, and say that this is your plan.

Exercise

Exercise
  • Do one drill from each page under a timer this week; record which step of the five you skip under pressure.
  • For every drill, write the three edge cases you would test before writing the code.

Be able to say

Be able to say· How do you approach a live coding problem?

"I restate the problem and list the edge cases, agree on the interface with types and what happens on empty input and errors, then write the simplest version that is correct and walk through it with a concrete example. Only then do I improve it: complexity, cancellation, accessibility, or whatever the problem rewards. I narrate the whole time so the interviewer can steer, and I finish by naming the tests I would write. At a senior level the code has to be right on the edges and readable; the clever version can come after."

Pages in this section

  1. 01JavaScript utilitiesThe utility-function drills that recur in senior frontend interviews — debounce and throttle, memoize, once, deep equal, deep clone and deep merge, groupBy and chunk, pick and omit, an event emitter, an LRU cache, retry — each with the edge cases that separate a working answer from a senior one, typed implementations and the built-ins that replace hand-written code in 2026.
  2. 02Async and data processing[object Object]
  3. 03Vue component drillsThe component and composable builds that senior Vue interviews ask for in 30–45 minutes — a todo list with filters, an accessible autocomplete, a dialog with focus trapping, tabs, a sortable paginated table, an infinite list, a validated form — and the composables behind them (useDebounce, useLocalStorage, useIntersectionObserver, useEventListener), with the details reviewers look for.
  4. 04Nuxt drillsFullstack Nuxt exercises in the shape interviewers use — a validated API route plus a page that consumes it, a protected area with session middleware, an error page, a dynamic SEO route, cached list endpoints with route rules, a plugin that provides a helper, shared state across components, and a mini layer — each with the specification to state, the solution core, and what is checked.
  5. 05Algorithms at frontend depthThe algorithmic knowledge a senior frontend interview actually tests — complexity reasoning, hash maps and sets, two pointers and sliding windows, stacks and queues, trees and DOM traversal, recursion versus iteration, binary search, tries for autocomplete, light dynamic programming for fuzzy matching — with JavaScript implementations, the frontend situations each one shows up in, and how to talk about them.
  6. 06Take-home and pairingHow to score well on take-home assignments and pairing sessions — scoping and time-boxing, the README that explains decisions, tests that matter, commits that tell a story, avoiding over-engineering, the reviewer's rubric, code-review drills for spotting bugs in Vue and Nuxt snippets, refactoring under observation, and pairing etiquette.

Your notes

Open in Notes

Nothing yet. Notes filed here show up on every page of this section.