Interview Q&A

Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.

4608 total questions 4508 technical 100 career & HR 4272 from PDF library

Showing 2576–2600 of 4608

Career & HR topics

By tech stack

Popular tracks

Mid PDF
Get bottom 2 lowest-paid employees?

Short answer: Get bottom 2 lowest-paid employees var bottom2 = employees .OrderBy(e => e.Salary) .Take(2); Get bottom 2 lowest-paid employees var bottom2 = employees .OrderBy(e => e.Salary) .Take(2); Get bottom 2 l…

Mid PDF
Get names of employees whose names start with 'A' .Where(e => e.Name.StartsWith("A"))?

Short answer: var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select…

Mid PDF
Get names of employees whose names start with 'A'?

Short answer: Get names of employees whose names start with 'A' var namesStartingA = employees .Where(e => e.Name.StartsWith("A")) .Select(e => e.Name); Follow : Get names of employees whose names start w…

Mid PDF
Get total salary by department?

Short answer: Get total salary by department var totalByDept = employees .GroupBy(e => e.Department) .Select(g => new { Department = g.Key, Total = g.Sum(e => e.Salary) }); Get total salary by department var tot…

Mid PDF
Flatten list of lists using SelectMany List<List<int>> numbers = new() { new() { 1, 2 }, new() { 3, 4 }, new() { 5 } };?

Short answer: var flat = numbers.SelectMany(n =&gt; n); var flat = numbers.SelectMany(n =&gt; n); var flat = numbers.SelectMany(n =&gt; n); var flat = numbers.SelectMany(n =&gt; n); var flat = numbers.SelectMany(n =&gt;…

Mid PDF
Flatten list of lists using SelectMany?

Short answer: Flatten list of lists using SelectMany List&lt;List&lt;int&gt;&gt; numbers = new() { new() { 1, 2 }, new() { 3, 4 }, new() { 5 } var flat = numbers.SelectMany(n =&gt; n); Flatten list of lists using SelectM…

Mid PDF
Use Distinct() on names?

Short answer: Use Distinct() on names var distinctNames = employees .Select(e =&gt; e.Name) .Distinct(); Use Distinct() on names var distinctNames = employees .Select(e =&gt; e.Name) .Distinct(); Use Distinct() on names…

Mid PDF
Convert list of salaries to array .Select(e => e.Salary) .ToArray();?

Short answer: double[] salaryArray = employees Real-world example (ShopNest) ShopNest maps entities to DTOs with .Select(o =&gt; new OrderSummaryDto { Id = o.Id, Total = o.Total }) so the API does not leak internal field…

Mid PDF
Convert list of salaries to array?

Short answer: Convert list of salaries to array double[] salaryArray = employees .Select(e =&gt; e.Salary) .ToArray(); Convert list of salaries to array double[] salaryArray = employees .Select(e =&gt; e.Salary) .ToArray…

Mid PDF
Find duplicate departments .GroupBy(e => e.Department) .Where(g => g.Count() > 1)?

Short answer: var duplicateDepts = employees .Select(g =&gt; g.Key); var duplicateDepts = employees .Select(g =&gt; g.Key); var duplicateDepts = employees .Select(g =&gt; g.Key); var duplicateDepts = employees .Select(g…

Mid PDF
Find duplicate departments?

Short answer: Find duplicate departments var duplicateDepts = employees Follow : .GroupBy(e =&gt; e.Department) .Where(g =&gt; g.Count() &gt; 1) .Select(g =&gt; g.Key); Find duplicate departments var duplicateDepts = emp…

Mid PDF
Compare LINQ to SQL vs LINQ to Objects?

Short answer: Compare LINQ to SQL vs LINQ to Objects? Answer: LINQ to Objects runs in memory on collections (List&lt;T&gt;, arrays). LINQ to SQL/EF builds expression trees and translates to SQL queries. Real-world exampl…

Mid PDF
Show all departments even if no employees (outer join) join e in employees on d.Name equals e.Department from eg in empGroup.DefaultIfEmpty() select new { Dept = d.Name, EmpName = eg?.Name?? "No Employee" };

Short answer: var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup va…

Mid PDF
Show all departments even if no employees (outer join)?

Short answer: Show all departments even if no employees (outer join) var allDepts = from d in departments join e in employees on d.Name equals e.Department into empGroup from eg in empGroup.DefaultIfEmpty() select new {…

Mid PDF
Use Zip() to combine two lists?

Short answer: var names = new[] { &quot;A&quot;, &quot;B&quot;, &quot;C&quot; }; var scores = new[] { 10, 20, 30 }; var zipped = names.Zip(scores, (n, s) =&gt; $&quot;{n} scored {s}&quot;); Example code var names = new[]…

Mid PDF
Filter only numeric strings using OfType<T>()?

Short answer: object[] mixed = { &quot;One&quot;, 2, &quot;Three&quot;, 4 }; var numbers = mixed.OfType&lt;int&gt;(); Example code object[] mixed = { &quot;One&quot;, 2, &quot;Three&quot;, 4 }; var numbers = mixed.OfType…

Mid PDF
Group by multiple fields (composite key)?

Short answer: var grouped = employees .GroupBy(e =&gt; new { e.Department, e.Salary }); var grouped = employees .GroupBy(e =&gt; new { e.Department, e.Salary }); var grouped = employees .GroupBy(e =&gt; new { e.Departmen…

Mid PDF
Paginate: Get page 2, size 3 .Skip((pageIndex - 1) * pageSize) .Take(pageSize);?

Short answer: int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex…

Mid PDF
Paginate: Get page 2, size 3?

Short answer: Paginate: Get page 2, size 3 int pageSize = 3; int pageIndex = 2; var page = employees .Skip((pageIndex - 1) * pageSize) .Take(pageSize); Paginate: Get page 2, size 3 int pageSize = 3; int pageIndex = 2; va…

Mid PDF
Why use AsEnumerable()?

Short answer: var query = dbContext.Employees .Where(e =&gt; CustomFunction(e.Name)); var query = dbContext.Employees .Where(e =&gt; CustomFunction(e.Name)); var query = dbContext.Employees .Where(e =&gt; CustomFunction(…

Mid PDF
Why use AsEnumerable()?

Short answer: Why use AsEnumerable()? var query = dbContext.Employees .AsEnumerable() // switch to in-memory .Where(e =&gt; CustomFunction(e.Name)); ✅ Use when your logic can't be translated to SQL. Why use AsEnumerable(…

Mid PDF
Detect and avoid N+1 query in EF?

Short answer: Detect and avoid N+1 query in EF? Use Include() to load related entities: var orders = dbContext.Orders .Include(o =&gt; o.Customer) .ToList(); Detect and avoid N+1 query in EF? Use Include() to load relate…

Mid PDF
How to force immediate execution?

Short answer: How to force immediate execution? Use .ToList(), .ToArray(), .Count(), .First() etc. Follow : Real-world example (ShopNest) ShopNest builds a LINQ query for search filters, then calls ToListAsync() once in…

Mid PDF
Can we use LINQ on JSON?

Short answer: Can we use LINQ on JSON? ✅ Yes — using System.Text.Json or Newtonsoft.Json, then LINQ on parsed objects. Real-world example (ShopNest) ShopNest uses LINQ to query orders: filter by date, project to a summar…

Mid PDF
How to create a dummy sequence of numbers from 1 to 10?

Short answer: var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers…

LINQ LINQ Tutorial · LINQ

Short answer: Get bottom 2 lowest-paid employees var bottom2 = employees .OrderBy(e => e.Salary) .Take(2); Get bottom 2 lowest-paid employees var bottom2 = employees .OrderBy(e => e.Salary) .Take(2); Get bottom 2 lowest-paid employees var bottom2 = employees .OrderBy(e => e.Salary) .Take(2); Get bottom 2 lowest-paid employees var bottom2 = employees .OrderBy(e =>…

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e =>…

Example code

var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name); var namesStartingA = employees .Select(e => e.Name);

Real-world example (ShopNest)

ShopNest filters active products with products.Where(p => p.IsActive && p.Stock > 0) before showing the catalog.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: Get names of employees whose names start with 'A' var namesStartingA = employees .Where(e => e.Name.StartsWith("A")) .Select(e => e.Name); Follow : Get names of employees whose names start with 'A' var namesStartingA = employees .Where(e => e.Name.StartsWith("A")) .Select(e => e.Name); Follow : Get names of employees whose names start with 'A' var… namesStartingA = employees .Where(e => e.Name.StartsWith("A"))…

Explain a bit more

Select(e => e.Name); Follow : Get names of employees whose names start with 'A' var namesStartingA = employees .Where(e => e.Name.StartsWith("A")) .Select(e => e.Name); Follow :

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: Get total salary by department var totalByDept = employees .GroupBy(e => e.Department) .Select(g => new { Department = g.Key, Total = g.Sum(e => e.Salary) }); Get total salary by department var totalByDept = employees .GroupBy(e => e.Department) .Select(g => new { Department = g.Key, Total = g.Sum(e => e.Salary) }); Real-world… example (ShopNest) ShopNest…… uses LINQ to query orders: filter by date, project to a…

Explain a bit more

summary DTO, and order by total—readable C# that becomes SQL under EF Core. Get total salary by department var totalByDept = employees .GroupBy(e => e.Department) .Select(g => new { Department = g.Key, Total = g.Sum(e => e.Salary) }); Get total salary by department var totalByDept = employees .GroupBy(e => e.Department) .Select(g => new { Department = g.Key, Total = g.Sum(e => e.Salary) }); Real-world… example (ShopNest) ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n);

Example code

var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n); var flat = numbers.SelectMany(n => n);

Real-world example (ShopNest)

ShopNest maps entities to DTOs with .Select(o => new OrderSummaryDto { Id = o.Id, Total = o.Total }) so the API does not leak internal fields.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: Flatten list of lists using SelectMany List<List<int>> numbers = new() { new() { 1, 2 }, new() { 3, 4 }, new() { 5 } var flat = numbers.SelectMany(n => n); Flatten list of lists using SelectMany List<List<int>> numbers = new() { new() { 1, 2 }, new() { 3, 4 }, new() { 5 } var flat = numbers.SelectMany(n => n); Real-world example… (ShopNest) ShopNest maps…… entities to DTOs with .Select(o => new OrderSummaryDto { Id…

Explain a bit more

= o.Id, Total = o.Total }) so the API does not leak internal fields. Flatten list of lists using SelectMany List<List<int>> numbers = new() { new() { 1, 2 }, new() { 3, 4 }, new() { 5 } var flat = numbers.SelectMany(n => n); Flatten list of lists using SelectMany List<List<int>> numbers = new() { new() { 1, 2 }, new() { 3, 4 }, new() { 5 } var flat = numbers.SelectMany(n => n); Real-world example… (ShopNest) ShopNest maps entities to DTOs with .Select(o => new OrderSummaryDto { Id = o.Id, Total = o.Total }) so the API does not leak internal fields.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: Use Distinct() on names var distinctNames = employees .Select(e => e.Name) .Distinct(); Use Distinct() on names var distinctNames = employees .Select(e => e.Name) .Distinct(); Use Distinct() on names var distinctNames = employees .Select(e => e.Name) .Distinct(); Use Distinct() on names var distinctNames = employees .Select(e => e.Name) .Distinct();

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: double[] salaryArray = employees

Real-world example (ShopNest)

ShopNest maps entities to DTOs with .Select(o => new OrderSummaryDto { Id = o.Id, Total = o.Total }) so the API does not leak internal fields.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: Convert list of salaries to array double[] salaryArray = employees .Select(e => e.Salary) .ToArray(); Convert list of salaries to array double[] salaryArray = employees .Select(e => e.Salary) .ToArray(); Convert list of salaries to array double[] salaryArray = employees .Select(e => e.Salary) .ToArray(); Convert list of salaries to array double[]… salaryArray = employees .Select(e => e.Salary) .ToArray();

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key);

Example code

var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key); var duplicateDepts = employees .Select(g => g.Key);

Real-world example (ShopNest)

ShopNest filters active products with products.Where(p => p.IsActive && p.Stock > 0) before showing the catalog.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: Find duplicate departments var duplicateDepts = employees Follow : .GroupBy(e => e.Department) .Where(g => g.Count() > 1) .Select(g => g.Key); Find duplicate departments var duplicateDepts = employees Follow : .GroupBy(e => e.Department) .Where(g => g.Count() > 1) .Select(g => g.Key); Find duplicate departments var duplicateDepts = employees Follow :… GroupBy(e => e.Department) .Where(g => g.Count() > 1) .Select(g…

Explain a bit more

=> g.Key); Find duplicate departments var duplicateDepts = employees Follow : .GroupBy(e => e.Department) .Where(g => g.Count() > 1) .Select(g => g.Key);

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: Compare LINQ to SQL vs LINQ to Objects? Answer: LINQ to Objects runs in memory on collections (List<T>, arrays). LINQ to SQL/EF builds expression trees and translates to SQL queries.

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup

Example code

var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup var allDepts = from d in departments into empGroup

Real-world example (ShopNest)

ShopNest maps entities to DTOs with .Select(o => new OrderSummaryDto { Id = o.Id, Total = o.Total }) so the API does not leak internal fields.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: Show all departments even if no employees (outer join) var allDepts = from d in departments join e in employees on d.Name equals e.Department into empGroup from eg in empGroup.DefaultIfEmpty() select new { Dept = d.Name, EmpName = eg?.Name ?? "No Employee"

Real-world example (ShopNest)

A sales report joins orders and customers, then GroupBy(c => c.City) to show revenue per city.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: var names = new[] { "A", "B", "C" }; var scores = new[] { 10, 20, 30 }; var zipped = names.Zip(scores, (n, s) => $"{n} scored {s}");

Example code

var names = new[] { "A", "B", "C" };
var scores = new[] { 10, 20, 30 };
var zipped = names.Zip(scores, (n, s) => $"{n} scored {s}");

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: object[] mixed = { "One", 2, "Three", 4 }; var numbers = mixed.OfType<int>();

Example code

object[] mixed = { "One", 2, "Three", 4 };
var numbers = mixed.OfType<int>();

Real-world example (ShopNest)

ShopNest filters active products with products.Where(p => p.IsActive && p.Stock > 0) before showing the catalog.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: var grouped = employees .GroupBy(e => new { e.Department, e.Salary }); var grouped = employees .GroupBy(e => new { e.Department, e.Salary }); var grouped = employees .GroupBy(e => new { e.Department, e.Salary }); var grouped = employees .GroupBy(e => new { e.Department, e.Salary }); var grouped = employees .GroupBy(e => new { e.Department, e.Salary }); var grouped = employees .GroupBy(e => new { e.Department,…

Explain a bit more

e.Salary }); var grouped = employees .GroupBy(e => new { e.Department, e.Salary }); var grouped = employees .GroupBy(e => new { e.Department, e.Salary });

Example code

var grouped = employees .GroupBy(e => new { e.Department, e.Salary }); var grouped = employees .GroupBy(e => new { e.Department, e.Salary }); var grouped = employees .GroupBy(e => new { e.Department, e.Salary }); var grouped = employees .GroupBy(e => new { e.Department, e.Salary }); var grouped = employees .GroupBy(e => new { e.Department, e.Salary }); var grouped = employees .GroupBy(e => new { e.Department, e.Salary }); var grouped = employees .GroupBy(e => new { e.Department, e.Salary }); var grouped = employees .GroupBy(e => new { e.Department, e.Salary });

Real-world example (ShopNest)

A sales report joins orders and customers, then GroupBy(c => c.City) to show revenue per city.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize…

Explain a bit more

= 3; int pageIndex = 2; var page = employees

Example code

int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees int pageSize = 3; int pageIndex = 2; var page = employees

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: Paginate: Get page 2, size 3 int pageSize = 3; int pageIndex = 2; var page = employees .Skip((pageIndex - 1) * pageSize) .Take(pageSize); Paginate: Get page 2, size 3 int pageSize = 3; int pageIndex = 2; var page = employees .Skip((pageIndex - 1) * pageSize) .Take(pageSize); Paginate: Get page 2, size 3 int pageSize = 3; int pageIndex = 2; var page =… employees .Skip((pageIndex - 1) * pageSize) .Take(pageSize);…

Explain a bit more

Paginate: Get page 2, size 3 int pageSize = 3; int pageIndex = 2; var page = employees .Skip((pageIndex - 1) * pageSize) .Take(pageSize);

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: var query = dbContext.Employees .Where(e => CustomFunction(e.Name)); var query = dbContext.Employees .Where(e => CustomFunction(e.Name)); var query = dbContext.Employees .Where(e => CustomFunction(e.Name)); var query = dbContext.Employees .Where(e => CustomFunction(e.Name));

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: Why use AsEnumerable()? var query = dbContext.Employees .AsEnumerable() // switch to in-memory .Where(e => CustomFunction(e.Name)); ✅ Use when your logic can't be translated to SQL. Why use AsEnumerable()? var query = dbContext.Employees .AsEnumerable() // switch to in-memory .Where(e => CustomFunction(e.Name)); ✅ Use when your… logic can't be translated… to… Why use AsEnumerable()? var query = dbContext.Employees…

Explain a bit more

AsEnumerable() // switch to in-memory .Where(e => CustomFunction(e.Name)); ✅ Use when your logic can't be translated to SQL. Why use AsEnumerable()? var query = dbContext.Employees .AsEnumerable() // switch to in-memory .Where(e => CustomFunction(e.Name)); ✅ Use when your… logic can't be translated to SQL.

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: Detect and avoid N+1 query in EF? Use Include() to load related entities: var orders = dbContext.Orders .Include(o => o.Customer) .ToList(); Detect and avoid N+1 query in EF? Use Include() to load related entities: var orders = dbContext.Orders .Include(o => o.Customer) .ToList(); Detect and avoid N+1 query in EF? Use Include() to load related entities: var… orders = dbContext.Orders .Include(o => o.Customer)…

Explain a bit more

ToList(); Detect and avoid N+1 query in EF? Use Include() to load related entities: var orders = dbContext.Orders .Include(o => o.Customer) .ToList();

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: How to force immediate execution? Use .ToList(), .ToArray(), .Count(), .First() etc. Follow :

Real-world example (ShopNest)

ShopNest builds a LINQ query for search filters, then calls ToListAsync() once in the repository—so the SQL runs one time, not inside a loop.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: Can we use LINQ on JSON? ✅ Yes — using System.Text.Json or Newtonsoft.Json, then LINQ on parsed objects.

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

LINQ LINQ Tutorial · LINQ

Short answer: var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10);

Example code

var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10); var numbers = Enumerable.Range(1, 10);

Real-world example (ShopNest)

ShopNest uses LINQ to query orders: filter by date, project to a summary DTO, and order by total—readable C# that becomes SQL under EF Core.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details