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 1–25 of 221

Career & HR topics

By tech stack

Mid PDF
Concat(seq2); Console.WriteLine(result); // Output: Alice, Bob, Charlie, David?

Short answer: var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", &quot…

Mid PDF
Concat(seq2);?

Short answer: Concat(seq2); var result = string.Join(", ", concatenated); Console.WriteLine(result); // Output: Alice, Bob, Charlie, David Concat(seq2); var result = string.Join(", ", concatenated); C…

Mid PDF
Get all employees from IT department?

Short answer: var itEmployees = employees.Where(e => e.Department == "IT"); Filters employees whose department is "IT". Example code var itEmployees = employees.Where(e => e.Department == "…

Mid PDF
Select only employee names?

Short answer: var names = employees.Select(e => e.Name); Projects only the Name property of each employee. Example code var names = employees.Select(e => e.Name); Projects only the Name property of each employee. R…

Mid PDF
Sort employees by salary descending?

Short answer: var sorted = employees.OrderByDescending(e => e.Salary); Orders the list from highest salary to lowest. Example code var sorted = employees.OrderByDescending(e => e.Salary); Orders the list from highe…

Mid PDF
Select employees with salary > 70,000 and only Name + Salary .Where(e => e.Salary > 70000)?

Short answer: var filtered = employees .Select(e => new { e.Name, e.Salary }); Combines filtering + projection using anonymous types. Example code var filtered = employees .Select(e => new { e.Name, e.Salary }); Co…

Mid PDF
Select employees with salary > 70,000 and only Name + Salary?

Short answer: Combines filtering + projection using anonymous types. Real-world example (ShopNest) ShopNest maps entities to DTOs with .Select(o => new OrderSummaryDto { Id = o.Id, Total = o.Total }) so the API does n…

Mid PDF
Count number of employees in HR?

Short answer: int hrCount = employees.Count(e => e.Department == "HR"); Counts only employees matching the condition. Example code int hrCount = employees.Count(e => e.Department == "HR"); Count…

Junior PDF
What is the average salary in IT?

Short answer: double avgSalary = employees .Average(e => e.Salary); double avgSalary = employees .Average(e => e.Salary); double avgSalary = employees .Average(e => e.Salary); double avgSalary = employees .Avera…

Junior PDF
What is the average salary in IT?

Short answer: What is the average salary in IT? double avgSalary = employees .Where(e => e.Department == "IT") .Average(e => e.Salary); What is the average salary in IT? double avgSalary = employees .Wher…

Mid PDF
Find the highest salary in the company?

Short answer: double max = employees.Max(e => e.Salary); double max = employees.Max(e => e.Salary); double max = employees.Max(e => e.Salary); double max = employees.Max(e => e.Salary); Real-world example (Sh…

Mid PDF
Group employees by department 📝 To print the groups: foreach (var group in grouped) { Console.WriteLine($"Department: {group.Key}"); foreach (var emp in group) Console.WriteLine($" - {emp.Name}"); }

Short answer: var grouped = employees .GroupBy(e => e.Department); Each group is an IGrouping<string, Employee> Example code var grouped = employees .GroupBy(e => e.Department); Each group is an IGrouping<…

Mid PDF
Group employees by department?

Short answer: Each group is an IGrouping<string, 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 D…

Mid PDF
For each department, show average salary?

Short answer: For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary = g.Average(e => e.Salary) }); For each department,…

Mid PDF
Inner Join: Get employee names with their department location join d in departments on e.Department equals d.Name select new { e.Name, Department = e.Department, d.Location };

Short answer: var joined = from e in employees join matches based on keys. Explain a bit more var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys. var…

Mid PDF
Inner Join: Get employee names with their department location?

Short answer: join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys. join match…

Mid PDF
Left Outer Join: Include employees even if department not found join d in departments on e.Department equals d.Name from d in deptGroup.DefaultIfEmpty() select new { e.Name, Department = e.Department, Location = d?

Short answer: .Location?? "Not Found" }; var leftJoin = from e in employees into deptGroup Uses DefaultIfEmpty() to simulate outer join. Example code .Location?? "Not Found" }; var leftJoin = from e i…

Mid PDF
Left Outer Join: Include employees even if department not found?

Short answer: Uses DefaultIfEmpty() to simulate outer join. 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 Define…

Mid PDF
Get first employee with salary > 80000?

Short answer: var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 8000…

Mid PDF
Use Single vs First — what's the difference?

Short answer: >1 ✅ Tip: Use Single when you're sure there will be exactly one result. var onlyHR = employees.SingleOrDefault(e => e.Id == 1); // throws if var firstHR = employees.FirstOrDefault(e => e.Id == 1);…

Mid PDF
Use Single vs First — what's the difference?

Short answer: Use Single vs First — what's the difference? var onlyHR = employees.SingleOrDefault(e => e.Id == 1); // throws if var firstHR = employees.FirstOrDefault(e => e.Id == 1); // safe ✅ Tip: Use Single when…

Mid PDF
Find employees in both List A and List B?

Short answer: var listA = employees.Take(3); var listB = employees.Skip(2); var common = listA.Select(e => e.Id) .Intersect(listB.Select(e => e.Id)); Example code var listA = employees.Take(3); var listB = employee…

Mid PDF
Get employees in List A but not in List B?

Short answer: var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(l…

Mid PDF
Skip top 2 highest salaries and take next 2?

Short answer: Skip top 2 highest salaries and take next 2 var result = employees .OrderByDescending(e => e.Salary) .Skip(2) .Take(2); Skip top 2 highest salaries and take next 2 var result = employees .OrderByDescendi…

Mid PDF
Are all employees earning more than 50k?

Short answer: bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(…

LINQ LINQ Tutorial · LINQ

Short answer: var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated);

Example code

var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated); var result = string.Join(", ", concatenated);

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: Concat(seq2); var result = string.Join(", ", concatenated); Console.WriteLine(result); // Output: Alice, Bob, Charlie, David Concat(seq2); var result = string.Join(", ", concatenated); Console.WriteLine(result); // Output: Alice, Bob, Charlie, David Concat(seq2); var result = string.Join(", ", concatenated); Console.WriteLine(result); // Output: Alice, Bob,… Charlie, David Concat(seq2); var result = string.Join(",…

Explain a bit more

", concatenated); Console.WriteLine(result); // Output: Alice, Bob, Charlie, David

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 itEmployees = employees.Where(e => e.Department == "IT"); Filters employees whose department is "IT".

Example code

var itEmployees = employees.Where(e => e.Department == "IT"); Filters employees whose department is "IT".

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 names = employees.Select(e => e.Name); Projects only the Name property of each employee.

Example code

var names = employees.Select(e => e.Name); Projects only the Name property of each employee.

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: var sorted = employees.OrderByDescending(e => e.Salary); Orders the list from highest salary to lowest.

Example code

var sorted = employees.OrderByDescending(e => e.Salary); Orders the list from highest salary to lowest.

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 filtered = employees .Select(e => new { e.Name, e.Salary }); Combines filtering + projection using anonymous types.

Example code

var filtered = employees
.Select(e => new { e.Name, e.Salary }); Combines filtering + projection using anonymous types.

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: Combines filtering + projection using anonymous types.

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: int hrCount = employees.Count(e => e.Department == "HR"); Counts only employees matching the condition.

Example code

int hrCount = employees.Count(e => e.Department == "HR"); Counts only employees matching the condition.

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 avgSalary = employees .Average(e => e.Salary); double avgSalary = employees .Average(e => e.Salary); double avgSalary = employees .Average(e => e.Salary); double avgSalary = employees .Average(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: What is the average salary in IT? double avgSalary = employees .Where(e => e.Department == "IT") .Average(e => e.Salary); What is the average salary in IT? double avgSalary = employees .Where(e => e.Department == "IT") .Average(e => e.Salary); What is the average salary in IT? double avgSalary = employees .Where(e => e.Department == "IT") .Average(e =>… e.Salary); What is the average salary in IT? double avgSalary =…

Explain a bit more

employees .Where(e => e.Department == "IT") .Average(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: double max = employees.Max(e => e.Salary); double max = employees.Max(e => e.Salary); double max = employees.Max(e => e.Salary); double max = employees.Max(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 grouped = employees .GroupBy(e => e.Department); Each group is an IGrouping<string, Employee>

Example code

var grouped = employees
.GroupBy(e => e.Department); Each group is an IGrouping<string, 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: Each group is an IGrouping<string, 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: For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary = g.Average(e => e.Salary) }); For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary =… g.Average(e => e.Salary) }); For… each department, show average salary var avgByDept =…

Explain a bit more

employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary = g.Average(e => e.Salary) }); For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary =… g.Average(e => e.Salary) }); For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary = g.Average(e => e.Salary) }); For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary =… g.Average(e => e.Salary) }); For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary = g.Average(e => e.Salary) }); For each department, show average salary var avgByDept = employees…

Example code

For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary = g.Average(e => e.Salary) }); For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary =… g.Average(e => e.Salary) }); For… each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary = g.Average(e => e.Salary) }); For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary =… g.Average(e => e.Salary) }); For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary = g.Average(e => e.Salary) }); For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary =… g.Average(e => e.Salary) }); For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary = g.Average(e => e.Salary) }); For each department, show average salary var avgByDept = employees .GroupBy(e => e.Department) .Select(g => new Department = g.Key, AverageSalary =… g.Average(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 joined = from e in employees join matches based on keys.

Explain a bit more

var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys.

Example code

var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys. var joined = from e in employees join matches based on keys.

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: join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys.

Example code

join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys. join matches based on keys.

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: .Location?? "Not Found" }; var leftJoin = from e in employees into deptGroup Uses DefaultIfEmpty() to simulate outer join.

Example code

.Location?? "Not Found" }; var leftJoin = from e in employees
into deptGroup Uses DefaultIfEmpty() to simulate outer join.

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: Uses DefaultIfEmpty() to simulate outer join.

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 highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid =…

Explain a bit more

employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000);

Example code

var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000); var highPaid = employees.FirstOrDefault(e => e.Salary > 80000);

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: >1 ✅ Tip: Use Single when you're sure there will be exactly one result. var onlyHR = employees.SingleOrDefault(e => e.Id == 1); // throws if var firstHR = employees.FirstOrDefault(e => e.Id == 1); // safe

Example code

>1 ✅ Tip: Use Single when you're sure there will be exactly one result. var onlyHR = employees.SingleOrDefault(e => e.Id == 1); // throws if
var firstHR = employees.FirstOrDefault(e => e.Id == 1); // safe

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: Use Single vs First — what's the difference? var onlyHR = employees.SingleOrDefault(e => e.Id == 1); // throws if var firstHR = employees.FirstOrDefault(e => e.Id == 1); // safe ✅ Tip: Use Single when you're sure there will be exactly one result.

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 listA = employees.Take(3); var listB = employees.Skip(2); var common = listA.Select(e => e.Id) .Intersect(listB.Select(e => e.Id));

Example code

var listA = employees.Take(3);
var listB = employees.Skip(2);
var common = listA.Select(e => e.Id)
.Intersect(listB.Select(e => e.Id));

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 onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id)…

Explain a bit more

Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id));

Example code

var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id)); var onlyInA = listA.Select(e => e.Id) .Except(listB.Select(e => e.Id));

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: Skip top 2 highest salaries and take next 2 var result = employees .OrderByDescending(e => e.Salary) .Skip(2) .Take(2); Skip top 2 highest salaries and take next 2 var result = employees .OrderByDescending(e => e.Salary) .Skip(2) .Take(2); Skip top 2 highest salaries and take next 2 var result = employees .OrderByDescending(e => e.Salary) .Skip(2) .Take(2);… Skip top 2 highest salaries and take next 2 var result =…

Explain a bit more

employees .OrderByDescending(e => e.Salary) .Skip(2) .Take(2);

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: bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary >…

Example code

bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000); bool allHigh = employees.All(e => e.Salary > 50000);

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