What's new
Real interview questions and the companies that asked them, newest first.
- Asked atFind Shortest Unique PrefixNew
Meta
For every word, find the shortest prefix that no other word in the list starts with.
- Asked atRank Songs by PopularityNew
Expedia
Rank songs by how many other songs they beat head-to-head across users' preference lists, breaking ties by the smaller song id.
- Asked atCount Distinct Elements in WindowNew
Google
Meta
Microsoft
For every window of k consecutive elements, count how many distinct values it contains.
- Asked atSplit Array with Equal SumNew
Meta
Find the index where an array of positive integers splits into two contiguous parts with equal sums, or -1 if there isn't one.
- Asked atMerge Sorted Arrays with deduplicationNew
Microsoft
Merge two sorted arrays into one sorted array where every distinct value appears exactly once.
- Asked atMinimum Redistribution CostNew
Amazon
Balance products across warehouses in a circle, moving everything clockwise or everything counterclockwise, at the lowest total cost.
- Asked atMinimal Board Length for HolesNew
Meta
Microsoft
Cover every hole in a table with exactly two boards of the same integer length, and return the shortest length that works.
- Asked atLargest Tree RootNew
Microsoft
Google
Goldman Sachs
Given [child, parent] pairs describing a forest, return the root of the tree with the most nodes, breaking ties by the smallest root ID.
- Asked atVisaRate Limiter Button
Build a button rate limiting the clicks