Skip to main content
InterviewHubPRO
Section Overview
Q31

Question 31 of 50

Part 3: K2 Compiler, KMP, Advanced Metaprogramming & Optimization (25 - 35)

62%
Kotlin & Coroutines (50 Qs)•Part 3: K2 Compiler, KMP, Advanced Metaprogramming & Optimization (25 - 35)

What is the difference between Array<T> and primitive arrays like IntArray in Kotlin?

senior LevelPerformanceData Structures

In Simple Words:

  • Array<Int>: Maps to Java's Integer[] reference array on the JVM, incurring boxing overhead for every element.
  • IntArray / ByteArray: Maps directly to native primitive Java int[] on the JVM, storing values unboxed in contiguous memory with zero allocation overhead.