C++ Interview with a FAANG engineer.

C++ Interview with a FAANG engineer

Interview Summary

Problem type
Buildings with an ocean view

Interview question
There are n buildings in a line. You are given an integer array heights of size n that represents the heights of the buildings in the line.
The ocean is to the right of the buildings. A building has an ocean view if the building can see the ocean without obstructions. Return a list of indices (0-indexed) of buildings that have an ocean view, sorted in increasing order.

Example 1:
Input: heights = [4,2,3,1]
Output: [0,2,3]
Explanation: Building 1 does not have an ocean view because building 2 is taller.

Example 2:
Input: heights = [4,4,1]
Output: [1, 2]

Interview Feedback

Feedback about Digital Fresh (the interviewee)

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

Strengths:

Potential areas of improvement

Interview Transcript

Digital Fresh: Yeah, I'm looking for like an E3 level. I have two years of experience, but yeah, I'm still looking for more of an entry level role.

Stochastic Panda: Excellent. So let's move on to the interview question. Here we go.

Digital Fresh: Time is O(N) and Space is also O(N).

Stochastic Panda: Okay, great. I think this is looking good. Let's move on to one more question and let's see if it's okay. I'll paste the question starting now. Here we go.

Second Problem: The Skyline of Buildings

Interview question
You are given an integer array heights of size n. Each element height[i] represents the height of the ith building. The skyline is valid if it meets the following conditions: The first and last building in the skyline have the same height. Return the maximum possible score of some valid skyline after demolishing buildings.

Expected Output

For both interviews, it is expected that a candidate should clarify the output they are seeking.

Feedback about Stochastic Panda (the interviewer)

Closing Remarks