Variables & Types interview questions

18 Variables & Types 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 val?

Junior
  1. A.the compiler's ability to deduce a declaration's type from its initializer without an explicit annotation
  2. B.a read-only declaration that can be assigned exactly once and cannot be reassigned afterward
  3. C.the root supertype from which every non-nullable type ultimately descends
  4. D.an automatic conversion to a more specific type after a check, letting later code use it without manual casting

Answer + AI explanation with Pro

2. Which term means: "a read-only declaration that can be assigned exactly once and cannot be reassigned afterward"?

Junior
  1. A.Smart cast
  2. B.val
  3. C.var
  4. D.Any

Answer + AI explanation with Pro

3. Which statement is correct?

Junior
  1. A.val — the root supertype from which every non-nullable type ultimately descends
  2. B.val — a read-only declaration that can be assigned exactly once and cannot be reassigned afterward
  3. C.val — the type with a single value returned by functions that produce no meaningful result
  4. D.val — the compiler's ability to deduce a declaration's type from its initializer without an explicit annotation

Answer + AI explanation with Pro

4. What is var?

Junior
  1. A.the type with a single value returned by functions that produce no meaningful result
  2. B.a read-only declaration that can be assigned exactly once and cannot be reassigned afterward
  3. C.the root supertype from which every non-nullable type ultimately descends
  4. D.a mutable declaration whose binding can be reassigned multiple times

Answer + AI explanation with Pro

5. Which term means: "a mutable declaration whose binding can be reassigned multiple times"?

Junior
  1. A.var
  2. B.Any
  3. C.Type inference
  4. D.Smart cast

Answer + AI explanation with Pro

6. Which statement is correct?

Junior
  1. A.var — an automatic conversion to a more specific type after a check, letting later code use it without manual casting
  2. B.var — the type with a single value returned by functions that produce no meaningful result
  3. C.var — a read-only declaration that can be assigned exactly once and cannot be reassigned afterward
  4. D.var — a mutable declaration whose binding can be reassigned multiple times

Answer + AI explanation with Pro

7. What is Type inference?

Junior
  1. A.a mutable declaration whose binding can be reassigned multiple times
  2. B.a read-only declaration that can be assigned exactly once and cannot be reassigned afterward
  3. C.the type with a single value returned by functions that produce no meaningful result
  4. D.the compiler's ability to deduce a declaration's type from its initializer without an explicit annotation

Answer + AI explanation with Pro

8. Which term means: "the compiler's ability to deduce a declaration's type from its initializer without an explicit annotation"?

Junior
  1. A.Smart cast
  2. B.Unit
  3. C.Any
  4. D.Type inference

Answer + AI explanation with Pro

9. Which statement is correct?

Junior
  1. A.Type inference — an automatic conversion to a more specific type after a check, letting later code use it without manual casting
  2. B.Type inference — a read-only declaration that can be assigned exactly once and cannot be reassigned afterward
  3. C.Type inference — the compiler's ability to deduce a declaration's type from its initializer without an explicit annotation
  4. D.Type inference — the root supertype from which every non-nullable type ultimately descends

Answer + AI explanation with Pro

10. What is Smart cast?

Mid
  1. A.the root supertype from which every non-nullable type ultimately descends
  2. B.the type with a single value returned by functions that produce no meaningful result
  3. C.a read-only declaration that can be assigned exactly once and cannot be reassigned afterward
  4. D.an automatic conversion to a more specific type after a check, letting later code use it without manual casting

Answer + AI explanation with Pro

11. Which term means: "an automatic conversion to a more specific type after a check, letting later code use it without manual casting"?

Mid
  1. A.Smart cast
  2. B.Type inference
  3. C.Any
  4. D.val

Answer + AI explanation with Pro

12. Which statement is correct?

Mid
  1. A.Smart cast — an automatic conversion to a more specific type after a check, letting later code use it without manual casting
  2. B.Smart cast — the compiler's ability to deduce a declaration's type from its initializer without an explicit annotation
  3. C.Smart cast — the root supertype from which every non-nullable type ultimately descends
  4. D.Smart cast — a read-only declaration that can be assigned exactly once and cannot be reassigned afterward

Answer + AI explanation with Pro

13. What is Any?

Mid
  1. A.the root supertype from which every non-nullable type ultimately descends
  2. B.a read-only declaration that can be assigned exactly once and cannot be reassigned afterward
  3. C.the compiler's ability to deduce a declaration's type from its initializer without an explicit annotation
  4. D.an automatic conversion to a more specific type after a check, letting later code use it without manual casting

Answer + AI explanation with Pro

14. Which term means: "the root supertype from which every non-nullable type ultimately descends"?

Mid
  1. A.Any
  2. B.Type inference
  3. C.val
  4. D.Smart cast

Answer + AI explanation with Pro

15. Which statement is correct?

Mid
  1. A.Any — the compiler's ability to deduce a declaration's type from its initializer without an explicit annotation
  2. B.Any — the root supertype from which every non-nullable type ultimately descends
  3. C.Any — the type with a single value returned by functions that produce no meaningful result
  4. D.Any — a mutable declaration whose binding can be reassigned multiple times

Answer + AI explanation with Pro

16. What is Unit?

Mid
  1. A.the type with a single value returned by functions that produce no meaningful result
  2. B.a mutable declaration whose binding can be reassigned multiple times
  3. C.the compiler's ability to deduce a declaration's type from its initializer without an explicit annotation
  4. D.an automatic conversion to a more specific type after a check, letting later code use it without manual casting

Answer + AI explanation with Pro

17. Which term means: "the type with a single value returned by functions that produce no meaningful result"?

Mid
  1. A.Smart cast
  2. B.Unit
  3. C.Type inference
  4. D.var

Answer + AI explanation with Pro

18. Which statement is correct?

Mid
  1. A.Unit — an automatic conversion to a more specific type after a check, letting later code use it without manual casting
  2. B.Unit — the type with a single value returned by functions that produce no meaningful result
  3. C.Unit — a mutable declaration whose binding can be reassigned multiple times
  4. D.Unit — the compiler's ability to deduce a declaration's type from its initializer without an explicit annotation

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 Variables & Types 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