PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates understanding of heap data structures and the in-place bottom-up heapify algorithm for building a max-heap on a 0-indexed array, testing skills in array manipulation, heap invariants, and algorithmic reasoning.

  • Medium
  • Akuna Capital
  • Coding & Algorithms
  • Software Engineer

Heapify an array into a max-heap

Company: Akuna Capital

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

Given the array [6, 15, 2, 4, 3, 8, 19], apply heapify to build a max-heap using the standard in-place bottom-up method with a 0-indexed array representation. What is the final array after heap construction? Show key steps or justify your result.

Quick Answer: This question evaluates understanding of heap data structures and the in-place bottom-up heapify algorithm for building a max-heap on a 0-indexed array, testing skills in array manipulation, heap invariants, and algorithmic reasoning.

Apply standard in-place bottom-up heapify to return a max-heap array.

Examples

Input: ([6, 15, 2, 4, 3, 8, 19],)

Expected Output: [19, 15, 8, 4, 3, 6, 2]

Explanation: Prompt array.

Input: ([1, 2, 3],)

Expected Output: [3, 2, 1]

Explanation: Small heap.

Input: ([],)

Expected Output: []

Explanation: Empty array.

Hints

  1. Sift down each internal node from right to left.
Last updated: Jun 27, 2026

Loading coding console...

PracHub

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

Product

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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL 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.

Related Coding Questions

  • Compute Graph Spread and Portfolio Trades - Akuna Capital (medium)
  • Find minimum swaps to sort array with duplicates - Akuna Capital (hard)
  • Break a palindrome to smallest non-palindrome - Akuna Capital (Medium)
  • Compute max profit across dated stock quotes - Akuna Capital (Medium)
  • Compute min operations to transform integers - Akuna Capital (Medium)