Lodash from scratch.

"Write your own _.get" is a staple of frontend interviews because small utilities show how you handle edge cases. Each question here rebuilds a Lodash-style function in plain JavaScript and is checked by tests: paths with arrays, holes, cycles, Dates and Maps, prototype pollution, and the exact order things run.

5 of these questions have free answers; the rest are in Pro. Updated .

26

questions

Easy
14
Medium
12

What interviewers look for

  • You match the library's behaviour on edge cases: missing paths, array indexes in paths, holes, NaN and empty input.
  • You handle object graphs safely: cycles, shared references, Dates, Maps and Sets, and keys like __proto__.
  • You keep this, arguments and timing right in wrappers such as once, memoize, curry, debounce and throttle.
  • You can say when a built-in (structuredClone, Object.groupBy, Array.prototype.flat) already does the job.

Easy14

Medium12

Practise with tests and full answers.

Every question has a runnable editor, tests and a step-by-step solution. Passes from ₹149, paid once; nothing renews.

Get full access
Rehearse it in a timed JavaScript mock interviewA real editor with tests, the follow-ups an interviewer asks, and a score out of 100.

Frequently asked

Which Lodash functions are asked most in interviews?

get and set with a path, chunk, groupBy, cloneDeep, isEqual, merge, flatten, once, memoize, curry, debounce and throttle. classNames, deep omit and squashing a nested object into dot paths come up often too.

Should I use Lodash or write these myself at work?

At work, prefer built-ins (structuredClone, Object.groupBy, optional chaining) and import single Lodash functions only when you need their edge-case handling. In an interview, writing them shows you know what those edge cases are.

How is this different from writing polyfills?

A polyfill recreates a standard built-in, such as Array.prototype.map, exactly as the specification defines it. A Lodash function is a library utility with its own documented behaviour, so the task is matching that behaviour and explaining your choices.