Computer Science MCQs · Cloud Computing What is the primary function of a content delivery network? A Providing virtual machines on demand B Caching content at edge sites near users Correct answer C Encrypting traffic between data centres D Balancing writes across database replicas MCQSEXAM Show answer Read explanation
Computer Science MCQs · Cloud Computing What does multi-tenancy mean for a cloud service? A One customer uses several providers B Several operating systems run on a host C Data is copied to several regions D Several customers share provider resources Correct answer MCQSEXAM Show answer Read explanation
Computer Science MCQs · Cloud Computing What does horizontal scaling involve? A Adding more CPU and memory to a host B Moving data nearer to the users C Removing availability zones D Adding more instances to a pool Correct answer MCQSEXAM Show answer Read explanation
Computer Science MCQs · Cloud Computing Which storage model suits millions of unstructured objects retrieved by key? A Object storage Correct answer B Block storage C Local ephemeral disk D A relational database MCQSEXAM Show answer Read explanation
Computer Science MCQs · Cloud Computing What is auto-scaling designed to do? A Move workloads between providers B Match resource capacity to current demand Correct answer C Reduce the number of cloud regions used D Encrypt data automatically at rest MCQSEXAM Show answer Read explanation
Computer Science MCQs · Cloud Computing In the IaaS service model, what does the customer manage? A The hypervisor and its host kernel B Operating systems and applications Correct answer C Only the application source code D Physical servers and the network fabric MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming What does this program print? struct A { A() { cout << 1; } ~A() { cout << 2; } }; int main() { A a; }. A 12 Correct answer B 21 C 1 D 2 MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming Which property belongs to std::unique_ptr? A Automatic conversion to a raw pointer B Storage of objects without a deleter C Exclusive ownership that cannot be copied Correct answer D Shared ownership counted per object MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming A class becomes abstract in C++ when it does which of these? A Declares at least one pure virtual function Correct answer B Keeps all data members private C Provides no user-defined constructor D Inherits privately from another class MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming Which iterator category does std::sort require? A Bidirectional iterators B Input iterators alone C Random-access iterators Correct answer D Forward iterators only MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming Which problem does a virtual base class address? A Duplicate base subobjects in diamond inheritance Correct answer B Virtual calls made on const objects C Leaks caused by missing virtual destructors D Ambiguity between overloaded operators MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming Which rule applies to a C++ reference variable? A It can safely hold a null value B It occupies no storage whatsoever C It must be initialised when declared Correct answer D It may be rebound to another object MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming How does operator>> on std::cin treat whitespace by default? A It reads a whole line including spaces B It refuses input containing spaces C It skips leading whitespace before reading Correct answer D It keeps leading whitespace as data MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming What is the effect of writing override after a member function declaration? A The function is inlined at every call site B The compiler verifies it overrides a base method Correct answer C The base version is removed from the vtable D Subclasses may no longer override it MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming When is a copy constructor invoked? A When a static member is assigned B When an object initialises another of its type Correct answer C When a class declares a new object D When a virtual call is made on an object MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming Which statement about a static member function is true? A It may read any non-static member B It must be called through an object C It is copied once per object D It has no this pointer at all Correct answer MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming Which task does new perform that malloc does not? A It gives back a void pointer B It never reports failure C It allocates memory on the stack D It runs the object's constructor Correct answer MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming What does a trailing const on a member function mean? A It must be evaluated at compile time B It promises not to modify the object Correct answer C It returns a constant value D It can be called only one time MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming Which standard container gives average constant-time lookup by key? A std::list B std::unordered_map Correct answer C std::map D std::vector MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming What relationship does public inheritance normally express? A A has-a relationship between the classes B A uses-a relationship between the classes C A part-of relationship between the classes D An is-a relationship between the classes Correct answer MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming What happens when a derived object is copied into a base class object? A The derived part is sliced away Correct answer B The base part is discarded C The copy keeps both dynamic parts D The compiler rejects the copy MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming Why should a base class used polymorphically have a virtual destructor? A So derived classes skip the base destructor B So the object is reclaimed by a collector C So deleting through a base pointer is complete Correct answer D So the destructor may be called twice MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming In what order are automatic objects of the same block destroyed? A Reverse of their construction order Correct answer B Same as their construction order C In alphabetical order of names D In an order chosen by the linker MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming What is the average complexity of push_back on std::vector? A Amortised constant time Correct answer B Logarithmic in the size C Linear in the size every time D Quadratic in the size MCQSEXAM Show answer Read explanation
Computer Science MCQs · C++ and Object-Oriented Programming When does a constructor run for an automatic object? A When the object is first read from B When the enclosing scope ends C Only when new is used to create it D When the object comes into existence Correct answer MCQSEXAM Show answer Read explanation