Panda Guru LogoPanda
Guru

Microsoft interview | SDE | Unexpected failure | Answer some of my questions

Round 2 DSA

Questions: The interviewer asked the candidate to implement a Max Heap. The candidate was confused about the definition of "Heapify" and its application. The candidate believed that Heapify is a procedure to create a heap from N elements given at once, taking O(N) time, while the interviewer insisted that Heapify is used to maintain the heap property.

image

The candidate also referenced a video about Heapify: Heapify is a procedure to create a heap 42:12.

Follow-up Questions:

Candidate's Approach

The candidate proposed to:

  1. Use insert to compare with the parent and move elements up.
  2. Use the heapify algorithm to create the heap if all N elements are given at once.

However, there was a misunderstanding regarding the implementation of Heapify and the candidate's logic was not understood by the interviewer. The candidate attempted to explain their approach but faced confusion and miscommunication throughout the interview.

Interviewer's Feedback

No feedback provided.