D
DevPrepSystematic Prep
DEVPREP CODEX · #19

Prisma Interview Questions

60 curated questions graded from Foundations (Easy) to Practical Patterns (Medium) and Internals & Architecture (Hard).

TOTAL QUESTIONS

60

THEORY QUESTIONS

60

IMPLEMENTATION FOLIOS

0

FREE QUESTIONS

5 / Level

Easy Level·20 Questions Total

Foundations & Core Concepts

Open Full Easy List
Q1What is Prisma and what are its components?
  • Type-safe ORM for Node/TypeScript: schema.prisma (single source of truth), Prisma Migrate (declarative migrations), Prisma Client (generated typed query builder), Studio (GUI).
  • Replaces hand-written SQL strings with autocomplete-checked APIs — runtime errors become compile errors.

Q2What does schema.prisma contain?

Three blocks:

  • datasource (provider postgres/sqlite/mysql, url from env).
  • generator (client output).
  • model definitions with fields, types, attributes (@id, @default, @relation, @@index, @@unique). Everything — DB shape AND client API — derives from this file.

Q3How do you define a one-to-many relation?
model Author {
  id    Int    @id @default(autoincrement())
  books Book[]
}
model Book {
  id       Int    @id @default(autoincrement())
  author   Author @relation(fields: [authorId], references: [id])
  authorId Int
}
  • Scalar FK field (authorId) explicit + @relation wiring; back-relation list on the other side.
  • onDelete defaults: required relation → Restrict, optional → SetNull.

Q4What is prisma generate and when must it run?
  • Reads schema producing typed client into node_modules/.prisma — run after ANY schema change (postinstall hook recommended in CI/deploy).
  • Forgetting it after pull/migrate = "Property X does not exist" TS errors — the classic first-week mistake.

Q5What CRUD basics does the client provide?
await prisma.user.create({ data: { email } });
await prisma.user.findUnique({ where: { email } });
await prisma.user.update({ where: { id }, data: { name } });
await prisma.user.deleteMany({ where: { inactive: true } });
findMany({ take, skip, orderBy, where })
  • All fully typed from schema; filters compose nested objects; unique fields enable findUnique.

15 More Easy Questions Locked

Unlock the complete Prisma Easy question bank

Get instant access to all 20 questions, in-depth model answers, code sandboxes, and all 27+ technologies for a single one-time payment.

Unlock All — One-time payment · Lifetime access
DEDICATED LEVEL PAGES

Browse All Prisma Questions by Difficulty

INTERNAL LINKING & DEPENDENCIES

Related Technologies to Prisma

CAREER PATHWAYS

Prisma is a key requirement for these engineering roles:

Prisma Interview Questions — Easy, Medium & Hard | DevPrep | DevPrep