C# Interview with a Google engineer.

We helped write the sequel to "Cracking the Coding Interview". Read 9 chapters for free →

Please read our definitive guide on Google's hiring process and questions

C# Interview with a Google engineer

Watch someone solve the maximum sum subarray problem in an interview with a Google engineer and see the feedback their interviewer left them. Explore this problem and others in our library of interview replays.

C# interview with a Google engineer: Maximum sum subarray - YouTube

C# interview with a Google engineer: Maximum sum subarray

Interview Summary

Problem type
Maximum sum subarray
Interview question
Given an array, give the start and end indices for a subarray that contains the maximum sum.
Read more about the questions

Interview Feedback

Feedback about Awesome Llama (the interviewee)
Advance this person to the next round?
Yes
How were their technical skills?
3/4
How was their problem solving ability?
4/4
What about their communication ability?
4/4

Mr Llama discovered Kadane's algorithm with minor hints and ended up with an almost clean solution.
Llama should try to write optimal solutions sooner in the interview to get to follow up questions.

Feedback about Epic Iguana (the interviewer)
Would you want to work with this person?
Yes
How excited would you be to work with them?
1/4
How good were the questions?
4/4
How helpful was your interviewer in guiding you to the solution(s)?
3/4

Interview Transcript

Epic Iguana: Hello?
Awesome Llama: Hi, how's it going?
Epic Iguana: Hi, can you hear me fine?
Awesome Llama: Yeah, I can hear you.
Epic Iguana: Okay, hi. So since we're doing this on interviewing.io, we'll just skip the formality at the beginning and go to the technical question if that's fine with you.
Awesome Llama: Sounds good.

Epic Iguana: Okay, so this one's called the largest sum subsequence. And if you've heard this before, you can tell me. The question is, essentially, you're given a list of integers. And they can contain, like numeric features. And what you have to do is, given the list, you have to tell me a range, which has the largest sum possible...

Awesome Llama: Okay. And these have to be consecutive?

Epic Iguana: Yeah, the array has to be consecutive.
...

Epic Iguana: One thing to think about is when does it make sense to keep a negative number in the final range?
Awesome Llama: Well, I guess when maybe there's a number right after it that's big. Like if there was maybe like a negative two but maybe there's like a 50 afterwards, you know, the negative two is worthwhile to keep.

Epic Iguana: Yep. Yeah, that's the direction you can think in. ...

Epic Iguana: So if you're planning to apply for one of the big names like in the FANG, like Facebook, Amazon, Netflix, Google, then I'd definitely recommend brushing up basic dynamic programming questions, at least common recursion. And I'd also recommend doing common tree questions like dfs, bfs questions. But if you're not applying for these top tier companies, and you're just focusing to get into a regular, you know, software engineering role, then these are not really required. Then there's a set of questions that much smaller that you can focus on and attack the interview.
...

Awesome Llama: Interesting, okay. I'm in the process with Amazon, but I haven't had my first interview yet.

Epic Iguana: So yeah, Amazon, the easiest of the lot. They're expanding a whole bunch right now. So yeah, that's a plug for the interview.

Awesome Llama: Okay, awesome. Yeah. Well, thank you for taking the time to mock interview me. ...