Control Flow interview questions

12 Control Flow questions from the Kotlin bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Free to start: the 2-minute IT readiness check — six questions and a result.

Take the free IT readiness check

or take a mock interview set up for this area

1. What is when expression?

Junior
  1. A.the use of a conditional that yields a value directly, removing the need for a ternary operator
  2. B.a multi-branch construct that returns a value and can replace a chain of conditional checks
  3. C.a progression of values created with the dotted operator and commonly iterated in a loop
  4. D.the requirement that every possible case of a sealed type or enum be handled when the result is used

Answer + AI explanation with Pro

2. Which term means: "a multi-branch construct that returns a value and can replace a chain of conditional checks"?

Junior
  1. A.if as expression
  2. B.Range
  3. C.when expression
  4. D.Exhaustive branching

Answer + AI explanation with Pro

3. Which statement is correct?

Junior
  1. A.when expression — the requirement that every possible case of a sealed type or enum be handled when the result is used
  2. B.when expression — a progression of values created with the dotted operator and commonly iterated in a loop
  3. C.when expression — the use of a conditional that yields a value directly, removing the need for a ternary operator
  4. D.when expression — a multi-branch construct that returns a value and can replace a chain of conditional checks

Answer + AI explanation with Pro

4. What is Range?

Junior
  1. A.the use of a conditional that yields a value directly, removing the need for a ternary operator
  2. B.the requirement that every possible case of a sealed type or enum be handled when the result is used
  3. C.a progression of values created with the dotted operator and commonly iterated in a loop
  4. D.a multi-branch construct that returns a value and can replace a chain of conditional checks

Answer + AI explanation with Pro

5. Which term means: "a progression of values created with the dotted operator and commonly iterated in a loop"?

Junior
  1. A.when expression
  2. B.if as expression
  3. C.Exhaustive branching
  4. D.Range

Answer + AI explanation with Pro

6. Which statement is correct?

Junior
  1. A.Range — the requirement that every possible case of a sealed type or enum be handled when the result is used
  2. B.Range — a progression of values created with the dotted operator and commonly iterated in a loop
  3. C.Range — the use of a conditional that yields a value directly, removing the need for a ternary operator
  4. D.Range — a multi-branch construct that returns a value and can replace a chain of conditional checks

Answer + AI explanation with Pro

7. What is if as expression?

Junior
  1. A.a multi-branch construct that returns a value and can replace a chain of conditional checks
  2. B.the use of a conditional that yields a value directly, removing the need for a ternary operator
  3. C.a progression of values created with the dotted operator and commonly iterated in a loop
  4. D.the requirement that every possible case of a sealed type or enum be handled when the result is used

Answer + AI explanation with Pro

8. Which term means: "the use of a conditional that yields a value directly, removing the need for a ternary operator"?

Junior
  1. A.if as expression
  2. B.Exhaustive branching
  3. C.Range
  4. D.when expression

Answer + AI explanation with Pro

9. Which statement is correct?

Junior
  1. A.if as expression — a multi-branch construct that returns a value and can replace a chain of conditional checks
  2. B.if as expression — the use of a conditional that yields a value directly, removing the need for a ternary operator
  3. C.if as expression — the requirement that every possible case of a sealed type or enum be handled when the result is used
  4. D.if as expression — a progression of values created with the dotted operator and commonly iterated in a loop

Answer + AI explanation with Pro

10. What is Exhaustive branching?

Mid
  1. A.the use of a conditional that yields a value directly, removing the need for a ternary operator
  2. B.the requirement that every possible case of a sealed type or enum be handled when the result is used
  3. C.a multi-branch construct that returns a value and can replace a chain of conditional checks
  4. D.a progression of values created with the dotted operator and commonly iterated in a loop

Answer + AI explanation with Pro

11. Which term means: "the requirement that every possible case of a sealed type or enum be handled when the result is used"?

Mid
  1. A.Exhaustive branching
  2. B.when expression
  3. C.Range
  4. D.if as expression

Answer + AI explanation with Pro

12. Which statement is correct?

Mid
  1. A.Exhaustive branching — a multi-branch construct that returns a value and can replace a chain of conditional checks
  2. B.Exhaustive branching — a progression of values created with the dotted operator and commonly iterated in a loop
  3. C.Exhaustive branching — the requirement that every possible case of a sealed type or enum be handled when the result is used
  4. D.Exhaustive branching — the use of a conditional that yields a value directly, removing the need for a ternary operator

Answer + AI explanation with Pro

Free to start

Start with a free readiness check

Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Control Flow question come with Pro.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers