Meta intern最近开放了 Software Engineer Intern,岗位有一点要求需要注意下 ‘This internship has a minimum twelve (12) week duration with 2025 start dates only’,必须是2025年毕业并且实习最少12周,最近也有不少小伙伴收到了Meta intern的面试,offer已经拿到了,start date February 3, 2025,现在分享下近期Meta intern的面试真题。

Meta Intern VO 1
Give two strings judge if one is a subsequence of another
Example:input: s = "abc", t = "ahbgdc"
output: true
Follow up question.
Given a string s and an array of strings words, return the number of words[i] that is a subsequence of s
Example:input: s = "abc", words = ["a", "bb", "acd", "ace"]
output: 2
Problem-solving ideas
Basic problem solving
two-pointer method (computing):
- Iterate over two strings with two pointers each.
- If the current character matches, both pointers move; otherwise, only the main string pointer moves.
- If the pointer to a substring can be traversed, it means it is a subsequence.
Time complexity: O(n), where n is the length of the main string.
Follow up solution
brute force:
- right
wordsin each string, use the double-pointer method to determine whether theSThe subsequence of the - Time Complexity: O(m * n), where m is
wordsThe length of n is the length of theSThe length of the
Optimization methods:
- Preprocessing the Master String
S:- Create a hash table or array
charIndex, stores the position of each character occurrence in the main string. - Use binary lookup to quickly find a match.
- Create a hash table or array
- Quick positioning using the dichotomy method:
- For each character in the string, the characters in order in the
SFind the next position in the center using bisection. - Time complexity: O(n + m * k * log(n)), where
kYeswordsThe average length of the strings in the
- For each character in the string, the characters in order in the
Meta Intern VO 2
长度为 n 的数组 array,其中每个元素 x 满足 0 ≤ x ≤ n-1。找到数组中所有重复的元素。
Example
input: [3, 1, 2, 3, 0]
output: [3]
Follow up question
No extra space, no recursive calls or func calls.
Core idea: modify the array in place, iterate over each element in the array, place the element in the correct position, swap the element to the correct position, if the position is already occupied, the element is a duplicate
Time complexity O(n), space complexity O(1)
Meta internship schedule
- Internship schedule (assuming 12 weeks):
- Weeks 1-3: Induction
- Weeks 5-6: Mid-cycle review
- Weeks 10-11: Final decision on offer (return offer is decided here)
- Weeks 11-12: Relax and have fun. Only your performance in weeks 1-10 will count towards your internship assessment!
Say goodbye to interview troubles and get your ideal Offer straight away!
After our powerful VO assist Through the analysis and communication of these interview questions, the interviewer not only understands the candidate's programming ability, but also sees my clear thinking and effective communication skills in the process of problem solving. These not only help to deal with Meta's interview, but also improve our ability to solve real programming problems. I wish you all good luck in your interviews!