821. All subclasses are a subtype in object-oriented programming.
False
822. When defining a subclass in python that is meant to serve as a subtype, the subtype python keyword is used.
False
823. Suppose b is a subclass of a, to invoke the __init__ method in a from b, what is the line of code you should write?
A.__init__(self)
824. What does built-in function type do in context of classes?
Determines the class name of any value
825. Which of the following is not a type of inheritance?
Double-level
826. What does built-in function help do in context of classes?
Determines class description of any built-in type
827. What does single-level inheritance mean?
A single subclass derives from a single superclass
828. Which of the following statements isn’t true?
The value of a private variable in the superclass can be changed in the subclass
829. Which of the following statements is true?
The __eq(other) method is defined in the object class
830. Method issubclass() checks if a class is a subclass of another class.
True
831. Which of the following best describes polymorphism?
Allows for objects of different types and behaviour to be treated as the same general type
832. What is the biggest reason for the use of polymorphism?
The program will have a more elegant design and will be easier to maintain and update
833. What is the use of duck typing?
Less restriction on the type values that can be passed to a given method
834. A class in which one or more methods are only implemented to raise an exception is called an abstract class.
True
835. Overriding means changing behaviour of methods of derived class methods in the base class.
False
836. Which of these is not a fundamental features of oop?
Instantiation
837. Which of the following is the most suitable definition for encapsulation?
Means of bundling instance variables and methods in order to restrict access to certain class members
838. Methods of a class that provide access to private members of the class are called as ______ and ______
Getters/setters
839. Private members of a class cannot be accessed.
False
840. The purpose of name mangling is to avoid unintentional access of private class members.
True
841. Which of the following is false about protected class members?
They can be accessed by name mangling method
842. How many except statements can a try-except block have?
More than zero
843. When will the else part of try-except-else be executed?
When no exception occurs
844. Can one block of except statements handle multiple exception?
Yes, like except typeerror, syntaxerror [,…]
845. When is the finally block executed?
Always
846. What happens when ‘1’ == 1 is executed?
We get a false
847. Which of the following is not an exception handling keyword in python?
Accept
848. Which of the following statements is true?
The standard exceptions are automatically imported into python programs
849. Which of the following is not a standard exception in python?
Assignmenterror
850. Syntax errors are also known as parsing errors.
True
851. An exception is ____________
An object
852. _______________________ exceptions are raised as a result of an error in opening a particular file.
Ioerror
853. Which of the following blocks will be executed whether an exception is thrown or not?
Finally
854. What is “hello”.replace(“l”, “e”)?
Heeeo
855. To retrieve the character at index 3 from string s=”hello” what command do we execute (multiple answers allowed)?
S.__getitem__(3)
857. To return the length of string s what command do we execute?
S.__len__()
858. To check whether string s1 contains another string s2, use ________
S1.__contains__(s2)
859. What function do you use to read a string?
Input(“enter a string”)
860. Suppose x is 345.3546, what is format(x, “10.3f”) (_ indicates space).
___345.355
861. Which of the following statements for a simple graph is correct?
Every path is a trail
862. What is a hash table?
A structure that maps keys to values
863. If several elements are competing for the same bucket in the hash table, what is it called?
Replication
864. What is direct addressing?
Distinct array position for every possible key
865. What is a hash function?
A function that computes the location of the key in the array
866. Which of the following is not a technique to avoid a collision?
Increasing hash table size
867. What is the load factor?
Average chain length
868. What is simple uniform hashing?
Every element has equal probability of hashing into any of the slots
869. In simple chaining, what data structure is appropriate?
Doubly linked list
870. A linear collection of data elements where the linear node is given by means of pointer is called?
Linked list
871. In linked list each node contains a minimum of two fields. One field is data field to store the data second field is?
Pointer to node
872. What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list?
Θ(n)
873. What would be the asymptotic time complexity to insert an element at the front of the linked list (head is known)?
O(1)
874. What would be the asymptotic time complexity to find an element in the linked list?
O(n)
875. What would be the asymptotic time complexity to insert an element at the second position in the linked list?
O(1)
876. The concatenation of two lists can be performed in o(1) time. Which of the following variation of the linked list can be used?
Circular doubly linked list
877. Which one is not a data structure?
Clrscr ()
878. Getch () is a/an
Input function
879. Float is a/an
Data type
880. String.h is a/an
Header file
881. Which one is a dcl command?
Roll back
882. Arrays may be defined with…………
Both columns and rows
883. Which one is an output function for stack?
Pop
884. Changing data type in run time mean.
Casting
885. Functions is a feature of……………..
Object oriented programming
886. Classes are source of………….
Instances of object
887. Base of binary number system is.
C.2
888. In boolean variable, a.a represent.
A
889. Which one is not a dcl command in sql?
Delete
890. Which of the following sql command used to change data?
Update
891. Which of the following is valid computer network device?
Nic
892. Which of the following will not return a value?
Void
893. Which of the following is a valid computer network application?
894. Long is a/an …?
Built in data type
895. Queue is a …?
Function
896. In which type do the enumerators are stored by the compiler.
Integer
897. Oop is based on?
Function and data
898. Pointer is a?
Variable
899. Sop stands for.
Same on product
900. Domain value is …?
Entity name
901. Pop is a …………
Function
902. Gsm is related with
C. Mobile system
903. Tera byte (tb) is unit of measurement for.
C. Computer’s memory
904. Typedef is a/an.
Keyword
905. Information security is related with …………?
Server protection
906. Sum () function returns?
Addition of number
907. Preprocessor begins with character …………
#
908. Group by clause helps to … the table data.
Group
909. Led monitor is a/an.
Output device
910. Wll stands for.
C. Wireless local loop
911. To which of these enumerators can be assigned?
Integer
912. Can two functions declare variables (non-static) with the same name?
Yes
913. The operator used for dereferencing or indirection is …
*
914. Which one of the following is not a possible state for a pointer?
Hold the address of the specific object
915. Which of the following is illegal?
String s, *sp=0;
916. What is the index number of the last element of an array with 73 elements?
72
917. How are the constants declared?
Const keyword
918. Using the wardrobe structure within the shop list structure is an example of a good programming principle, known as …
Reusability
919. When you omit parameter from a function call, value can be provided by.
Default parameters
920. The first element in a string is
The name of the string
921. Variable declared outside a block are called
global
922. The compiler converts your c++ instructions into
Object code
923. A fundamental data type such as int or double is a
Scalar type
924. The returns type you code for all constructors is …………….
No type
925. When an object-oriented program detects on error within a function, the function …..
Throws an exception
926. Using a statement at the wrong time or with an inappropriate object creates a ………
Logical error
927. When you create a derived class and instantiate an object then …
The parent class object must be constructed first.
928. A normal c++ operator that acts in special ways on newly defined data types is said to be…………….,
Overloaded
929. A function in a derived class that has the same name as a function in the parent class, then it will …………….
Will override the base class function.
930. A constructor always has,
Temporal cohesion
931. Binary trees with threads are called as ………….
Threaded trees
932. In binary trees nodes with no successor are called ……….
Terminal nodes
933. Every node n in a binary tree t except the root has a unique parent called the …… of n.
predecessor
934. The in order traversal of tree will yield a sorted listing of elements of tree is ………… a
Binary search trees
935. The post order traversal of a binary tree is debfca. Find out the pre order traversal.
Abdecf
936. A technique for direct search
hashing
937. A full binary tree with 2n + 1 nodes contain.
N non-leaf nodes
938. To include integrity constraint in an existing relation use:
C. Alter table
939. Which of the following is not an integrity constraint?
Positive
940. When grouping cells within a k-map, the cells must be combined in groups of …………….
1, 2, 4, 8, etc.
941. The nand or nor gates are referred to as “universal” gates because any one:
Can be used to build all the other types of gates.
942. Why ip protocol is considered as unreliable?
All of the above
943. What is www.mail.yahoo.com
file
944. What is the full form of raid?
Redundant array of independent disks.
945. Which of the following type of class allows only one object of it to be created?
Singleton class
946. Which of the following is not a type of constructor?
Friend constructor
947. Which of the following is not the member of class?
Friend function
948. Which of the following concepts means determining at runtime what method to invoke?
Dynamic binding
949. Which of the following term is used for a function defined inside a class?
Member function
950. Which of the following concept of oops allows compiler to insert arguments in a function call if it is not specified?
Default arguments
951. How many instances of an abstract class can be created?
0
952. Which of the following cannot be friend?
Object
953. Which of the following concepts of oops means exposing only necessary information to client?
Data hiding
954. Why reference is not same as a pointer?
A reference can never be null.
A reference once established cannot be changed.
Reference does not need an explicit dereferencing mechanism.
955. Cout is a/an __________ .
Object
956. Which of the following concepts provides facility of using object of one class inside another class?
Inheritance
958. How many types of polymorphisms are supported by c++?
2
959. Which of the following is an abstract data type?
Class
960. Which of the following correctly describes overloading of functions?
Ad-hoc polymorphism
961. Which of the following is correct about function overloading?
The types of arguments are different.
The order of argument is different.
Both a and b.
963. Which of the following is correct about class and structure?
Class data members are private by default while that of structure are public by default.
964. Which of the following concepts means wrapping up of data and functions together?
Encapsulation
965. Which of the following concepts means waiting until runtime to determine which function to call?
Dynamic binding
966. How “late binding” is implemented in c++?
Using virtual tables
967. Which of the following is the correct class of the object cout?
Ostream
968. Which of the following cannot be used with the keyword virtual?
Constructor
969. Which of the following functions are performed by a constructor?
]initialize objects
970. Which of the following problem causes an exception?
A run-time error.
971. Which one of the following options is correct about the statement given below? The compiler checks the type of reference in the object and not the type of object.
Polymorphism
972. Which of the following concepts is used to implement late binding?
Virtual function
973. Which of the following factors supports the statement that reusability is a desirable feature of a language?
It decreases the testing time.
It lowers the maintenance cost.
974. Which of the following ways are legal to access a class data member using this pointer?
This->x
975. Which of the following is a mechanism of static polymorphism?
Operator overloading
Function overloading
Templates
978. What happens if the base and derived class contains definition of a function with same prototype?
Base class object will call base class function and derived class object will call derived class function.
980. Which of the following are available only in the class hierarchy chain?
Protected data members
982. Which of the following is not a type of inheritance?
Distributive
984. Which of the following operators cannot be overloaded?
?:
986. In which of the following a virtual call is resolved at the time of compilation?
From inside the destructor.
From inside the constructor.
987. Which of the following statements regarding inline functions is correct?
It speeds up execution.
It increases the code size.
988. Which one of the following is the correct way to declare a pure virtual function?
Virtual void display(voi= 0;
989. Which of the following header file includes definition of cin and cout?
Iostream.h
990. Which of the following keyword is used to overload an operator?
Operator
991. What will happen if a class is not having any name?
It cannot have a destructor.
It cannot have a constructor.
992. Which inheritance type is used in the class given below?
Class a : public x, public y
{}
Multiple inheritance
993. Which of the following is an invalid visibility label while inheriting a class?
Friend
994. Which one of the following options is correct?
Friend function can access public data members of the class.
Friend function can access protected data members of the class.
Friend function can access private data members of the class.
995. Which of the following statements is correct in c++?
Structures can have functions as members.
996. Which of the following is used to make an abstract class?
Making at least one member function as pure virtual function.
997. Which of the following access specifier is used as a default in a class definition?
Private
998. What is correct about the static data member of a class?
A static member function can access only static data members of a class.
A static data member is shared among all the object of the class.
999. Which of the following provides a reuse mechanism?
Inheritance
1000. Which of the following statement is correct?
Object is an instance of a class.