🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: STL Containers: questions with answers

9 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. Which container keeps keys in sorted order?
  2. Q2. What does this print? (code)
  3. Q3. By default, priorityqueue<int gives the:
  4. Q4. What does this print? (code)
  5. Q5. What does this print? (code)
  6. Q6. Which container should you use for "undo" in a text editor, where the last action is undone first?
  7. Q7. What does this print? (code)
  8. Q8. What is a pair<string, int most often used for?
  9. Q9. Inserting at the front of a large vector with v.insert(v.begin(), x) is slow. Why?