# Java Interview with a FAANG engineer

#### Watch a Java mock Interview with a Facebook software engineer. See someone try to solve the minimum window substring problem.

[Minimum Window Substring: Java Interview with a Facebook Engineer](https://www.youtube.com/watch?v=KkxjoajYG1o)

### Interview Summary

#### Problem type

Minimum Window Substring

#### Interview question

Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string "".

Read more about the questions

- [Minimum Window Substring](/content/questions/minimum-window-substring/index.html)

### Interview Feedback

#### Feedback about Declarative Bandersnatch (the interviewee)

Advance this person to the next round?

Yes

**How were their technical skills?**
4/4

**How was their problem solving ability?**
4/4

**What about their communication ability?**
4/4

> Strengths:
> 
> + TC clarified all important details regarding the input.
> + TC explained their approach by running with example.
> + TC identified sliding window pattern for solution early.
> + TC wrote easy to follow code with good naming conventions.
> + TC handled the edge cases like empty string well while writing the code.
> + TC debugged their code while working with example test-case.
> 
> Improvement Areas:
> - Overall speed was on little slower side which did not leave enough time for me to ask follow up question.
> 
> Suggestion:
> 1. Try to skip running through example while discussing the approach.
> 
> Overall Hiring Decision:
> It will be leaning hire. Could have been hire if there had been enough time for follow up question.

#### Feedback about Red Maelstrom (the interviewer)

Would you want to work with this person?

Yes

**How excited would you be to work with them?**
4/4

**How good were the questions?**
4/4

**How helpful was your interviewer in guiding you to the solution(s)?**
3/4

> N/A

### Interview Transcript

Declarative Bandersnatch: Hello.\nRed Maelstrom: Hey hello, am I audible?\nDeclarative Bandersnatch: Good, how are you?\nRed Maelstrom: I'm doing good. Awesome. So let's start with the coding questions. We will spend like 45 minutes on coding, like the last 10-15 minutes on the feedback.\nDeclarative Bandersnatch: Okay, sounds good.\nRed Maelstrom: Sure. I'm just pasting the question. So basically you have two strings, S and T of length, M and N, respectively. You have to return the minimum window substring of an S such that every character in it, every character in T, including duplicates, is also included in this window. If there are no such substrings, return the empty string.

Declarative Bandersnatch: Okay. I just want to ask a couple of questions to clarify. So in this, in the examples, there are capital letters and lower case letters. Are these the only kind of characters that can be in the string or could have, like, punctuation, like exclamation points, periods, et cetera, that kind of stuff?\nRed Maelstrom: That's a good question. Let's assume that it just has capital and small letters.\nDeclarative Bandersnatch: Okay. And also, can either of the strings be empty S and T?\nRed Maelstrom: Yes, in that case output should be empty.\nDeclarative Bandersnatch: Okay, and what would be the max size of the two strings? Sorry, could you say that again?\nRed Maelstrom: Ten to the power of five.\nDeclarative Bandersnatch: Ten to the power of five. Okay, so the goal is we want to find every character in T is included in the window. Okay, I think I understand.

### Coding Explanation and Approach

... (Truncated for clarity, not including specific coding details due to content length restriction)

### Final Thoughts
- The time complexity is O(M) where M is the number of characters in S and the space complexity can be O(M) where M is the number of characters in T.
