---
title: "What is the difference between IEnumerable, IQueryable, and List in C#?"  
description: "What is the difference between IEnumerable, IQueryable, and List in C#?"  
author: "ICSM Computer"  
published: 2025-06-19  
updated: 2025-06-19  
canonical: https://www.mindstick.com/interview/34261/what-is-the-difference-between-ienumerable-iqueryable-and-list-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# What is the difference between IEnumerable, IQueryable, and List in C#?

#### What is the difference between `IEnumerable`, `IQueryable`, and `List` in C#?

1. `IEnumerable`: Used to iterate over a collection. It executes queries in-memory (deferred execution).
2. `IQueryable`: Supports LINQ queries with deferred execution, but translates them to SQL when working with databases like Entity Framework.
3. `List<T>`: A concrete data structure that holds elements in memory with immediate execution.

## Example:

```cs
IEnumerable<string> names = list.Where(x => x.StartsWith("A")); // in-memory
IQueryable<string> dbNames = dbContext.Users.Where(u => u.Name.StartsWith("A")); // SQL
```

## Answers

### Answer by ICSM Computer

#### What is the difference between `IEnumerable`, `IQueryable`, and `List` in C#?

1. `IEnumerable`: Used to iterate over a collection. It executes queries in-memory (deferred execution).
2. `IQueryable`: Supports LINQ queries with deferred execution, but translates them to SQL when working with databases like Entity Framework.
3. `List<T>`: A concrete data structure that holds elements in memory with immediate execution.

## Example:

```cs
IEnumerable<string> names = list.Where(x => x.StartsWith("A")); // in-memory
IQueryable<string> dbNames = dbContext.Users.Where(u => u.Name.StartsWith("A")); // SQL
```


---

Original Source: https://www.mindstick.com/interview/34261/what-is-the-difference-between-ienumerable-iqueryable-and-list-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
