Searching interview questions
Practice 11 questions on searching. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
11 questions
- EASY
Find Index
Implement a function that returns the index of the first array element matching a predicate, or -1 if none match.
15 minJavaScript - EASY
Find Last Index
Implement a function that returns the index of the last array element matching a predicate, or -1 if none match.
15 minJavaScript - EASY
Find Missing Number in Sequence
Implement a function that returns the single missing number from a sorted sequence of integers.
15 minAlgorithms - EASY
Pair Sum
Implement a function that finds two numbers in an array that add up to a given target.
15 minAlgorithms - MEDIUM
Binary Search
Implement binary search on a sorted array, returning the index of the target or -1 when absent.
25 minAlgorithms - MEDIUM
Find Element in Rotated Array
Implement a function that locates a target integer in a sorted array that has been rotated at an unknown pivot.
25 minAlgorithms - MEDIUM
Map With History
Implement a class that records timestamped writes and returns the most recent value at or before a queried timestamp.
25 minAlgorithms - MEDIUM
Smallest Element in Rotated Sorted Array
Implement a function that finds the minimum value in a sorted array that has been rotated at an unknown pivot.
25 minAlgorithms - MEDIUM
Text Search II
Implement a function that wraps every occurrence of any term from a list inside highlight markup.
25 minJavaScript - MEDIUM
Word Finder
Implement a data structure that supports adding words and searching with a wildcard character that matches any letter.
25 minAlgorithms - HARD
Data Selection
PREMIUMImplement a function that filters an array of row objects by a flexible field-and-condition specification.
40 minJavaScript