Java Interview with an Amazon engineer.

Java Interview with an Amazon engineer

Watch someone solve the median of sorted lists problem in an interview with an Amazon engineer and see the feedback their interviewer left them. Explore this problem and others in our library of interview replays.

Java interview with an Amazon engineer: Median of sorted list - YouTube

Interview Summary

Problem type

Interview question

  1. Given a list of daily temperatures T, return a list such that, for each day in the input, tells you how many days you would have to wait until a warmer temperature. If there is no future day for which this is possible, put 0 instead.
  2. Find the median of two sorted lists.

Interview Feedback

Feedback about The Wild Husky (the interviewee)

N/A

Feedback about Stateless Snake (the interviewer)

N/A

Interview Transcript

Stateless Snake: Hello.

The Wild Husky: Hey. How are you doing?

Stateless Snake: Hi, can you hear me well?

The Wild Husky: Yeah, I can hear you. Can you hear me?

Stateless Snake: I can hear you. Yeah. How are you doing today?

The Wild Husky: I'm doing good. How about you?

Stateless Snake: I'm good, thanks. So this is a one-hour interview, mainly focusing on the coding. Can you tell me a little about yourself and where you are in your interview process?

The Wild Husky: Sure, I have been working as a back-end engineer for the past four years. I used to work as a full-stack engineer. Now I’m working on data infrastructure, developing ETL solutions for enterprise customers. I'm interviewing actively right now, looking for new opportunities.

Stateless Snake: Okay. So do you have any specific company you're looking at?

The Wild Husky: I have some interviews with top-tier companies scheduled soon.

Stateless Snake: Great! Let's get started on the questions.

The Wild Husky: Sure. I think I am ready to tackle the first problem.

Stateless Snake: Alright. Let's discuss the median of sorted lists.

The Wild Husky: The median for two sorted lists can be found using a binary search approach, determining which half contains the median based on comparisons of the middle values.

Time Complexity Analysis

The time complexity for finding the median is O(log(min(n, m))), where n and m are the sizes of the two lists. Space complexity is O(1) as we are using a constant amount of space.

Final thoughts

We discussed various techniques for tackling these problems and highlighted the importance of understanding the problem constraints clearly.
Stateless Snake: Do you have any questions?
The Wild Husky: No, thank you for the opportunity!