InterviewSolution
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. |
Can we use linq to query against a DataTable?(a) Yes(b) No(c) Either Yes or No(d) None of the mentionedI got this question during an interview.My query is from Fundamental of LINQ in portion Delegates, Generics and LINQ of C# |
|
Answer» Correct option is (b) No |
|
| 2. |
Choose the namespace in which the interface IEnumerable is declared?(a) System.Collections(b) System.Collections.Generic(c) Both System.Collections & System.Collections.Generic(d) None of the mentionedThe question was asked in a job interview.My question is from Fundamental of LINQ topic in chapter Delegates, Generics and LINQ of C# |
|
Answer» CORRECT CHOICE is (b) System.Collections.Generic The BEST I can explain: By definition. |
|
| 3. |
Choose the wrong statement about the LINQ?(a) The main concept behind the linq is query(b) linq makes use of foreach loop to execute the query(c) It is not required that linq should make use of IEnumerable interface(d) None of the mentionedThis question was posed to me in homework.This interesting question is from Fundamental of LINQ topic in chapter Delegates, Generics and LINQ of C# |
|
Answer» Correct choice is (c) It is not required that linq should make use of IEnumerable interface |
|
| 4. |
Assume 2 columns named as Product and Category how can be both sorted out based on first by category and then by product name?(a) var sortedProds = _db.Products.Orderby(c => c.Category)(b) var sortedProds = _db.Products.Orderby(c => c.Category) + ThenBy(n => n.Name)(c) var sortedProds = _db.Products.Orderby(c => c.Category) . ThenBy(n => n.Name)(d) all of the mentionedThis question was posed to me by my school principal while I was bunking the class.Question is taken from Fundamental of LINQ in division Delegates, Generics and LINQ of C# |
|
Answer» RIGHT CHOICE is (c) var sortedProds = _db.Products.Orderby(c => c.Category) . ThenBy(N => n.Name) BEST EXPLANATION: var sortedProds = _db.Products.Orderby(c => c.Category) . ThenBy(n => n.Name). |
|
| 5. |
Which of the given statements are valid about generics in .NET Framework?(a) generics are useful in collection classes in .NET framework(b) generics delegates are not allowed in C#.NET(c) generics is a not language feature(d) all of the mentionedThe question was posed to me during an internship interview.This question is from Generic Methods topic in section Delegates, Generics and LINQ of C# |
|
Answer» RIGHT option is (a) generics are USEFUL in collection classes in .NET framework For explanation: NONE. |
|
| 6. |
Choose the advantages of using generics?(a) Generics facilitate type safety(b) Generics facilitate improved performance and reduced code(c) Generics promote the usage of parameterized types(d) All of the mentionedThe question was posed to me in an online quiz.Question is from Fundamental of Generics topic in portion Delegates, Generics and LINQ of C# |
|
Answer» CORRECT ANSWER is (d) All of the mentioned Best EXPLANATION: By DEFINITION of GENERICS. |
|
| 7. |
Are generics in C# are same as the generics in java and templates in C++?(a) Yes(b) No(c) May be(d) None of the mentionedThe question was posed to me by my school principal while I was bunking the class.Origin of the question is Fundamental of Generics topic in division Delegates, Generics and LINQ of C# |
|
Answer» CORRECT answer is (b) No The best explanation: Although C# generics are similar to templates in C++ and generics in Java, they are not the same as either. In fact, there are some fundamental DIFFERENCES AMONG these THREE approaches to generics. |
|
| 8. |
What is meant by the term generics?(a) parameterized types(b) class(c) structure(d) interfaceThis question was posed to me by my school teacher while I was bunking the class.Enquiry is from Fundamental of Generics in division Delegates, Generics and LINQ of C# |
|
Answer» Right OPTION is (a) parameterized types |
|
| 9. |
Select the modifiers which control the accessibility of the delegate?(a) new(b) protected(c) public(d) all of the mentionedThe question was asked in an interview for job.This intriguing question comes from Delegates in Detail in division Delegates, Generics and LINQ of C# |
|
Answer» RIGHT ANSWER is (d) all of the mentioned Explanation: By DEFINITION |
|
| 10. |
Incorrect statements about delegates are?(a) Delegates are reference types(b) Delegates are object oriented(c) Delegates are type safe(d) Only one method can be called using a delegateThe question was asked in a national level competition.Asked question is from Delegates in Detail in section Delegates, Generics and LINQ of C# |
|
Answer» Correct ANSWER is (d) Only one method can be CALLED using a delegate |
|
| 11. |
Which of the following are the correct statements about delegates?(a) Delegates can be used to implement callback notification(b) Delegates permit execution of a method on a secondary thread in an asynchronous manner(c) Delegate is a user defined type(d) All of the mentionedI have been asked this question by my school principal while I was bunking the class.This intriguing question comes from Delegates in Detail topic in chapter Delegates, Generics and LINQ of C# |
|
Answer» The CORRECT OPTION is (d) All of the mentioned |
|
| 12. |
Choose the incorrect statement about delegates?(a) delegates are not type safe(b) delegates can be used to implement callback notification(c) delegate is a user defined type(d) delegates permits execution of a method in an asynchronous mannerThe question was asked in an international level competition.My question is from Fundamental of Delegates in chapter Delegates, Generics and LINQ of C# |
|
Answer» Right ANSWER is (a) DELEGATES are not type safe |
|
| 13. |
Which among the following differentiates a delegate in C#.NET from a conventional function pointer in other languages?(a) delegates in C#.NET represent a new type in the Common Type System(b) delegates allows static as well as instance methods to be invoked(c) delegates are type safe and secure(d) none of the mentionedThis question was posed to me by my college director while I was bunking the class.The query is from Fundamental of Delegates in division Delegates, Generics and LINQ of C# |
|
Answer» RIGHT OPTION is (d) NONE of the mentioned Easiest EXPLANATION - None. |
|
| 14. |
Which of the following is an incorrect statement about delegate?(a) a single delegate can invoke more than one method(b) delegates could be shared(c) delegates are type safe wrappers for function pointers(d) delegate is a value typeThis question was posed to me by my college professor while I was bunking the class.My doubt is from Fundamental of Delegates in portion Delegates, Generics and LINQ of C# |
|
Answer» Correct choice is (C) delegates are type SAFE WRAPPERS for function pointers |
|
| 15. |
Choose the incorrect statement among the following about the delegate?(a) delegates are of reference types(b) delegates are object oriented(c) delegates are type safe(d) none of the mentionedI had been asked this question in an online quiz.Origin of the question is Fundamental of Delegates in division Delegates, Generics and LINQ of C# |
|
Answer» The CORRECT CHOICE is (d) NONE of the mentioned |
|
| 16. |
To generate a simple notification for an object in runtime, the programming construct to be used for implementing this idea?(a) namespace(b) interface(c) delegate(d) attributeThis question was addressed to me by my school principal while I was bunking the class.My question is from Fundamental of Delegates topic in section Delegates, Generics and LINQ of C# |
|
Answer» CORRECT ANSWER is (C) delegate Easiest EXPLANATION - NONE. |
|
| 17. |
Suppose a Generic class called as SortObjects is to be made capable of sorting objects of any type(integer, single, byte etc). Then, which of the following programming constructs is able to implement the comparison function?(a) interface(b) encapsulation(c) delegate(d) attributeThis question was posed to me during a job interview.My question is from Fundamental of Delegates topic in chapter Delegates, Generics and LINQ of C# |
|
Answer» The CORRECT CHOICE is (C) delegate |
|
| 18. |
To implement delegates, the necessary condition is?(a) class declaration(b) inheritance(c) runtime polymorphism(d) exceptionsThe question was asked by my school teacher while I was bunking the class.My question is based upon Fundamental of Delegates topic in division Delegates, Generics and LINQ of C# |
|
Answer» Correct CHOICE is (a) CLASS declaration |
|
| 19. |
The ‘ref’ keyword can be used with which among the following?(a) Static function/subroutine(b) Static data(c) Instance function/subroutine(d) All of the mentionedI have been asked this question in exam.The above asked question is from Fundamental of Delegates topic in portion Delegates, Generics and LINQ of C# |
|
Answer» CORRECT ANSWER is (a) STATIC function/subroutine The EXPLANATION is: NONE. |
|