All fields

“Events & Lambdas” in Information Technology

22 questions across 1 technology.

Information Technology

22 questions in 1 technology

#QuestionTechnologyTopicLevel
1How do events differ from plain delegates? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasIntermediate
2What is a delegate in C#? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasBeginner
3What is the difference between Func, Action and Predicate? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasBeginner
4What is a delegate in C#, and what does it represent conceptually? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasBeginner
5How do you write and use a lambda expression as a shorthand for a delegate? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasBeginner
6What is a delegate in C#, and how does it enable passing methods as values? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasBeginner
7What is a closure and what is a common pitfall? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasIntermediate
8What is an event, and how does it differ from a plain public delegate field? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasIntermediate
9What are multicast delegates, and in what order do their subscribed methods get invoked? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasIntermediate
10How does variable capture (closures) work in a C# lambda expression, and what pitfall occurs when capturing a loop variable? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasIntermediate
11What causes event-handler memory leaks and how do you prevent them? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasAdvanced
12What is the difference between multicast delegate invocation and exception handling? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasAdvanced
13How do the built-in Func<>, Action<>, and Predicate<T> generic delegate types differ, and when would you use each? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasAdvanced
14How would you implement the 'weak event pattern' to prevent event subscribers from causing a memory leak by keeping the publisher alive indefinitely? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasAdvanced
15How does a lambda expression get compiled differently when it captures NO outer variables versus when it DOES capture outer state? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasAdvanced
16How do delegate covariance and contravariance work with method group conversions in C#? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasAdvanced
17How would you implement a custom EventHandler using async/await, avoiding the common 'async void' anti-pattern while still matching the standard EventHandler delegate signature? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasAdvanced
18How would you implement the Observer pattern in C# using events, versus using the IObservable<T>/IObserver<T> interfaces from System? C# › Design Patterns in C#C#Design Patterns in C#Advanced
19What do the 'async' and 'await' keywords do, and how do they relate to each other? C# › Asynchronous ProgrammingC#Asynchronous ProgrammingBeginner
20How would you implement the Strategy pattern in C# using either interfaces or delegates? C# › Design Patterns in C#C#Design Patterns in C#Intermediate
21What is a memory leak in a garbage-collected language like C#, given that the GC handles cleanup automatically? C# › Memory & Garbage CollectionC#Memory & Garbage CollectionIntermediate
22How do C# 12's default parameter values on LAMBDA expressions work, and what limitation did they remove compared to earlier C# versions? C# › Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)C#Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)Advanced