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 1051–1075 of 3281

Career & HR topics

By tech stack

Popular tracks

Mid PDF
How to manually mark an entity as Modified / Detached etc.?

Short answer: context.Entry(entity).State = EntityState.Detached; This is helpful when: You’re updating data without reloading it Working with disconnected scenarios (e.g., APIs) Example code Use the Entry() method: cont…

EF Core Read answer
Mid PDF
How is concurrency handled?

Short answer: What is optimistic concurrency vs pessimistic concurrency? Optimistic concurrency: Assumes that conflicts are rare. EF checks for changes before saving using concurrency tokens. Pessimistic concurrency: Loc…

EF Core Read answer
Mid PDF
What are the types of relationships in relational databases?

Short answer: EF Core supports the standard types of relationships: One-to-One (1:1) – One entity has one related entity. One-to-Many (1:N) – One entity relates to many others. Many-to-Many (M:N) – Many entities relate t…

EF Core Read answer
Mid PDF
How to configure a one-to-one relationship in EF Core?

Short answer: Example using Fluent API: modelBuilder.Entity<User>() .HasOne(u => u.Profile) .WithOne(p => p.User) .HasForeignKey<Profile>(p => p.UserId); Or with data annotations: public class Profil…

EF Core Read answer
Mid PDF
How to configure a one-to-many relationship?

Short answer: Fluent API: modelBuilder.Entity<Blog>() .HasMany(b => b.Posts) .WithOne(p => p.Blog) .HasForeignKey(p => p.BlogId); Data annotations: public class Post { public int BlogId { get; set; } [Fore…

EF Core Read answer
Mid PDF
How to configure many-to-many (EF Core 5+)?

Short answer: In EF Core 5.0+, you can define many-to-many relationships without an explicit join entity: public class Student Example code { public ICollection<Course> Courses { get; set; } } public class Course {…

EF Core Read answer
Mid PDF
What are join tables / linking tables?

Short answer: join table maps a many-to-many relationship. In EF Core: ✅ Auto-created (EF Core 5+): If you define many-to-many with ICollection<T>, EF creates the join table. { Example code public int StudentId { g…

EF Core Read answer
Mid PDF
What are join tables / linking tables?

Short answer: How to represent them in EF Core? A join table maps a many-to-many relationship. In EF Core: ✅ Auto-created (EF Core 5+): If you define many-to-many with ICollection<T>, EF creates the join table. 🛠…

EF Core Read answer
Mid PDF
What are foreign keys and primary keys?

Short answer: How to define them via annotations & Fluent API? Explain a bit more Primary Key (PK): Unique identifier of a record. Foreign Key (FK): A field that references a PK in another table. Data Annotations: [K…

EF Core Read answer
Mid PDF
What are shadow keys / foreign keys?

Short answer: A shadow property is a property not defined in the .NET class but exists in the EF model. Example code modelBuilder.Entity<Post>() .HasOne<Blog>() .WithMany() .HasForeignKey("BlogId");…

EF Core Read answer
Mid PDF
How to handle required vs optional relationships?

Short answer: In Fluent API: Required: .HasRequired(p => p.Blog) Optional: .HasOne(p => p.Blog) .WithMany() .IsRequired(false); EF infers: Reference type (e.g., Blog) → optional by default Non-nullable value type F…

EF Core Read answer
Mid PDF
What performance implications are there for eager vs lazy loading?

Short answer: Loading Type Pros Cons Eager Fewer queries, good for large data sets Loads everything even if not used Lazy Loads only when needed Risk of N+1 queries, more round-trips Explicit Fine-grained control More co…

EF Core Read answer
Mid PDF
Can you disable lazy loading? How?

Short answer: Yes. You can disable lazy loading globally: options.UseLazyLoadingProxies(false); Or don't install the proxy package at all. You can also disable it for specific navigation properties by not making them vir…

EF Core Read answer
Mid PDF
Can you disable lazy loading?

Short answer: How? Yes. You can disable lazy loading globally: options.UseLazyLoadingProxies(false); Or don't install the proxy package at all. You can also disable it for specific navigation properties by not making the…

EF Core Read answer
Mid PDF
How does LINQ translate to SQL?

Short answer: EF Core translates LINQ queries into SQL using expression trees. Only supported LINQ operators and expressions can be translated. Limitations: Certain C# methods or complex expressions cannot be translated…

EF Core Read answer
Mid PDF
How does LINQ translate to SQL?

Short answer: What limitations are there? EF Core translates LINQ queries into SQL using expression trees. Only supported LINQ operators and expressions can be translated. Limitations: Certain C# methods or complex expre…

EF Core Read answer
Mid PDF
Difference between IQueryable<T> and IEnumerable<T> in EF Core.?

Short answer: IQueryable&lt;T&gt;: Represents a query against the data source. Query is translated to SQL and executed on the database. Supports deferred execution. IEnumerable&lt;T&gt;: Represents an in-memory collectio…

EF Core Read answer
Mid PDF
How to write joins (inner, left) in LINQ with EF Core?

Short answer: Inner join Example code var query = from c in context.Customers join o in context.Orders on c.Id equals o.CustomerId select new { c.Name, o.OrderDate }; Left join (using DefaultIfEmpty()): var query = from…

EF Core Read answer
Mid PDF
How to do grouping, aggregation (Sum, Count, Max, Min) via LINQ?

Short answer: var groupedData = context.Orders .GroupBy(o =&gt; o.CustomerId) .Select(g =&gt; new { CustomerId = g.Key, TotalOrders = g.Count(), TotalAmount = g.Sum(o =&gt; o.Amount), MaxAmount = g.Max(o =&gt; o.Amount),…

EF Core Read answer
Mid PDF
How to do filtering (Where), ordering (OrderBy, ThenBy, OrderByDescending)?

Short answer: Filtering: var filtered = context.Products.Where(p =&gt; p.Price &gt; 100); Ordering: var ordered = context.Products .OrderBy(p =&gt; p.Category) .ThenByDescending(p =&gt; p.Price); Real-world example (Shop…

EF Core Read answer
Mid PDF
How to use First, FirstOrDefault, Single, SingleOrDefault etc.?

Short answer: First(): Returns the first element, throws if none found. FirstOrDefault(): Returns first element or default (null) if none. Single(): Returns the single element, throws if zero or more than one. SingleOrDe…

EF Core Read answer
Mid PDF
What about pagination? (Skip, Take)

Short answer: Use .Skip() and .Take() for pagination: var page2 = context.Products .OrderBy(p =&gt; p.Id) .Skip(10) // Skip first 10 .Take(10) // Take next 10 .ToList(); Use .Skip() and .Take() for pagination: var page2…

EF Core Read answer
Mid PDF
What about pagination?

Short answer: (Skip, Take) Use .Skip() and .Take() for pagination: var page2 = context.Products .OrderBy(p =&gt; p.Id) .Skip(10) // Skip first 10 .Take(10) // Take next 10 .ToList(); Real-world example (ShopNest) ShopNes…

EF Core Read answer
Mid PDF
How to do raw SQL queries in EF Core? (FromSqlRaw, etc.)

Short answer: Use FromSqlRaw() or FromSqlInterpolated(): var products = context.Products .FromSqlRaw(&quot;SELECT * FROM Products WHERE Price &gt; {0}&quot;, 100) .ToList(); Use FromSqlRaw() or FromSqlInterpolated(): var…

EF Core Read answer
Mid PDF
How to do raw SQL queries in EF Core?

Short answer: (FromSqlRaw, etc.) Use FromSqlRaw() or FromSqlInterpolated(): var products = context.Products .FromSqlRaw(&quot;SELECT * FROM Products WHERE Price &gt; {0}&quot;, 100) .ToList(); Real-world example (ShopNes…

EF Core Read answer

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: context.Entry(entity).State = EntityState.Detached; This is helpful when: You’re updating data without reloading it Working with disconnected scenarios (e.g., APIs)

Example code

Use the Entry() method: context.Entry(entity).State = EntityState.Modified;

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: What is optimistic concurrency vs pessimistic concurrency? Optimistic concurrency: Assumes that conflicts are rare. EF checks for changes before saving using concurrency tokens. Pessimistic concurrency: Locks records in the DB to prevent other updates (not supported out-of-the-box in EF Core). EF Core supports optimistic concurrency using [ConcurrencyCheck] or [Timestamp].

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: EF Core supports the standard types of relationships: One-to-One (1:1) – One entity has one related entity. One-to-Many (1:N) – One entity relates to many others. Many-to-Many (M:N) – Many entities relate to many others. Each of these can be configured in EF Core using navigation properties and Fluent API or Data Annotations.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: Example using Fluent API: modelBuilder.Entity<User>() .HasOne(u => u.Profile) .WithOne(p => p.User) .HasForeignKey<Profile>(p => p.UserId); Or with data annotations: public class Profile

Example code

{ [Key, ForeignKey("User")] public int UserId { get; set; }
public User User { get; set; }
} Requires a unique foreign key. EF assumes optional by default unless marked as required.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: Fluent API: modelBuilder.Entity<Blog>() .HasMany(b => b.Posts) .WithOne(p => p.Blog) .HasForeignKey(p => p.BlogId); Data annotations: public class Post { public int BlogId { get; set; } [ForeignKey("BlogId")] public Blog Blog { get; set; } } A foreign key exists in the many-side entity (Post). EF infers this relationship from navigation + FK.

Example code

Fluent API: modelBuilder.Entity<Blog>() .HasMany(b => b.Posts) .WithOne(p => p.Blog) .HasForeignKey(p => p.BlogId); Data annotations: public class Post
{
public int BlogId { get; set; } [ForeignKey("BlogId")] public Blog Blog { get; set; }
} A foreign key exists in the many-side entity (Post). EF infers this relationship from navigation + FK.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: In EF Core 5.0+, you can define many-to-many relationships without an explicit join entity: public class Student

Example code

{
public ICollection<Course> Courses { get; set; }
}
public class Course
{
public ICollection<Student> Students { get; set; }
} EF will automatically create a join table CourseStudent behind the scenes. If you want to customize the join table, define a join entity explicitly.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: join table maps a many-to-many relationship. In EF Core: ✅ Auto-created (EF Core 5+): If you define many-to-many with ICollection<T>, EF creates the join table. {

Example code

public int StudentId { get; set; }
public Student Student { get; set; }
public int CourseId { get; set; }
public Course Course { get; set; }
} nd configure with Fluent API.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: How to represent them in EF Core? A join table maps a many-to-many relationship. In EF Core: ✅ Auto-created (EF Core 5+): If you define many-to-many with ICollection<T>, EF creates the join table. 🛠 Manual (custom join entity): public class StudentCourse

Example code

{
public int StudentId { get; set; }
public Student Student { get; set; }
public int CourseId { get; set; }
public Course Course { get; set; }
} And configure with Fluent API.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: How to define them via annotations & Fluent API?

Explain a bit more

Primary Key (PK): Unique identifier of a record. Foreign Key (FK): A field that references a PK in another table. Data Annotations: [Key] public int Id { get; set; } [ForeignKey("Blog")] public int BlogId { get; set; } Fluent API: modelBuilder.Entity<Post>() .HasKey(p => p.Id); modelBuilder.Entity<Post>() .HasOne(p => p.Blog) .WithMany(b => b.Posts) .HasForeignKey(p => p.BlogId);

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: A shadow property is a property not defined in the .NET class but exists in the EF model.

Example code

modelBuilder.Entity<Post>() .HasOne<Blog>() .WithMany() .HasForeignKey("BlogId"); // BlogId is a shadow FK if not defined in class EF tracks it internally but you can't access it in C# code directly.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: In Fluent API: Required: .HasRequired(p => p.Blog) Optional: .HasOne(p => p.Blog) .WithMany() .IsRequired(false); EF infers: Reference type (e.g., Blog) → optional by default Non-nullable value type FK (e.g., int BlogId) → required Entity Framework Core – Lazy vs Eager vs Explicit Loading

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: Loading Type Pros Cons Eager Fewer queries, good for large data sets Loads everything even if not used Lazy Loads only when needed Risk of N+1 queries, more round-trips Explicit Fine-grained control More code complexity ✅ Eager is best for performance when you know you'll need related data. ❌ Lazy can hurt performance unless used carefully (e.g., in UI apps).

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: Yes. You can disable lazy loading globally: options.UseLazyLoadingProxies(false); Or don't install the proxy package at all. You can also disable it for specific navigation properties by not making them virtual. Yes. You can disable lazy loading globally: options.UseLazyLoadingProxies(false); Or don't install the proxy package at… all. You can also disable…… it for specific navigation properties by not making them…

Explain a bit more

virtual. Yes. You can disable lazy loading globally: options.UseLazyLoadingProxies(false); Or don't install the proxy package at all. You can also disable it for specific navigation properties by not making them virtual. Yes. You can disable lazy loading globally: options.UseLazyLoadingProxies(false); Or don't install the proxy package at… all. You can also disable it for specific navigation properties by not making them virtual.

Real-world example (ShopNest)

Loading orders with items uses .Include(o => o.Items). Without Include, listing 50 orders can trigger 50 extra queries (N+1).

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: How? Yes. You can disable lazy loading globally: options.UseLazyLoadingProxies(false); Or don't install the proxy package at all. You can also disable it for specific navigation properties by not making them virtual.

Real-world example (ShopNest)

Loading orders with items uses .Include(o => o.Items). Without Include, listing 50 orders can trigger 50 extra queries (N+1).

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: EF Core translates LINQ queries into SQL using expression trees. Only supported LINQ operators and expressions can be translated. Limitations: Certain C# methods or complex expressions cannot be translated and cause runtime exceptions. Client-side evaluation may occur, which can hurt performance. Use .AsEnumerable() to switch to client-side processing intentionally.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: What limitations are there? EF Core translates LINQ queries into SQL using expression trees. Only supported LINQ operators and expressions can be translated. Limitations: Certain C# methods or complex expressions cannot be translated and cause runtime exceptions. Client-side evaluation may occur, which can hurt performance. Use .AsEnumerable() to switch to client-side processing intentionally.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: IQueryable<T>: Represents a query against the data source. Query is translated to SQL and executed on the database. Supports deferred execution. IEnumerable<T>: Represents an in-memory collection. LINQ operators execute in memory. Usually results after the query has executed and data is loaded.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: Inner join

Example code

var query = from c in context.Customers join o in context.Orders on c.Id equals o.CustomerId select new { c.Name, o.OrderDate }; Left join (using DefaultIfEmpty()): var query = from c in context.Customers join o in context.Orders on c.Id equals o.CustomerId into orders from o in orders.DefaultIfEmpty() select new { c.Name, OrderDate = o != null ? o.OrderDate : (DateTime?)null };

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: var groupedData = context.Orders .GroupBy(o => o.CustomerId) .Select(g => new { CustomerId = g.Key, TotalOrders = g.Count(), TotalAmount = g.Sum(o => o.Amount), MaxAmount = g.Max(o => o.Amount), MinAmount = g.Min(o => o.Amount) });

Example code

var groupedData = context.Orders .GroupBy(o => o.CustomerId) .Select(g => new { CustomerId = g.Key, TotalOrders = g.Count(), TotalAmount = g.Sum(o => o.Amount), MaxAmount = g.Max(o => o.Amount), MinAmount = g.Min(o => o.Amount) });

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: Filtering: var filtered = context.Products.Where(p => p.Price > 100); Ordering: var ordered = context.Products .OrderBy(p => p.Category) .ThenByDescending(p => p.Price);

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: First(): Returns the first element, throws if none found. FirstOrDefault(): Returns first element or default (null) if none. Single(): Returns the single element, throws if zero or more than one. SingleOrDefault(): Returns the single element or default if none; throws if more than one.

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: Use .Skip() and .Take() for pagination: var page2 = context.Products .OrderBy(p => p.Id) .Skip(10) // Skip first 10 .Take(10) // Take next 10 .ToList(); Use .Skip() and .Take() for pagination: var page2 = context.Products .OrderBy(p => p.Id) .Skip(10) // Skip first 10 .Take(10) // Take next 10 .ToList(); Real-world example… (ShopNest) ShopNest’s order…… service uses EF Core to save an Order and its line items in one…

Explain a bit more

SaveChangesAsync() call inside a transaction. Use .Skip() and .Take() for pagination: var page2 = context.Products .OrderBy(p => p.Id) .Skip(10) // Skip first 10 .Take(10) // Take next 10 .ToList(); Use .Skip() and .Take() for pagination: var page2 = context.Products .OrderBy(p => p.Id) .Skip(10) // Skip first 10 .Take(10) // Take next 10 .ToList(); Real-world example… (ShopNest) ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: (Skip, Take) Use .Skip() and .Take() for pagination: var page2 = context.Products .OrderBy(p => p.Id) .Skip(10) // Skip first 10 .Take(10) // Take next 10 .ToList();

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: Use FromSqlRaw() or FromSqlInterpolated(): var products = context.Products .FromSqlRaw("SELECT * FROM Products WHERE Price > {0}", 100) .ToList(); Use FromSqlRaw() or FromSqlInterpolated(): var products = context.Products .FromSqlRaw("SELECT * FROM Products WHERE Price > {0}", 100) .ToList(); Use FromSqlRaw() or FromSqlInterpolated(): var products = context.

Explain a bit more

Products .FromSqlRaw("SELECT * FROM Products WHERE Price > {0}", 100) .ToList(); Use FromSqlRaw() or FromSqlInterpolated(): var products = context.Products .FromSqlRaw("SELECT * FROM Products WHERE Price > {0}", 100) .ToList();

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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

Entity Framework Core Entity Framework Core Tutorial · EF Core

Short answer: (FromSqlRaw, etc.) Use FromSqlRaw() or FromSqlInterpolated(): var products = context.Products .FromSqlRaw("SELECT * FROM Products WHERE Price > {0}", 100) .ToList();

Real-world example (ShopNest)

ShopNest’s order service uses EF Core to save an Order and its line items in one SaveChangesAsync() call inside a transaction.

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