DevPrep

All topics › Programming basics

Program

Junior

Essence

A program = data + algorithms packaged into an executable: it takes input (touches, network, files), transforms it and produces output (the screen, a write to disk, a request). The CPU understands only machine instructions and bytes, so everything else — numbers, strings, objects — is an abstraction that the compiler and runtime map onto memory.

What a program is on iOS

import SwiftUI

@main
struct DevPrepApp: App {  // entry point: the compiler generates main()
    var body: some Scene {
        WindowGroup { ContentView() }
    }
}

struct ContentView: View {
    var body: some View { Text("Hello") }
}

Static and dynamic

What the interviewer looks for

Do you understand that your code does not "spin" on its own: the main thread's run loop calls it in response to events, and anything heavy on that thread blocks the UI. This is the bridge to concurrency and the app lifecycle.

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