Frontend interview questions, curated.
FAANG-level coding, output and system design questions. Each one is a real implementation, debugging or architecture task with tests: work through the levels in order, or jump straight to what your next interview needs.
1471 questions
ProFour questions in every track are free. Pro unlocks the rest.
- Tested solution, step by step
- Tests on every coding question
- Follow-up questions with answers
Passes from ₹149Paid once. Nothing renews.
Get full accessEasy
352 questions- 1Implement
Array.JavaScript fundamentalsImplement Array.prototype.myMap(callback, thisArg) so it behaves like the built-in map(). It calls callback(element, index, array) for every element and returns a new array of the… Asked often3 companies, names in Pro 15mprototype. map() - 2Implement
Array.JavaScript fundamentalsImplement Array.prototype.myFilter(callback, thisArg) so it behaves like the built-in filter(). It calls callback(element, index, array) for every element and returns a new array… Asked often2 companies, names in Pro 15mprototype. filter() - 3Implement
Array.JavaScript fundamentalsImplement Array.prototype.myReduce(callback, initialValue) so it behaves like the built-in reduce(). It calls callback(accumulator, element, index, array) for every element, from… Asked often3 companies, names in Pro 15mprototype. reduce() - 4Implement
Function.JavaScript fundamentalsImplement Function.prototype.myCall(thisArg, ...args) without using the built-in call, apply or bind. It calls the function with this set to thisArg and the given arguments, and…1 company, names in Pro 15mprototype. call() - 5Implement
Function.JavaScript fundamentalsImplement Function.prototype.myApply(thisArg, argsArray) without using the built-in call, apply or bind. It calls the function with this set to thisArg and the arguments taken from…1 company, names in Pro 15mprototype. apply() - 6Implement
Function., including partial argumentsJavaScript fundamentalsImplement Function.prototype.myBind(thisArg, ...boundArgs) without using the built-in bind. It returns a new function that, when called, runs the original with this set to thisArg… Asked often6 companies, names in ProFree 15mprototype. bind() - 7Implement a
once()function using closuresJavaScript fundamentalsImplement once(fn). It returns a new function that calls fn the first time it is called and returns its result. Every later call returns that same first result without calling fn… 15m - 8Implement a function to flatten a nested arrayJavaScript fundamentalsImplement flatten(array, depth = Infinity). It returns a new array with nested arrays flattened into it, up to depth levels, like Array.prototype.flat(). Do not use flat() itself. Asked often8 companies, names in ProFree 15m
- 9Implement
groupBy()for an array of objectsJavaScript fundamentalsImplement groupBy(items, iteratee). It returns an object whose keys are group names and whose values are arrays of the items in that group, in their original order.1 company, names in Pro 15m - 10Implement
get(object, "a.with a default valueJavaScript fundamentalsImplement get(object, path, defaultValue), like Lodash's _.get. It reads a nested value by path and returns defaultValue when the value is missing.1 company, names in Pro 15mb. c") - 151Predict the event-loop order of
setTimeout, promises,queueMicrotaskandawaitJavaScript fundamentalsInterviewers love this one: read each snippet and write down the exact order of the logs, without running it. Fill in answers.a, answers.b and answers.c with the logged strings, in… Asked often3 companies, names in ProFree 15m - 152Predict what
thisrefers to in methods, detached calls, arrows,bindandnewJavaScript fundamentalsThe snippet below runs in strict mode (as all modules and classes do). name(value) turns whatever this is into a readable label: "undefined", the object's label, or a class's name.1 company, names in Pro 15m - 153Predict the results of type coercion and equality puzzlesJavaScript fundamentalsPredict the value of each expression without running it, and fill in answers with real JavaScript values (numbers as numbers, strings as strings, booleans as booleans, arrays as… 15m
- 154Fix the
varloop closure bug three waysJavaScript fundamentalsThis function should log 0, 1, 2, …, n - 1, but it doesn't:1 company, names in Pro 15m - 155Implement
instanceof,Object.andcreate newby walking the prototype chainJavaScript fundamentalsRebuild three pieces of JavaScript's object model without using the originals (instanceof, Object.create, new, Reflect.construct): 20m - 178Predict hoisting and TDZ results for functions,
var,let,constandclassJavaScript fundamentalsRead each snippet and write down exactly what it logs, without running it. When a line throws, the snippet logs the error's name instead (for example "ReferenceError"). Fill in… Asked often4 companies, names in ProFree 15m - 238Implement
clearAllTimeouts()by tracking pending timersJavaScript fundamentalsBrowsers have no built-in way to cancel every pending timeout. Make one: after your code loads, any timeout created with setTimeout can be cancelled by clearAllTimeouts(). Asked often2 companies, names in Pro 20m - 256Format relative times like "3 minutes ago" with
Intl.JavaScript fundamentalsFeeds, comments and notifications show times like "3 minutes ago", "yesterday" or "in 2 hours". Implement formatRelativeTime(date, now = Date.now(), locale = "en").1 company, names in Pro 20mRelativeTimeFormat - 257Implement a stable
orderBy()that sorts by several keys and directionsJavaScript fundamentalsTables sort by more than one column: "status, then newest first, then name". Implement orderBy(items, keys, orders = []), like Lodash's.1 company, names in Pro 20m - 274Format a list of names like "Asha, Ravi and 3 others"JavaScript fundamentalsLikes, reactions and shared-with lists show "Asha, Ravi, and 3 others". Implement formatList(items, options). 20m