Comprehensions & Iterators interview questions

15 Comprehensions & Iterators questions from the Python 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 list comprehension?

Junior
  1. A.an object that can return a fresh iterator via __iter__, such as a list or string
  2. B.a bracketed expression that builds a new list eagerly by iterating over a source
  3. C.a brace-delimited expression of the form key:value that builds a mapping from an iterable
  4. D.a parenthesized comprehension that yields items lazily one at a time without building the whole sequence in memory

Answer + AI explanation with Pro

2. Which term means: "a bracketed expression that builds a new list eagerly by iterating over a source"?

Junior
  1. A.generator expression
  2. B.list comprehension
  3. C.iterator
  4. D.dict comprehension

Answer + AI explanation with Pro

3. Which statement is correct?

Junior
  1. A.list comprehension — an object that can return a fresh iterator via __iter__, such as a list or string
  2. B.list comprehension — a bracketed expression that builds a new list eagerly by iterating over a source
  3. C.list comprehension — a parenthesized comprehension that yields items lazily one at a time without building the whole sequence in memory
  4. D.list comprehension — an object implementing __next__ that produces successive values and raises StopIteration when exhausted

Answer + AI explanation with Pro

4. What is generator expression?

Mid
  1. A.a brace-delimited expression of the form key:value that builds a mapping from an iterable
  2. B.a parenthesized comprehension that yields items lazily one at a time without building the whole sequence in memory
  3. C.an object implementing __next__ that produces successive values and raises StopIteration when exhausted
  4. D.an object that can return a fresh iterator via __iter__, such as a list or string

Answer + AI explanation with Pro

5. Which term means: "a parenthesized comprehension that yields items lazily one at a time without building the whole sequence in memory"?

Mid
  1. A.generator expression
  2. B.iterator
  3. C.iterable
  4. D.list comprehension

Answer + AI explanation with Pro

6. Which statement is correct?

Mid
  1. A.generator expression — a parenthesized comprehension that yields items lazily one at a time without building the whole sequence in memory
  2. B.generator expression — an object implementing __next__ that produces successive values and raises StopIteration when exhausted
  3. C.generator expression — a bracketed expression that builds a new list eagerly by iterating over a source
  4. D.generator expression — an object that can return a fresh iterator via __iter__, such as a list or string

Answer + AI explanation with Pro

7. What is dict comprehension?

Junior
  1. A.an object implementing __next__ that produces successive values and raises StopIteration when exhausted
  2. B.a brace-delimited expression of the form key:value that builds a mapping from an iterable
  3. C.a parenthesized comprehension that yields items lazily one at a time without building the whole sequence in memory
  4. D.a bracketed expression that builds a new list eagerly by iterating over a source

Answer + AI explanation with Pro

8. Which term means: "a brace-delimited expression of the form key:value that builds a mapping from an iterable"?

Junior
  1. A.generator expression
  2. B.iterator
  3. C.list comprehension
  4. D.dict comprehension

Answer + AI explanation with Pro

9. Which statement is correct?

Junior
  1. A.dict comprehension — a bracketed expression that builds a new list eagerly by iterating over a source
  2. B.dict comprehension — an object implementing __next__ that produces successive values and raises StopIteration when exhausted
  3. C.dict comprehension — a brace-delimited expression of the form key:value that builds a mapping from an iterable
  4. D.dict comprehension — a parenthesized comprehension that yields items lazily one at a time without building the whole sequence in memory

Answer + AI explanation with Pro

10. What is iterator?

Mid
  1. A.an object that can return a fresh iterator via __iter__, such as a list or string
  2. B.a bracketed expression that builds a new list eagerly by iterating over a source
  3. C.an object implementing __next__ that produces successive values and raises StopIteration when exhausted
  4. D.a parenthesized comprehension that yields items lazily one at a time without building the whole sequence in memory

Answer + AI explanation with Pro

11. Which term means: "an object implementing __next__ that produces successive values and raises StopIteration when exhausted"?

Mid
  1. A.iterator
  2. B.generator expression
  3. C.list comprehension
  4. D.dict comprehension

Answer + AI explanation with Pro

12. Which statement is correct?

Mid
  1. A.iterator — an object that can return a fresh iterator via __iter__, such as a list or string
  2. B.iterator — an object implementing __next__ that produces successive values and raises StopIteration when exhausted
  3. C.iterator — a parenthesized comprehension that yields items lazily one at a time without building the whole sequence in memory
  4. D.iterator — a brace-delimited expression of the form key:value that builds a mapping from an iterable

Answer + AI explanation with Pro

13. What is iterable?

Mid
  1. A.a bracketed expression that builds a new list eagerly by iterating over a source
  2. B.a parenthesized comprehension that yields items lazily one at a time without building the whole sequence in memory
  3. C.an object that can return a fresh iterator via __iter__, such as a list or string
  4. D.a brace-delimited expression of the form key:value that builds a mapping from an iterable

Answer + AI explanation with Pro

14. Which term means: "an object that can return a fresh iterator via __iter__, such as a list or string"?

Mid
  1. A.iterator
  2. B.iterable
  3. C.generator expression
  4. D.dict comprehension

Answer + AI explanation with Pro

15. Which statement is correct?

Mid
  1. A.iterable — a bracketed expression that builds a new list eagerly by iterating over a source
  2. B.iterable — an object implementing __next__ that produces successive values and raises StopIteration when exhausted
  3. C.iterable — an object that can return a fresh iterator via __iter__, such as a list or string
  4. D.iterable — a brace-delimited expression of the form key:value that builds a mapping from an iterable

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 Comprehensions & Iterators 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