Bytedance Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Maximize products bought under budget
Given N products and M customers, for each customer find the list of distinct products they can buy without exceeding their budget such that the numbe...
Generate all safe queen placements on board
You are given an integer n representing the size of a chessboard (n × n). You need to place n queens on the board so that no two queens attack each ot...
Find kth smallest in sorted 2D matrix
You are given an n x m matrix of integers where each row and each column is sorted in non-decreasing order. You are also given an integer k such that ...
Compute maximum path sum in binary tree
Given the root of a binary tree where each node contains an integer value (which may be negative), return the maximum possible sum of values along any...
Implement streaming SRM detector with late events
Implement a streaming detector for sample ratio mismatch (SRM) across many concurrent experiments. Input is two topic-partitioned streams: assignments...