Lodash interview questions
Practice 7 questions on lodash. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
7 questions
- EASY
Array XOR (Symmetric Difference)
Implement lodash xor — return the values that appear in exactly one of the given arrays, with duplicates removed.
20 minJavaScript - EASY
Key By
Implement lodash keyBy — index a collection into an object keyed by an iteratee's return, keeping the last item for each key.
15 minJavaScript - EASY
Sum By / Mean By
Implement lodash sumBy and meanBy — total and average an array by an iteratee that maps each element to a number.
15 minJavaScript - MEDIUM
Case Converters
Convert any string between camelCase, snake_case, kebab-case, and PascalCase by tokenizing it into words first.
35 minJavaScript - MEDIUM
Object Path set / unset
Implement lodash-style set and unset: write or delete a value at a deep object path, creating containers as needed.
35 minJavaScript - MEDIUM
Pull / PullAll
Implement lodash pull and pullAll — remove every occurrence of the given values from an array in place, mutating the original.
30 minJavaScript - MEDIUM
Truncate String
Implement lodash truncate — cut a string to a maximum length, append an ellipsis, and optionally break on the last word boundary before the limit.
25 minJavaScript