1. Home
  2. Daily quiz
  3. Computer Science MCQs

Computer Science MCQs daily quiz

Ten fresh MCQs, the same for everyone today. Pick an answer for each question, see your score and challenge your friends.

2 December 2026 10 questions about 5 minutes Next quiz in —

Choose your quiz

Now playing: Computer Science MCQs 45 subjects have their own daily quiz

Topics in this quiz

7 topics
Score0 / 10
Answered0 / 10

class D : public A, public B { Mem1 m1; Mem2 m2; public: D() : m2(2), m1(1), B(), A() {} }; In what order are bases and members initialised, and destroyed?

  1. m2, m1, B, A for initialisation, matching the initialiser list
  2. m1, m2, A, B for initialisation and A, B, m1, m2 for destruction
  3. A, B, m1, m2 for initialisation and the same order for destruction
  4. A, B, m1, m2 for initialisation and m2, m1, B, A for destruction Correct answer
MCQSEXAM Read explanation

Why does the standard library declare getchar to return int rather than char?

  1. Because the function reports read errors by returning a negative byte count
  2. So the out-of-band EOF value cannot be confused with any valid character code Correct answer
  3. Because a returned character may be a multi-byte sequence that is wider than 8 bits
  4. Because plain char is unsigned on most targets, which would otherwise discard the sign
MCQSEXAM Read explanation

Why does the copy-and-swap assignment operator provide the strong exception guarantee?

  1. Swapping uses move assignment, which the standard requires to be noexcept
  2. The old state is replaced only after the copy has been fully constructed Correct answer
  3. The copy constructor cannot throw once the source object has been locked
  4. It avoids allocating memory, so no allocation failure can occur at all
MCQSEXAM Read explanation

A table is written with 10 items per second, each item 6 KB in size. How many write capacity units are needed?

  1. 10, because DynamoDB charges one write unit per item regardless of the individual item size
  2. 30, because each item rounds up to three units and the remaining size is ignored here
  3. 120, because writes are billed twice over when the table uses eventual consistency
  4. 60, because each 6 KB item consumes six write units and ten are written per second Correct answer
MCQSEXAM Read explanation

Computer Science MCQs topics

24 topics. Open one to practise all of its MCQs.