This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Which of these is not a correct statement?(a) A recursive method must have a base case(b) Recursion always uses stack(c) Recursion is always managed by C# Runtime environment(d) Recursive methods are faster that programmer written loop to call the function repeatedly using a stackI got this question during an interview for a job.My query is from Recursion topic in portion Object Oriented Concepts of C# |
|
Answer» CORRECT choice is (C) Recursion is always managed by C# Runtime environment Explanation: No matter whatever is the PROGRAMMING language recursion is always managed by the OPERATING system. |
|
| 2. |
Which of these will happen if the recursive method does not have a base case?(a) Infinite loop condition occurrence(b) System gets hanged(c) After 10000 executions program will be automatically stopped(d) None of the mentionedThis question was addressed to me in an internship interview.This interesting question is from Recursion topic in chapter Object Oriented Concepts of C# |
|
Answer» The correct OPTION is (a) Infinite loop CONDITION occurrence |
|
| 3. |
What is Recursion in CSharp defined as?(a) Recursion is another form of class(b) Recursion is another process of defining a method that calls other methods repeatedly(c) Recursion is a process of defining a method that calls itself repeatedly(d) Recursion is a process of defining a method that calls other methods which in turn calls this methodThis question was posed to me in an online interview.My question is from Recursion topic in division Object Oriented Concepts of C# |
|
Answer» RIGHT answer is (c) Recursion is a process of defining a method that CALLS itself repeatedly Best explanation: Recursion is the process of defining something in terms of itself. It allows us to define method that calls itself repeatedly until it MEETS some BASE case condition. |
|
| 4. |
Choose the wrong statement from the given set of statements?(a) All operators in C#.NET cannot be overloaded(b) We can use the new modifier to modify a nested type if the nested type is hiding another type(c) Operator overloading permits the use of symbols to represent computations for a type(d) In case of operator overloading all parameters must be of different type than the class or struct that declares the operatorsI got this question in an online interview.I'd like to ask this question from Introduction of Overloaded Operators topic in division Object Oriented Concepts of C# |
|
Answer» Correct option is (d) In case of OPERATOR OVERLOADING all PARAMETERS must be of DIFFERENT type than the class or struct that declares the operators |
|
| 5. |
What is the vector in operator overloading?(a) class(b) method()(c) data type(d) none of the mentionedI have been asked this question in an interview for job.I would like to ask this question from Introduction of Overloaded Operators in portion Object Oriented Concepts of C# |
|
Answer» Correct option is (c) DATA type |
|
| 6. |
Choose the correct statement among the below mentioned statements.(a) Forgetting to declare an operator method as public(b) Forgetting to declare an operator method as static(c) Forgetting to return a bool type value while overloading a relational operator(d) All of the mentionedI had been asked this question during an online interview.My query is from Introduction of Overloaded Operators topic in portion Object Oriented Concepts of C# |
|
Answer» RIGHT ANSWER is (d) All of the mentioned Explanation: NONE |
|
| 7. |
Correct method to define + operator is?(a) public sample operator +(int a, int b)(b) public abstract operator +(int a, int b)(c) public static sample operator+(int a, int b)(d) public abstract sample operator +(int a, int b)This question was addressed to me in an online quiz.Query is from Introduction of Overloaded Operators topic in division Object Oriented Concepts of C# |
|
Answer» The CORRECT choice is (C) PUBLIC static SAMPLE operator+(int a, int b) |
|
| 8. |
Which of the following statements are correct in nature?(a) The conditional logical operators cannot be overloaded(b) The array indexing operator can be overloaded(c) A public or nested public preference type does not overload the equality operator(d) None of the mentionedI have been asked this question in an interview for job.Asked question is from Introduction of Overloaded Operators in division Object Oriented Concepts of C# |
|
Answer» The CORRECT CHOICE is (a) The CONDITIONAL logical operators cannot be overloaded |
|
| 9. |
Which of the following keyword is used to overload user defined types by defining static member functions?(a) op(b) opoverload(c) operator(d) operatoroverloadI had been asked this question during a job interview.This is a very interesting question from Introduction of Overloaded Operators in division Object Oriented Concepts of C# |
|
Answer» CORRECT CHOICE is (C) operator To EXPLAIN: NONE. |
|
| 10. |
Access specifiers which can be used for an interface are?(a) Public(b) Protected(c) Private(d) All of the mentionedThis question was addressed to me in homework.The above asked question is from Interfaces Introduction in portion Object Oriented Concepts of C# |
|
Answer» Correct choice is (a) PUBLIC |
|
| 11. |
Which of these can be used to fully abstract a class from its implementation?(a) Objects(b) Packages(c) Interfaces(d) None of the MentionedI had been asked this question in quiz.My enquiry is from Interfaces Introduction in chapter Object Oriented Concepts of C# |
|
Answer» The CORRECT ANSWER is (C) Interfaces |
|
| 12. |
Which keyword is used for correct implementation of an interface in C#.NET?(a) interface(b) Interface(c) intf(d) IntfThe question was posed to me during an online exam.Query is from Interfaces Introduction in section Object Oriented Concepts of C# |
|
Answer» RIGHT OPTION is (a) interface Easiest EXPLANATION - NONE. |
|
| 13. |
Select the correct statement among the given statements?(a) One class could implement only one interface(b) Properties could be declared inside an interface(c) Interfaces cannot be inherited(d) None of the mentionedI have been asked this question by my school teacher while I was bunking the class.The origin of the question is Interfaces Introduction in division Object Oriented Concepts of C# |
|
Answer» Correct ANSWER is (b) Properties COULD be declared inside an interface |
|
| 14. |
Which of the following statements correctly define about the implementation of interface?(a) The calls to implementation of interface methods are routed through a method table(b) A class which implements an interface can explicitly implement members of that interface(c) One interface can be implemented in another interface(d) None of the mentionedI have been asked this question in an interview for job.The doubt is from Interfaces Introduction in section Object Oriented Concepts of C# |
|
Answer» Right answer is (a) The CALLS to IMPLEMENTATION of interface METHODS are ROUTED through a method table |
|
| 15. |
A class consists of two interfaces with each interface consisting of three methods. The class had no instance data. Which of the following indicates the correct size of object created from this class?(a) 12 bytes(b) 16 bytes(c) 0 bytes(d) 24 bytesI have been asked this question in homework.This interesting question is from Interfaces Introduction in section Object Oriented Concepts of C# |
|
Answer» The CORRECT option is (d) 24 bytes |
|
| 16. |
Which of the following cannot be used to declare an interface correctly?(a) Properties(b) Methods(c) Structures(d) EventsThe question was posed to me during an interview.My doubt is from Interfaces Introduction in section Object Oriented Concepts of C# |
|
Answer» RIGHT OPTION is (C) Structures To EXPLAIN: NONE. |
|
| 17. |
Which statement correctly defines Interfaces in C#.NET?(a) Interfaces cannot be inherited(b) Interfaces consists of data static in nature and static methods(c) Interfaces consists of only method declaration(d) None of the mentionedThe question was posed to me during an online exam.I would like to ask this question from Interfaces Introduction topic in section Object Oriented Concepts of C# |
|
Answer» The correct option is (d) NONE of the mentioned |
|
| 18. |
The modifier used to hide the base class methods is?(a) Virtual(b) New(c) Override(d) SealedI have been asked this question in an international level competition.This interesting question is from Method Overriding topic in portion Object Oriented Concepts of C# |
|
Answer» Right OPTION is (b) New |
|
| 19. |
Which of the following cannot be used to declare a class as a virtual?(a) Methods(b) Properties(c) Events(d) FieldsI had been asked this question in class test.The query is from Method Overriding in chapter Object Oriented Concepts of C# |
|
Answer» RIGHT CHOICE is (d) Fields To EXPLAIN: NONE. |
|
| 20. |
Select the correct statement from the following?(a) Static methods can be a virtual method(b) Abstract methods can be a virtual method(c) When overriding a method, the names and type signatures of the override method must be the same as the virtual method that is being overridden(d) We can override virtual as well as nonvirtual methodsI have been asked this question in a job interview.This interesting question is from Method Overriding topic in portion Object Oriented Concepts of C# |
|
Answer» CORRECT answer is (C) When overriding a method, the names and TYPE signatures of the OVERRIDE method MUST be the same as the virtual method that is being overridden Easy explanation - None. |
|
| 21. |
Which of the given modifiers can be used to prevent Method overriding?(a) Static(b) Constant(c) Sealed(d) finalThe question was asked in exam.My question is based upon Method Overriding topic in section Object Oriented Concepts of C# |
|
Answer» CORRECT option is (c) Sealed Easy explanation - When an instance method declaration includes the sealed MODIFIER, the method is said to be sealed method. It means a DERIVED CLASS cannot OVERRIDE this method. |
|
| 22. |
The process of defining a method in a subclass having same name & type signature as a method in its superclass is known as?(a) Method overloading(b) Method overriding(c) Method hiding(d) None of the mentionedThe question was asked by my school principal while I was bunking the class.The doubt is from Method Overriding in section Object Oriented Concepts of C# |
|
Answer» CORRECT answer is (b) METHOD overriding Best EXPLANATION: None. |
|
| 23. |
Which keyword is used to declare a base class method while performing overriding of base class methods?(a) this(b) virtual(c) override(d) extendI had been asked this question in an international level competition.The origin of the question is Method Overriding in chapter Object Oriented Concepts of C# |
|
Answer» CORRECT CHOICE is (B) virtual The EXPLANATION is: NONE. |
|
| 24. |
Which form of inheritance is not supported directly by C# .NET?(a) Multiple inheritance(b) Multilevel inheritance(c) Single inheritance(d) Hierarchical inheritanceThe question was posed to me in an interview for job.The doubt is from Fundamentals of Inheritance in chapter Object Oriented Concepts of C# |
|
Answer» CORRECT choice is (a) Multiple inheritance Easy explanation - Supported in FORM of INTERFACES in secondary form. |
|
| 25. |
Given class sample is inherited by class sample 1. Which are the correct statements about construction of object of class sample?(a) While creating the object firstly the constructor of class sample will be called followed by constructor of class sample 1(b) The constructor of only sample class will be called(c) While creating the object firstly constructor of class sample 1 will be called followed by constructor of class sample(d) The order of calling constructors depend on whether constructors in class sample and sample 1 are private or publicI got this question during a job interview.The above asked question is from Fundamentals of Inheritance topic in division Object Oriented Concepts of C# |
|
Answer» The CORRECT option is (c) While creating the OBJECT firstly constructor of class sample 1 will be called followed by constructor of class sample |
|
| 26. |
Which is the correct way to create an object of the given class abc?(a) Declaringexistingclass as sealed(b) Declaringexisting class as override(c) Declaring existing class as overloads(d) Declaring existing class as shadowsThe question was posed to me in semester exam.This is a very interesting question from Fundamentals of Inheritance in chapter Object Oriented Concepts of C# |
|
Answer» The CORRECT ANSWER is (a) DECLARINGEXISTINGCLASS as sealed |
|
| 27. |
If base class consist of two private integers, one static integer and derived class consist of two static integers and one private integer. What would be the size of derived class object?(a) size of object depends on sizes of its non static data members(b) size of a derived class object is sum of sizes of non static data members of base class and derived class(c) size of object is calculated using sizeof() method(d) none of the mentionedI have been asked this question in a national level competition.Asked question is from Fundamentals of Inheritance topic in portion Object Oriented Concepts of C# |
|
Answer» Correct OPTION is (a) size of OBJECT depends on SIZES of its non STATIC DATA members |
|
| 28. |
Which statements among following are correct?(a) We can derive a class from a base class even if source code of base class not available(b) Multiple inheritance is different from multiple levels of inheritance(c) It is legal to make objects of one class as members of another class(d) All of the mentionedThe question was posed to me during an online exam.Question is taken from Fundamentals of Inheritance in chapter Object Oriented Concepts of C# |
|
Answer» The CORRECT CHOICE is (d) All of the mentioned |
|
| 29. |
Which of the following functionality is facilitated by inheritance mechanism?(a) Use the existing functionality of base class(b) Override the existing functionality of base class(c) Implements new functionality in derived class(d) All of the mentionedThis question was addressed to me in semester exam.The doubt is from Fundamentals of Inheritance in portion Object Oriented Concepts of C# |
|
Answer» RIGHT CHOICE is (d) All of the mentioned Best EXPLANATION: NONE. |
|
| 30. |
A class member declared protected becomes member of subclass of which type?(a) public member(b) private member(c) protected member(d) static memberI had been asked this question during an online exam.I'd like to ask this question from Fundamentals of Inheritance in division Object Oriented Concepts of C# |
|
Answer» The correct OPTION is (d) static MEMBER |
|
| 31. |
Wrong statement about inheritance in C# .NET?(a) In inheritance chain, object construction begins from base class towards derived class(b) Inheritance cannot extend base class functionality(c) A derived class object contains all base class data(d) All of the mentionedThis question was addressed to me in homework.This interesting question is from Fundamentals of Inheritance topic in division Object Oriented Concepts of C# |
|
Answer» CORRECT answer is (b) INHERITANCE cannot EXTEND base class functionality Explanation: NONE. |
|
| 32. |
In Inheritance concept, which of the following members of base class are accessible to derived class members?(a) static(b) protected(c) private(d) sharedThe question was posed to me in an internship interview.This intriguing question originated from Fundamentals of Inheritance topic in portion Object Oriented Concepts of C# |
|
Answer» CORRECT OPTION is (B) protected To EXPLAIN: NONE. |
|
| 33. |
Select the class visibility modifiers among the following:(a) Private, protected, public, internal(b) Private, protected, public, internal, protected internal(c) Private, protected, public(d) All of the mentionedI have been asked this question during an interview.I'd like to ask this question from Fundamentals of Inheritance in portion Object Oriented Concepts of C# |
|
Answer» RIGHT ANSWER is (b) PRIVATE, protected, public, INTERNAL, protected internal The best I can explain: None. |
|
| 34. |
In an inheritance chain through which of the following, the base class and its components are accessible to the derived class?(a) Scope resolution operator(:)(b) Class visibility modifiers (public,private etc.)(c) Dot operator (.)(d) All of the mentionedThis question was addressed to me in unit test.The question is from Fundamentals of Inheritance topic in section Object Oriented Concepts of C# |
|
Answer» Correct CHOICE is (B) Class visibility modifiers (PUBLIC,private etc.) |
|
| 35. |
The number of levels of inheritance are?(a) 5(b) 4(c) 3(d) 2This question was posed to me in an interview.This key question is from Fundamentals of Inheritance in division Object Oriented Concepts of C# |
|
Answer» CORRECT OPTION is (B) 4 Easiest EXPLANATION - NONE. |
|
| 36. |
Which procedure among the following should be used to implement a ‘Has a’or a ‘Kind of’ relationship between two entities?(a) Polymorphism(b) Inheritance(c) Templates(d) All of the mentionedI had been asked this question in class test.My enquiry is from Fundamentals of Inheritance topic in division Object Oriented Concepts of C# |
|
Answer» The CORRECT ANSWER is (B) Inheritance |
|
| 37. |
Choose the correct statement about enum used in C#.NET?(a) By default the first enumerator has a value equal to the number of elements present in the list(b) Values of the enum elements cannot be populated from database(c) The value of each successive enumerator is decreased by 1(d) An enumerator has a white space in its nameThe question was asked by my school teacher while I was bunking the class.I'm obligated to ask this question of Enumerations topic in chapter Object Oriented Concepts of C# |
|
Answer» CORRECT answer is (B) VALUES of the ENUM elements cannot be POPULATED from database The best explanation: None. |
|
| 38. |
Wrong statement about enum used in C#.NET is?(a) An enum can be declared inside a class(b) An object cannot be assigned to an enum variable(c) An enum can be declared outside a class(d) An enum can have Single and Double valuesThe question was posed to me during an interview.My question is from Enumerations topic in division Object Oriented Concepts of C# |
|
Answer» Correct OPTION is (d) An enum can have SINGLE and Double values |
|
| 39. |
Which among the following cannot be used as a datatype for an enum in C#.NET?(a) short(b) double(c) int(d) all of the mentionedThe question was posed to me in an interview for internship.My question is taken from Enumerations topic in portion Object Oriented Concepts of C# |
|
Answer» Right OPTION is (b) double |
|
| 40. |
Choose the correct statements about enum used in C#.NET?(a) An enum variable cannot have a private access modifier(b) An enum variable can be defined inside a class or a namespace(c) An enum variable cannot have a protected access modifier(d) An enum variable cannot have a public access modifierThis question was posed to me by my school principal while I was bunking the class.This key question is from Enumerations topic in chapter Object Oriented Concepts of C# |
|
Answer» RIGHT option is (c) An enum VARIABLE cannot have a PROTECTED access modifier For explanation: NONE. |
|