15 real STL Algorithms and Iterators questions from the C++ bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.
1. What is std::sort?
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 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
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
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
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"?
Answers, AI explanations, and a scored voice mock interview
Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.