Skip to content
Learn Netverks

Lesson

Step 5/36 14% through track

playground-workflow

Playground workflow

Last reviewed May 28, 2026 Content v20260528
Track mode
server_compiled
Means
Compiled runner
Reading
~2 min
Level
beginner

This lesson

This lesson teaches Playground workflow: the syntax, patterns, and safety habits you need before advancing in Kotlin.

Coroutines replace callback hell on Android and in Ktor—structured concurrency is interview-critical.

You will apply Playground workflow in contexts like: Network calls, database I/O, and UI state on Android and Ktor servers.

Write Kotlin in main.kt with fun main(), click Run on server—the dev runner kotlinc compiles to a JVM jar and java runs it; use println for output (requires JDK + kotlinc; LEARNING_RUNNER_ENABLED=true). Also use fun main() and println; avoid Android imports in the sandbox.

At the start of the track—complete before lessons that assume you understand the compiled playground.

Get the most from each lesson's compiled editor—the same habits transfer to IntelliJ, Android Studio, and CI running Gradle tests.

Recommended workflow

  1. Read the concept section before editing code.
  2. Click Run to compile with kotlinc and execute on the JVM.
  3. Use println for debug output—avoid Android SDK imports in runnable snippets.
  4. Change one idea at a time; read compiler errors from top to bottom.

What the runner can and cannot do

  • Can — single-file main.kt with fun main() and stdlib
  • Needs local setup — Gradle multi-module projects, Android layouts, kotlinx-coroutines on classpath

Compare with Java, Go, and C# compiled tracks.

Important interview questions and answers

  1. Q: What prints to stdout in Kotlin lessons?
    A: println and print from the Kotlin standard library.
  2. Q: What is the entry point?
    A: Top-level fun main()—no public static void main required unless interoping with Java conventions.

Self-check

  1. What filename does the playground expect?
  2. What should you avoid importing in sandbox code?

Challenge

First compile and run

  1. Click Run with the default code.
  2. Confirm output appears in the terminal.
  3. Add a second println with your name.

Done when: the terminal shows the default message and your custom line.

Challenge

First compile and run

  1. Click Run with default code.
  2. Confirm terminal output.
  3. Add a custom println.

Done when: terminal shows default and your custom line.

Interview prep

What runs code in the playground?

kotlinc compiles main.kt; JVM runs MainKt with fun main().

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • kotlinc error read?
  • fun main entry?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump