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 2026–2050 of 3281

Career & HR topics

By tech stack

Popular tracks

Mid PDF
How to find employees whose names start and end with the same?

Short answer: How to find employees whose names start and end with the same letter? var filtered = employees .Where(e => e.Name.StartsWith(e.Name.Last().ToString(), StringComparison.OrdinalIgnoreCase)); foreach (var e…

Mid PDF
How to use LINQ to find the most common first letter of employee names?

Short answer: var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var most…

Mid PDF
How to use LINQ to find the most common first letter of employee?

Short answer: How to use LINQ to find the most common first letter of employee names? var mostCommonLetter = employees .GroupBy(e => e.Name[0]) .OrderByDescending(g => g.Count()) .FirstOrDefault()?.Key; Console.Wri…

Mid PDF
How to create a lookup and use it for quick searches?

Short answer: foreach (var emp in itEmployees) Console.WriteLine(emp.Name); Explanation: Lookup is like a dictionary but allows multiple values per key. var lookup = employees.ToLookup(e => e.Department); Example code…

Mid PDF
How to create a lookup and use it for quick searches?

Short answer: How to create a lookup and use it for quick searches? var lookup = employees.ToLookup(e => e.Department); var itEmployees = lookup["IT"]; foreach (var emp in itEmployees) Console.WriteLine(emp.…

Mid PDF
How to group employees by salary ranges dynamically?

Short answer: { if (e.Salary < 50000) return "Low"; else return "High"; }); foreach (var group in salaryRanges) { Console.WriteLine($"{group.Key} Salary Range:"); foreach (var emp in grou…

Mid PDF
How to group employees by salary ranges dynamically?

Short answer: How to group employees by salary ranges dynamically? var salaryRanges = employees.GroupBy(e => if (e.Salary < 50000) return "Low"; else if (e.Salary <= 80000) return "Medium"; e…

Mid PDF
How to flatten a dictionary of lists into a single sequence?

Short answer: { {"IT", new List<string> {"Bob", "Alice"}}, {"HR", new List<string> {"Eva", "John"}} }; foreach (var name in allEmployees) Console.Wr…

Mid PDF
How to flatten a dictionary of lists into a single sequence?

Short answer: How to flatten a dictionary of lists into a single sequence? var dict = new Dictionary<string, List<string>> {"IT", new List<string> {"Bob", "Alice"}}, {&quot…

Mid PDF
How to check if a collection is empty with LINQ?

Short answer: bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = e…

Mid PDF
How to check if a collection is empty with LINQ?

Short answer: How to check if a collection is empty with LINQ? Explain a bit more bool hasEmployees = employees.Any(); Console.WriteLine(hasEmployees ? "There are employees" : "No employees"); How to…

Mid PDF
How to reverse a sequence using LINQ?

Short answer: var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Sele…

Mid PDF
How to reverse a sequence using LINQ?

Short answer: How to reverse a sequence using LINQ? var reversed = employees.Select(e => e.Name).Reverse(); foreach (var name in reversed) Console.WriteLine(name); How to reverse a sequence using LINQ? var reversed =…

Mid PDF
How to perform a distinct with a custom comparer?

Short answer: class EmployeeNameComparer : IEqualityComparer<Employee> { } foreach (var emp in distinctByName) Console.WriteLine(emp.Name); public bool Equals(Employee x, Employee y) => x.Name == y.Name; public…

Mid PDF
How to perform a distinct with a custom comparer?

Short answer: How to perform a distinct with a custom comparer? class EmployeeNameComparer : IEqualityComparer<Employee> public bool Equals(Employee x, Employee y) => x.Name == y.Name; public int GetHashCode(Emp…

Mid PDF
How to use LINQ to check if all employees belong to a department?

Short answer: bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT&quot…

Mid PDF
How to select a property and transform it?

Short answer: var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() + var employe…

Mid PDF
How to select a property and transform it?

Short answer: How to select a property and transform it? Explain a bit more var employeeEmails = employees.Select(e => e.Name.ToLower() + "@company.com"); foreach (var email in employeeEmails) Console.WriteL…

Mid PDF
How to concatenate two sequences with a separator?

Short answer: var seq1 = new[] { "Alice", "Bob" }; var seq2 = new[] { "Charlie", "David" }; var concatenated = se Example code var seq1 = new[] { "Alice", "Bob"…

Mid PDF
How to use LINQ to find employees with duplicate names?

Short answer: var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); va…

Mid PDF
How to use LINQ to find employees with duplicate names?

Short answer: How to use LINQ to find employees with duplicate names? var duplicates = employees .GroupBy(e => e.Name) .Where(g => g.Count() > 1) .Select(g => g.Key); foreach (var name in duplicates) Console.…

Mid PDF
How to use LINQ to paginate and return total pages?

Short answer: Console.WriteLine($"Total Pages: {totalPages}"); .Skip((pageNumber - 1) * pageSize) .Take(pageSize); foreach (var emp in pageData) Console.WriteLine(emp.Name); int pageSize = 2; Example code int t…

Mid PDF
How to use LINQ to paginate and return total pages?

Short answer: How to use LINQ to paginate and return total pages? Explain a bit more int pageSize = 2; Follow : int totalItems = employees.Count(); int totalPages = (int)Math.Ceiling(totalItems / (double)pageSize); Conso…

Mid PDF
How to join strings in LINQ?

Short answer: Console.WriteLine(joined); var names = employees.Select(e => e.Name); string joined = string.Join(", ", names); Example code Console.WriteLine(joined); var names = employees.Select(e => e.Na…

Mid PDF
How to join strings in LINQ?

Short answer: How to join strings in LINQ? var names = employees.Select(e => e.Name); string joined = string.Join(", ", names); Console.WriteLine(joined); Follow : How to join strings in LINQ? var names = em…

LINQ LINQ Tutorial · LINQ

Short answer: How to find employees whose names start and end with the same letter? var filtered = employees .Where(e => e.Name.StartsWith(e.Name.Last().ToString(), StringComparison.OrdinalIgnoreCase)); foreach (var emp in filtered) Console.WriteLine(emp.Name); How to find employees whose names start and end with the same letter?

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 mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees

Example code

var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = employees var mostCommonLetter = 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: How to use LINQ to find the most common first letter of employee names? var mostCommonLetter = employees .GroupBy(e => e.Name[0]) .OrderByDescending(g => g.Count()) .FirstOrDefault()?.Key; Console.WriteLine($"Most common first letter: {mostCommonLetter}"); Follow : How to use LINQ to find the most common first letter of employee names?

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: foreach (var emp in itEmployees) Console.WriteLine(emp.Name); Explanation: Lookup is like a dictionary but allows multiple values per key. var lookup = employees.ToLookup(e => e.Department);

Example code

var itEmployees = lookup["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: How to create a lookup and use it for quick searches? var lookup = employees.ToLookup(e => e.Department); var itEmployees = lookup["IT"]; foreach (var emp in itEmployees) Console.WriteLine(emp.Name); Explanation: Lookup is like a dictionary but allows multiple values per 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: { if (e.Salary < 50000) return "Low"; else return "High"; }); foreach (var group in salaryRanges) { Console.WriteLine($"{group.Key} Salary Range:"); foreach (var emp in group) Console.WriteLine($" - {emp.Name} ({emp.Salary})"); } var salaryRanges = employees.GroupBy(e =>

Example code

else if (e.Salary <= 80000) return "Medium";

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: How to group employees by salary ranges dynamically? var salaryRanges = employees.GroupBy(e => if (e.Salary < 50000) return "Low"; else if (e.Salary <= 80000) return "Medium"; else return "High"; }); foreach (var group in salaryRanges) Console.WriteLine($"{group.Key} Salary Range:"); foreach (var emp in group) Console.WriteLine($" - {emp.Name} ({emp.Salary})"); How to group employees by salary ranges dynamically?

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: { {"IT", new List<string> {"Bob", "Alice"}}, {"HR", new List<string> {"Eva", "John"}} }; foreach (var name in allEmployees) Console.WriteLine(name); var dict = new Dictionary<string, List<string>>

Example code

var allEmployees = dict.SelectMany(kvp => kvp.Value);

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 flatten a dictionary of lists into a single sequence? var dict = new Dictionary<string, List<string>> {"IT", new List<string> {"Bob", "Alice"}}, {"HR", new List<string> {"Eva", "John"}} Follow : var allEmployees = dict.SelectMany(kvp => kvp.Value); foreach (var name in allEmployees) Console.WriteLine(name); How to flatten a dictionary of lists into a single sequence?

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 hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any();

Example code

bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any(); bool hasEmployees = employees.Any();

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 check if a collection is empty with LINQ?

Explain a bit more

bool hasEmployees = employees.Any(); Console.WriteLine(hasEmployees ? "There are employees" : "No employees"); How to check if a collection is empty with LINQ? bool hasEmployees = employees.Any(); Console.WriteLine(hasEmployees ? "There are employees" : "No employees"); How to check if a collection is empty with LINQ? bool hasEmployees = employees.Any(); Console.WriteLine(hasEmployees ? "There are employees" : "No employees"); How to check if a collection is empty with LINQ? bool hasEmployees = employees.Any(); Console.WriteLine(hasEmployees ? "There are employees" : "No 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: var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed =…

Example code

var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse(); var reversed = employees.Select(e => e.Name).Reverse();

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 reverse a sequence using LINQ? var reversed = employees.Select(e => e.Name).Reverse(); foreach (var name in reversed) Console.WriteLine(name); How to reverse a sequence using LINQ? var reversed = employees.Select(e => e.Name).Reverse(); foreach (var name in reversed) Console.WriteLine(name); How to reverse a sequence using LINQ? var reversed =… employees.Select(e => e.Name).Reverse(); foreach (var name in…

Explain a bit more

reversed) Console.WriteLine(name); How to reverse a sequence using LINQ? var reversed = employees.Select(e => e.Name).Reverse(); foreach (var name in reversed) Console.WriteLine(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: class EmployeeNameComparer : IEqualityComparer<Employee> { } foreach (var emp in distinctByName) Console.WriteLine(emp.Name); public bool Equals(Employee x, Employee y) => x.Name == y.Name; public int GetHashCode(Employee obj) => obj.Name.GetHashCode(); var distinctByName = employees.Distinct(new EmployeeNameComparer());

Example code

class EmployeeNameComparer : IEqualityComparer<Employee> { } foreach (var emp in distinctByName) Console.WriteLine(emp.Name); public bool Equals(Employee x, Employee y) => x.Name == y.Name;
public int GetHashCode(Employee obj) => obj.Name.GetHashCode();
var distinctByName = employees.Distinct(new EmployeeNameComparer());

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 perform a distinct with a custom comparer? class EmployeeNameComparer : IEqualityComparer<Employee> public bool Equals(Employee x, Employee y) => x.Name == y.Name; public int GetHashCode(Employee obj) => obj.Name.GetHashCode(); var distinctByName = employees.Distinct(new EmployeeNameComparer()); foreach (var emp in distinctByName) Console.WriteLine(emp.Name); How to perform a distinct with a custom comparer?

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 allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT =…

Explain a bit more

employees.All(e => e.Department == "IT");

Example code

bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "IT"); bool allInIT = employees.All(e => e.Department == "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 employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e =>…

Explain a bit more

e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() +

Example code

var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() + var employeeEmails = employees.Select(e => e.Name.ToLower() +

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: How to select a property and transform it?

Explain a bit more

var employeeEmails = employees.Select(e => e.Name.ToLower() + "@company.com"); foreach (var email in employeeEmails) Console.WriteLine(email); How to select a property and transform it? var employeeEmails = employees.Select(e => e.Name.ToLower() + "@company.com"); foreach (var email in employeeEmails) Console.WriteLine(email); How to select a property and transform it? var employeeEmails = employees.Select(e => e.Name.ToLower() + "@company.com"); foreach (var email in employeeEmails) Console.WriteLine(email); How to select a property and transform it? var employeeEmails = employees.Select(e => e.Name.ToLower() + "@company.com"); foreach (var email in employeeEmails) Console.WriteLine(email);

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 seq1 = new[] { "Alice", "Bob" }; var seq2 = new[] { "Charlie", "David" }; var concatenated = se

Example code

var seq1 = new[] { "Alice", "Bob" };
var seq2 = new[] { "Charlie", "David" };
var concatenated = se

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 duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key);

Example code

var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .Select(g => g.Key); var duplicates = employees .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: How to use LINQ to find employees with duplicate names? var duplicates = employees .GroupBy(e => e.Name) .Where(g => g.Count() > 1) .Select(g => g.Key); foreach (var name in duplicates) Console.WriteLine(name); How to use LINQ to find employees with duplicate names?

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: Console.WriteLine($"Total Pages: {totalPages}"); .Skip((pageNumber - 1) * pageSize) .Take(pageSize); foreach (var emp in pageData) Console.WriteLine(emp.Name); int pageSize = 2;

Example code

int totalItems = employees.Count();
int totalPages = (int)Math.Ceiling(totalItems / (double)pageSize);
int pageNumber = 2;
var pageData = 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: How to use LINQ to paginate and return total pages?

Explain a bit more

int pageSize = 2; Follow : int totalItems = employees.Count(); int totalPages = (int)Math.Ceiling(totalItems / (double)pageSize); Console.WriteLine($"Total Pages: {totalPages}"); int pageNumber = 2; var pageData = employees .Skip((pageNumber - 1) * pageSize) .Take(pageSize); foreach (var emp in pageData) Console.WriteLine(emp.Name); How to use LINQ to paginate and return total pages?

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: Console.WriteLine(joined); var names = employees.Select(e => e.Name); string joined = string.Join(", ", names);

Example code

Console.WriteLine(joined); var names = employees.Select(e => e.Name);
string joined = string.Join(", ", names);

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: How to join strings in LINQ? var names = employees.Select(e => e.Name); string joined = string.Join(", ", names); Console.WriteLine(joined); Follow : How to join strings in LINQ? var names = employees.Select(e => e.Name); string joined = string.Join(", ", names); Console.WriteLine(joined); Follow : How to join strings in LINQ? var names = employees.Select(e… => e.Name); string joined = string.Join(", ", names);…

Explain a bit more

Console.WriteLine(joined); Follow : How to join strings in LINQ? var names = employees.Select(e => e.Name); string joined = string.Join(", ", names); Console.WriteLine(joined); Follow :

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
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