Lyra
Learn
AI Learning Platform
π Midnight
π Comfort
π₯ Ember
π Paper
β Contrast
Exams
Sign in to track progress
β Back to the lesson
Module 1 Β· Quiz
LINQ and Collections
1. What does the `IEnumerable<T>` interface allow C# developers to do?
Execute SQL queries directly on databases
Iterate over a sequence of data in memory
Build expression trees for deferred execution
Perform grouping and aggregation operations directly
2. What is the key difference between `IQueryable<T>` and `IEnumerable<T>`?
`IQueryable<T>` executes queries immediately while `IEnumerable<T>` does not
`IQueryable<T>` holds an expression tree while `IEnumerable<T>` executes code directly
`IEnumerable<T>` supports database querying while `IQueryable<T>` does not
`IQueryable<T>` is always in memory while `IEnumerable<T>` can be remote
3. Why is it important to sort before using pagination methods like `Skip` or `Take`?
To avoid SQL errors
To ensure stable results across database queries
To improve performance on large datasets
To make grouping operations faster
4. What is a common pitfall when using LINQ queries, especially with `IQueryable`?
Returning too many records
Inadequate filtering conditions
Multiple enumeration of a query may cause performance issues
Using the wrong method for projection
Submit answers
Continue: Async/Await Done Right β
Review this lesson
Retake quiz