TestM Software Engineer Apptitude Tests

 

C++ Test Score: %

Corrected Answers appear
here

  ò

1. The C++ language
a. is derived from C
b. is vaguely similar to C
c. is the basis for the C language
d. has no relation to C

 

2. The name 'cout'
a. is part of the printf statement
b. represents the standard output stream
c. has nothing to do with output
d. is a abbreviation for calling timeout in C++

 

3. The following is true of C++:
a.   Every function requires a prototype
b.   Function prototypes can list default values
c.   Variables can be declared anywhere in a block
d.   All of the above are true
e.   Only a and b is true
f.   None of the above is true

 

4. The scope resolution operator
a. is used in C
b. provides access to global variables
c. provides access to variables within local scope
d. none of the above

 

5. In C++,'const' declarations
cannot be place in header files
are defined with #define
are generally illegal
are constant linkers

 

6. Inline functions
a. are defined with the inline keyword
b. have advantages over macros
c. contain few lines of code
d. all of the above

 

7. In C++, declrations of instances of an enumeration
a. must include the enum keyword
b. do not need the enum keyword
c. none of the above

 

8. Overloaded functions
a. are allowed in both C and C++
b. are mulitiple functions with the same name
c. can differ in return type alone
d. all of the above

 

9. A C++ reference variable
a. can be pointed to
b. cannot be modified
c. compared to another reference variable
d. all of the above

 

10. A class declaration
a. looks similar to a structure declaration
b. preceeds member function definitions
c. may contain the private keyword
d. All of the above


11. Private class members
a. can be accessed by derived classes
b. can be accessed by global functions
c. can be accessed by friend classes
d. None of the above

 

12. A constructor
a. is called whenever a class object is created
b. can contain an argument list
c. All of the above

 

13. A destructor
a. is accidental prone
b. cannot  be declared virtual
c. can be overloaded
d. none of the above

 

14 Access functions
a. are used to acccess public data members
b. are used to access private data members
c. are rarely inline
d. all of the above

 

15. A class's interface
a. has private visability
b. is the same as a class's implementation
c. refers to what a class can do
d. concentrates on operation details
e. None of the above

 

16. Const member functions
a. allow modification of data members
b. can be safely called for a const object
c. prohibit the modification of global data
d. None of the above

 

17. Composition refers to
a. other objects as members
b. being a 'kind of'
c. being a writable object

 

18. The 'new' operator
a. allocates memory from the stack
b. allocates memory from the free store
c. is used in C as well as malloc
d. none of the above

 

19. The operator= name
a. is used to operate on assignments
b. is used to overload the assignment operator
c. is used by the copy constructor
d. all of the above

 

20. The copy constructor
a. is a constructor with no arguments
b. must check against self assignment
c. must return *this
d. All of the above
e. None of the above

 

21. An abstract class
a. contains a pure virtual function
b. contains an abstract constructor
c. is related to an empty class
d. none of the above

 

22. Static data members
a. are global
b. must be initialized at file scope
c. are initialized in the constructor
d. None of the above

 

23.Static member functions
a. can access any data member
b. are generally inline
c. enable static binding
d. none of the above

 

24. Friend classes
a. offer friend type scope
b. can access another classes private data
c. can access only protected friend functions
d. None of the above

 

25. Polymorphism
a. refers to specific types
b. refers to handling of related types together
c. s used in conjunction with composition
d. None of the above

 

26.A pure virtual function
a. is found in concrete classes
b. must be defined in derived classes
c. allows for virtual base classes
d. All of the above

 

27. Virtual destructors
a. are declared in base classes
b. ensure a derived classes destructor is called
c. can do nothing
d. All of the above

 

28. Protected data members
a. are accessible to friend classes only
b. are not accessible by derived classes
c. have the same visibility as static members
d. none of the above

 

29. Private base class's public members
a. are inherited as private
b. are inherited as public
c. are not accessible to derived classes
d. None of the above

 

30.Default copy constructors
a. can have an argument list
b. cannot have an argument list
c. are used in conjunction with composition
d. None of the above

 

31. For a class to be 'defined'
a. it also must have member functions defined
b. it's member functions need not be defined
c. it's pure virtual functions must be defined
d. None of the above

 

32. Empy classes
a. have 0 size.
b. are the same as anonymous classes
c. cannot have member functions
d. None of the above

 

33. Member declarators
a. are never static
b. are typically public
c. cannot contain initializers
d. All of the above

 

34. The 'this' pointer
a. is a reference to itself
b. is self contained
c. is non modifiable
d. None of the above

 

         

 

 

Copyright © 1998-2000 Strategic Concepts & Innovations, Inc.
For problems or questions regarding this web contact mailto:[ProjectEmail].
Last updated: April 06, 2000.