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,601–1,625
Check whether an n x n matrix is an X-Matrix by verifying that every element on the main and anti-diagonals is non-zero while all other…
General practice
Determine whether placing your color at a specified free cell on an 8x8 board produces any "good line" by scanning all 8 directions for the…
General practice
Determine whether the array contains two distinct indices i and j such that one element is exactly double the other (arr[i] == 2 * arr[j])…
General practice
Given a numeric string num, check whether for every index i the number of occurrences of digit i in the string equals the integer value…
General practice
Determine whether a positive integer n can be expressed as a sum of distinct powers of three — equivalently, check that n’s base‑3 representation contains…
General practice
Extract the numeric tokens from the space-separated sentence and check whether their numeric values form a strictly increasing sequence from left to right; return true…
General practice
Determine whether a given value should be considered an instance of a given class or its superclass by checking if the class's prototype is accessible…
General practice
Determine whether two equal-length strings can be made identical by performing at most one swap inside exactly one of them. In practice this means they…
General practice
Given an infinite integer grid and allowed moves that either double one coordinate or replace a coordinate by its difference with the other ((x,y) ->…
General practice
Check whether the string s can be exactly formed by concatenating the first k (1 ≤ k ≤ words.length) strings in words; return true if…
General practice
Determine whether a given string can be partitioned into contiguous substrings so that every substring has the same computed "value" (typically defined by a character-to-number…
General practice
Given two equal-length digit strings s and t, determine whether s can be transformed into t by repeatedly choosing substrings and sorting them in ascending…
General practice
Given two length-4 strings where the only allowed operation is swapping characters at indices that differ by 2 (i.e., 0↔2 or 1↔3), determine whether s1…
General practice
Given two equal-length strings where you may swap characters only between indices with the same parity (j - i even), determine whether you can make…
General practice
Given a 3-digit integer n, form the concatenation of n, 2n, and 3n and return true if that 9-digit string contains each digit 1–9 exactly…
General practice
Determine whether there's a path inside the rectangle from (0,0) to (xCorner,yCorner) that stays strictly inside the rectangle (touches it only at the two corners)…
General practice
Given a binary-labeled structure (e.g., tree, grid, or graph), determine whether there exists a path (typically root-to-leaf or start-to-end) whose number of 0s equals its…
General practice
Given an m×n grid of '(' and ')', determine whether there exists a down/right path from the top-left to bottom-right whose concatenated characters form a…
General practice
Determine whether the array can be partitioned into contiguous subarrays each of which is either two equal elements, three equal elements, or three consecutive increasing…
General practice
Determine whether there's a path from the top-left to bottom-right of an m×n grid where each cell type specifies which neighboring directions it connects to…
General practice
Given two chessboard coordinates, determine whether the squares share the same color by converting the column letter and row digit to numeric indices and comparing…
General practice
Given two expression trees containing operators, variables and constants, determine whether they represent the same algebraic expression by accounting for operator properties…
General practice
Map each letter 'a'..'j' to digits 0..9, form each word's numerical value by concatenating those digits and parsing as an integer, and check whether firstWord_value…
General practice
Given an n×n grid where grid[r][c] is the step number when a knight visited that cell, verify the configuration is a valid knight's tour: the…
General practice
Determine whether two equal-length lowercase strings are "almost equivalent" by verifying that for every letter 'a'–'z' the absolute difference in their frequencies is at most…
General practice