Interview questions
Find a company or topic. Read the sources, then practice.
Loading the question library…
Find a company or topic. Read the sources, then practice.
Loading the question library…
Showing 1,726–1,750
Given a strictly increasing sorted array, construct a height-balanced binary search tree whose in-order traversal yields the original array. The core challenge is arranging…
General practice
Given a non-negative float Celsius value, compute and return its Kelvin and Fahrenheit equivalents using the formulas Kelvin = Celsius + 273.15 and Fahrenheit =…
General practice
Convert a nonnegative integer n (0 ≤ n ≤ 10^9) into its base -2 (negabinary) representation as a binary string with no leading zeros (except…
General practice
Given the ordered vertices of a simple polygon, determine whether every interior angle is <= 180° (i.e., the polygon is convex) by checking that the…
General practice
Given towers with integer positions and quality factors, find the non-negative integer coordinate that maximizes the total network quality, where each tower within Euclidean…
General practice
A binary tree has exactly one child pointer that incorrectly points to another existing node, creating a node with two parents (or a cycle); locate…
General practice
Count the number of routes from start to finish where you can move between any two cities (revisits allowed) and each move costs the absolute…
General practice
Count the number of permutations of 2n events (n pickups and n deliveries) such that for each order i the delivery appears after its pickup…
General practice
Count the number of index pairs (i<j) such that one number can be transformed into the other by performing at most one swap of two…
General practice
Count pairs (i<j) of integers that can be made equal using at most two swaps of digits (each swap picks one number and swaps two…
General practice
Count the number of contiguous subarrays in a binary array where no two adjacent elements are equal (i.e., the subarray alternates). With n up to…
General practice
Compute how many distinct strings you can get by independently permuting the letters of each word (words' order fixed); this equals the product over words…
General practice
Given the house interval and positions of two trees plus arrays of fruit fall distances, translate each fruit's distance into an absolute landing position (distances…
General practice
Count the number of index pairs (i<j) whose product nums[i]*nums[j] is divisible by k. With n up to 1e5, this requires better than O(n^2); a…
General practice
Count how many non-overlapping rectangular artifacts on an n×n grid are fully uncovered by a given list of dug cells — an artifact is extractable…
General practice
Given an array representing a Spotify ranking list of artist names and a target artist (or multiple query artists), return how many times the artist…
General practice
Count the number of '*' characters in a string excluding those that lie between paired '|' delimiters (every two '|' form a pair). Toggle an…
General practice
Count the integers in [l, r] whose digits' product is divisible by their digits' sum — a combinatorial digit-DP problem where you enumerate/track digit sums…
General practice
Count the number of ways to split an array into three contiguous parts nums1, nums2, nums3 such that either nums1 is a prefix of nums2…
General practice
Count the number of contiguous substrings of s where the number of vowels equals the number of consonants and the product of those counts is…
General practice
Count the non-empty substrings where vowels == consonants and their product is divisible by k; since equality implies length 2t with t vowels, the problem…
General practice
Count how many integers k in [0, n] have palindromic binary representations. The key challenge is to efficiently enumerate binary palindromes up to n by…
General practice
Count the non-empty substrings of a binary string that contain an equal number of 0s and 1s with all 0s and all 1s each grouped…
Companies: D. E. Shaw
String · Two Pointers