New: Find Shortest Unique Prefixasked atMeta
WTFWhack The Fullstack Interview

What's new

Real interview questions and the companies that asked them, newest first.

  1. Asked atMeta
    Find Shortest Unique PrefixNew

    For every word, find the shortest prefix that no other word in the list starts with.

  2. Asked atExpedia
    Rank Songs by PopularityNew

    Rank songs by how many other songs they beat head-to-head across users' preference lists, breaking ties by the smaller song id.

  3. Asked atGoogleMetaMicrosoft
    Count Distinct Elements in WindowNew

    For every window of k consecutive elements, count how many distinct values it contains.

  4. Asked atMeta
    Split Array with Equal SumNew

    Find the index where an array of positive integers splits into two contiguous parts with equal sums, or -1 if there isn't one.

  5. Asked atMicrosoft
    Merge Sorted Arrays with deduplicationNew

    Merge two sorted arrays into one sorted array where every distinct value appears exactly once.

  6. Asked atAmazon
    Minimum Redistribution CostNew

    Balance products across warehouses in a circle, moving everything clockwise or everything counterclockwise, at the lowest total cost.

  7. Asked atMetaMicrosoft
    Minimal Board Length for HolesNew

    Cover every hole in a table with exactly two boards of the same integer length, and return the shortest length that works.

  8. Asked atMicrosoftGoogleGoldman Sachs
    Largest Tree RootNew

    Given [child, parent] pairs describing a forest, return the root of the tree with the most nodes, breaking ties by the smallest root ID.

  9. Asked atVisa
    Rate Limiter Button

    Build a button rate limiting the clicks

More company questions are on the way.