DevPrep

All topics › Programming basics

High-level programming language

Junior

Essence

A high-level language hides the machine's details — registers, addresses, manual memory management — behind abstractions: types, functions, collections, objects. One line like names.map { $0.uppercased() } expands into hundreds of machine instructions, but the programmer thinks about the problem, not the CPU. The price is dependence on the compiler/runtime and less control over the hardware.

Where Swift sits on this scale

Swift is high-level yet compiled to native code (through LLVM), with no virtual machine and no garbage collector:

// High level: the type is inferred, memory and refcounts are the compiler's job
let names = ["Ann", "Bob"]
let upper = names.map { $0.uppercased() }
print(upper)                           // ["ANN", "BOB"]

// Low level is available, but explicit and labelled Unsafe
let p = UnsafeMutablePointer<Int>.allocate(capacity: 1)
p.initialize(to: 42)
print(p.pointee)                       // 42
p.deinitialize(count: 1)
p.deallocate()  // forget this — a leak the compiler won't catch

Comparison for context

What the interviewer looks for

Do you understand that "high-level" does not mean "slow": Swift is comparable to C++ in speed because the abstractions are resolved at compile time. And do you know exactly which things Swift hides (ARC, layout, dispatch), so you can see them when the profiler points at a problem.

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store