21 real DbContext & Sets questions from the EF Core bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.
1. What is DbContext?
Junior
A.the primary class representing a session with the database, exposing entity collections and tracking changes to objects
B.the overridable method where a context selects its provider and connection string when options are not injected externally
C.the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
D.the method that detects pending changes on tracked entities and writes them to the database within a single transaction
A.DbContext — the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
B.DbContext — a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
C.DbContext — the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation
D.DbContext — the primary class representing a session with the database, exposing entity collections and tracking changes to objects
A.DbSet<T> — the awaitable variant that persists pending changes without blocking the calling thread, returning the count of affected rows
B.DbSet<T> — a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
C.DbSet<T> — the method that detects pending changes on tracked entities and writes them to the database within a single transaction
D.DbSet<T> — the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
8. Which term means: "the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation"?
A.unit of work — a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
B.unit of work — the overridable method where a context selects its provider and connection string when options are not injected externally
C.unit of work — the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation
D.unit of work — the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
A.SaveChanges — the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
B.SaveChanges — the method that detects pending changes on tracked entities and writes them to the database within a single transaction
C.SaveChanges — the awaitable variant that persists pending changes without blocking the calling thread, returning the count of affected rows
D.SaveChanges — the overridable method where a context selects its provider and connection string when options are not injected externally
A.the overridable method where a context selects its provider and connection string when options are not injected externally
B.the primary class representing a session with the database, exposing entity collections and tracking changes to objects
C.the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
D.the awaitable variant that persists pending changes without blocking the calling thread, returning the count of affected rows
A.SaveChangesAsync — a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
B.SaveChangesAsync — the awaitable variant that persists pending changes without blocking the calling thread, returning the count of affected rows
C.SaveChangesAsync — the method that detects pending changes on tracked entities and writes them to the database within a single transaction
D.SaveChangesAsync — the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation
A.the primary class representing a session with the database, exposing entity collections and tracking changes to objects
B.the overridable method where a context selects its provider and connection string when options are not injected externally
C.the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
D.a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
A.OnConfiguring — the method that detects pending changes on tracked entities and writes them to the database within a single transaction
B.OnConfiguring — the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation
C.OnConfiguring — the primary class representing a session with the database, exposing entity collections and tracking changes to objects
D.OnConfiguring — the overridable method where a context selects its provider and connection string when options are not injected externally
A.the awaitable variant that persists pending changes without blocking the calling thread, returning the count of affected rows
B.a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
C.the overridable method where a context selects its provider and connection string when options are not injected externally
D.the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
20. Which term means: "the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance"?
A.DbContextOptions — the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation
B.DbContextOptions — the overridable method where a context selects its provider and connection string when options are not injected externally
C.DbContextOptions — the primary class representing a session with the database, exposing entity collections and tracking changes to objects
D.DbContextOptions — the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
Answers, AI explanations, and a scored voice mock interview
Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.