PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Bitkernel

Trace first pass of heap sort

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of heap sort and heap operations, specifically max-heap construction, root extraction, and subsequent heapify steps during an in-place array sort.

  • medium
  • Bitkernel
  • Software Engineering Fundamentals
  • Software Engineer

Trace first pass of heap sort

Company: Bitkernel

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Take-home Project

Given the integer array `[7, 6, 3, 5, 4, 1, 2]`, you apply heap sort to sort it in ascending order using a max-heap implementation. After building the initial max-heap and performing the first extraction step (swap the root with the last element and then heapify the remaining elements), what is the resulting order of the array? Options: - A. `1-2-3-4-5-6-7` - B. `2-6-3-5-4-1-7` - C. `6-5-3-2-4-1-7` - D. `5-4-3-2-1-6-7`

Quick Answer: This question evaluates understanding of heap sort and heap operations, specifically max-heap construction, root extraction, and subsequent heapify steps during an in-place array sort.

Related Interview Questions

  • Evaluate C for-loop execution count - Bitkernel (medium)
  • Find minimum two’s-complement value with three ones - Bitkernel (medium)
  • Identify incorrect statement about sockets - Bitkernel (medium)
  • Solve cups logic puzzle with one true statement - Bitkernel (medium)
  • Choose unsuitable file structure for random access - Bitkernel (medium)
|Home/Software Engineering Fundamentals/Bitkernel

Trace first pass of heap sort

Bitkernel logo
Bitkernel
Oct 24, 2025, 12:00 AM
mediumSoftware EngineerTake-home ProjectSoftware Engineering Fundamentals
2
0

Given the integer array [7, 6, 3, 5, 4, 1, 2], you apply heap sort to sort it in ascending order using a max-heap implementation.

After building the initial max-heap and performing the first extraction step (swap the root with the last element and then heapify the remaining elements), what is the resulting order of the array?

Options:

  • A. 1-2-3-4-5-6-7
  • B. 2-6-3-5-4-1-7
  • C. 6-5-3-2-4-1-7
  • D. 5-4-3-2-1-6-7
Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Bitkernel•More Software Engineer•Bitkernel Software Engineer•Bitkernel Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.