Meta Variants for LC76 & LC317 (Minimum Substring Window & Shortest Distance from All Buildings)

Posted
1 Jul 2025
310 reads

Summary

I conducted a mock phone screen interview covering Meta variants of LeetCode Hard problems LC76 (Minimum Window Substring) and LC317 (Shortest Distance From All Buildings).

How it went

Hey y’all, Summer and I did another mock phone screen interview, this time going over two Leetcode Hards: LC76 Minimum Window Substring and LC317 Shortest Distance From All Buildings. IMO an interview format was the most efficient way to cover these two problems, both of which will be rephrased in your actual interview:

As you’ll see, LC76’s input will be the following:

Input:
sentence = ['is', 'one', 'ok', 'you', 'the', 'frog', 'ok', 'one', 'the', 'you', 'is', 'not', 'frog']
words = ['is', 'you', 'frog']

Output: "you is not frog"

For LC317, it’ll be reworded where you’re trying to place the optimal well in a 2D matrix where a T represents a tree and an H represents a house.

Check it out (or not!):

Leetcode 76 & Leetcode 317 (Link)

Meta_Coding_Interview.jpg

As always, good luck on your interviews!!


Reference to all of the Meta Variants, Playlists & Unknowns: https://leetcode.com/discuss/post/6615244/meta-variant-compilation-by-codingwithmi-0pm7/

Please note the coderpad.io settings and tools utilized in the video is exactly what you should expect in a Meta interview.

And yes, being asked 2 Hard LC in a phone screen is unlikely but possible - another combo I see is LC987 and LC317. Or others with LC827, or LC282 (but rarely).

Questions asked (2)

  1. 01

    Minimum Window Substring - Words in Sentence

    Data Structures & Algorithms · Hard

    Given a sentence as an array of words and a target array of words, find the minimum window substring (contiguous words) in the sentence that contains all words from the target array, maintaining order of words in the sentence. Original LC76's input will be rephrased: Input:

    sentence = ['is', 'one', 'ok', 'you', 'the', 'frog', 'ok', 'one', 'the', 'you', 'is', 'not', 'frog']
    words = ['is', 'you', 'frog']

    Output: "you is not frog"

    Open the problem
  2. 02

    Shortest Distance from All Buildings - Optimal Well Placement

    Data Structures & Algorithms · Hard

    Reworded problem where you're trying to place the optimal well in a 2D matrix. A 'T' represents a tree and an 'H' represents a house. Goal is to find a location to place a 'well' (implied, where the distance from all houses is minimized, avoiding trees), similar to Leetcode 317 Shortest Distance From All Buildings.

    Open the problem

How they prepared

I referenced the Meta Variants, Playlists & Unknowns compilation: https://leetcode.com/discuss/post/6615244/meta-variant-compilation-by-codingwithmi-0pm7/. I also noted that the coderpad.io settings and tools utilized in the video are exactly what to expect in a Meta interview. I learned that being asked two Hard LeetCode problems in a phone screen is unlikely but possible, with other common combinations being LC987 and LC317, or LC827, or LC282.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Meta recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!