15 STL Algorithms and Iterators questions from the C++ 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.
A.an algorithm that orders a random-access range in place, typically in n-log-n comparisons using introsort
B.an inline anonymous function object with an optional capture list, enabling closures passed directly to algorithms
C.a linear-scan algorithm returning an iterator to the first element equal to a target or the end iterator when none matches
D.a facility allowing algorithms to operate on whole ranges and composable lazy views via the pipe operator
Answer + AI explanation with Pro
2. Which term means: "an algorithm that orders a random-access range in place, typically in n-log-n comparisons using introsort"?
Junior
A.Lambda expression
B.std::sort
C.std::find
D.Ranges library (C++20)
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.std::sort — an inline anonymous function object with an optional capture list, enabling closures passed directly to algorithms
B.std::sort — an algorithm that orders a random-access range in place, typically in n-log-n comparisons using introsort
C.std::sort — a linear-scan algorithm returning an iterator to the first element equal to a target or the end iterator when none matches
D.std::sort — a sentinel position one past the last element, used to denote a range's bound and a not-found result; it must never be dereferenced
Answer + AI explanation with Pro
4. What is std::find?
Junior
A.an algorithm that orders a random-access range in place, typically in n-log-n comparisons using introsort
B.an inline anonymous function object with an optional capture list, enabling closures passed directly to algorithms
C.a sentinel position one past the last element, used to denote a range's bound and a not-found result; it must never be dereferenced
D.a linear-scan algorithm returning an iterator to the first element equal to a target or the end iterator when none matches
Answer + AI explanation with Pro
5. Which term means: "a linear-scan algorithm returning an iterator to the first element equal to a target or the end iterator when none matches"?
Junior
A.std::find
B.Lambda expression
C.Ranges library (C++20)
D.std::sort
Answer + AI explanation with Pro
6. Which statement is correct?
Junior
A.std::find — an algorithm that orders a random-access range in place, typically in n-log-n comparisons using introsort
B.std::find — a facility allowing algorithms to operate on whole ranges and composable lazy views via the pipe operator
C.std::find — an inline anonymous function object with an optional capture list, enabling closures passed directly to algorithms
D.std::find — a linear-scan algorithm returning an iterator to the first element equal to a target or the end iterator when none matches
Answer + AI explanation with Pro
7. What is Lambda expression?
Junior
A.a facility allowing algorithms to operate on whole ranges and composable lazy views via the pipe operator
B.a linear-scan algorithm returning an iterator to the first element equal to a target or the end iterator when none matches
C.an inline anonymous function object with an optional capture list, enabling closures passed directly to algorithms
D.a sentinel position one past the last element, used to denote a range's bound and a not-found result; it must never be dereferenced
Answer + AI explanation with Pro
8. Which term means: "an inline anonymous function object with an optional capture list, enabling closures passed directly to algorithms"?
Junior
A.Lambda expression
B.std::find
C.End iterator
D.std::sort
Answer + AI explanation with Pro
9. Which statement is correct?
Junior
A.Lambda expression — a linear-scan algorithm returning an iterator to the first element equal to a target or the end iterator when none matches
B.Lambda expression — an inline anonymous function object with an optional capture list, enabling closures passed directly to algorithms
C.Lambda expression — a sentinel position one past the last element, used to denote a range's bound and a not-found result; it must never be dereferenced
D.Lambda expression — a facility allowing algorithms to operate on whole ranges and composable lazy views via the pipe operator
Answer + AI explanation with Pro
10. What is Ranges library (C++20)?
Senior
A.a sentinel position one past the last element, used to denote a range's bound and a not-found result; it must never be dereferenced
B.a facility allowing algorithms to operate on whole ranges and composable lazy views via the pipe operator
C.a linear-scan algorithm returning an iterator to the first element equal to a target or the end iterator when none matches
D.an inline anonymous function object with an optional capture list, enabling closures passed directly to algorithms
Answer + AI explanation with Pro
11. Which term means: "a facility allowing algorithms to operate on whole ranges and composable lazy views via the pipe operator"?
Senior
A.std::find
B.Ranges library (C++20)
C.Lambda expression
D.End iterator
Answer + AI explanation with Pro
12. Which statement is correct?
Senior
A.Ranges library (C++20) — an inline anonymous function object with an optional capture list, enabling closures passed directly to algorithms
B.Ranges library (C++20) — a facility allowing algorithms to operate on whole ranges and composable lazy views via the pipe operator
C.Ranges library (C++20) — an algorithm that orders a random-access range in place, typically in n-log-n comparisons using introsort
D.Ranges library (C++20) — a sentinel position one past the last element, used to denote a range's bound and a not-found result; it must never be dereferenced
Answer + AI explanation with Pro
13. What is End iterator?
Mid
A.a sentinel position one past the last element, used to denote a range's bound and a not-found result; it must never be dereferenced
B.a facility allowing algorithms to operate on whole ranges and composable lazy views via the pipe operator
C.an algorithm that orders a random-access range in place, typically in n-log-n comparisons using introsort
D.a linear-scan algorithm returning an iterator to the first element equal to a target or the end iterator when none matches
Answer + AI explanation with Pro
14. Which term means: "a sentinel position one past the last element, used to denote a range's bound and a not-found result; it must never be dereferenced"?
Mid
A.std::sort
B.Ranges library (C++20)
C.Lambda expression
D.End iterator
Answer + AI explanation with Pro
15. Which statement is correct?
Mid
A.End iterator — a facility allowing algorithms to operate on whole ranges and composable lazy views via the pipe operator
B.End iterator — a linear-scan algorithm returning an iterator to the first element equal to a target or the end iterator when none matches
C.End iterator — an inline anonymous function object with an optional capture list, enabling closures passed directly to algorithms
D.End iterator — a sentinel position one past the last element, used to denote a range's bound and a not-found result; it must never be dereferenced
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 STL Algorithms and Iterators question come with Pro.