ReviseAlgo Logo

Control Flow

9 Topics
1

if-else Statements

Master conditional branching with if, else-if, and else blocks, including boolean condition evaluations and block scoping.

Tests nested if-else parsing, dangling else ambiguity, and variable scoping boundaries inside conditional blocks.
2

switch-case

Compare legacy switch statements with modern switch expressions, covering arrows, yield, yield exhaustiveness, and pattern matching.

Focuses on the differences between statements and expressions, break-less fallthroughs, and compiler exhaustiveness requirements.
3

for Loop

Understand the standard three-part for loop, index control variables, loop condition bounds, and loop execution lifecycle.

Tests loop initialization expressions, multiple loop variables, execution order, and infinite loop cases.
4

while Loop

Explore pre-test loop mechanics, condition evaluations, and sentinel-controlled iteration patterns.

Focuses on indefinite iterations, loop invariant verification, and avoiding infinite execution loops.
5

do-while Loop

Examine post-test loops, guaranteeing at least one execution iteration, and scoping behaviors.

Tests variable visibility limits between the loop body and the while condition check at the bottom.
6

Enhanced for Loop

Understand the compiler mechanics of the enhanced for-loop (for-each) for arrays and Iterable collections.

Deep-dive questions on Iterator compiler transformations, array loops, and ConcurrentModificationExceptions.
7

break and continue

Control execution flow using break and continue keywords, exploring early loop termination and iteration skips.

Tests nested loop branch jumps, execution pathways, and unreachable statement compiler flags.
8

Labeled Statements

Apply labels to loops and blocks to control nested execution redirection via labeled break and continue.

Tests compound nested loop control flow, label declarations, and structured execution jumps.
9

Ternary Operator

Master the conditional expression ternary operator, parsing type promotions and null-safety applications.

Evaluates type compatibility rules, auto-unboxing promotions, and comparison evaluation priorities.