TypeScript Utility Types: Pick, Omit, Partial, Record (Practical Guide)
A deep, interview-ready guide to TypeScript utility types: Pick/Omit/Partial/Required/Readonly/Record, common patterns, and how to avoid over-complicating types.
On this page
Utility types help you reuse and transform types without duplicating definitions.
Interviews like these because they show you can keep types DRY and accurate.
1) Pick
Pick selects a subset of properties.
type User = { id: string; email: string; name: string };
type UserPreview = Pick<User, 'id' | 'name'>;Use case:
- list views that only need a subset
2) Omit
Omit removes properties.
type UserWithoutEmail = Omit<User, 'email'>;Use case:
- removing sensitive fields for public APIs
3) Partial / Required
type PatchUser = Partial<User>; // all optional
type FullUser = Required<Partial<User>>; // all required againUse cases:
- PATCH endpoints:
Partial - internal “complete” objects:
Required
4) Readonly
type ReadonlyUser = Readonly<User>;Use case:
- preventing accidental mutation
5) Record
Record defines an object with specific key and value types.
type Role = 'admin' | 'user';
type RoleLabels = Record<Role, string>;
const labels: RoleLabels = {
admin: 'Admin',
user: 'User'
};Use case:
- mapping known keys to values
6) Interview patterns
Pattern A: API DTO types
type UserDTO = Pick<User, 'id' | 'email'>;Pattern B: Form types
type UserForm = Omit<User, 'id'>;Pattern C: Updates
type UpdateUser = Partial<Omit<User, 'id'>>;7) Avoid over-typing
Don’t create 10 layers of utility types if it becomes unreadable.
If a type is too complex, consider:
- explicit type alias for clarity
- validation schemas (Zod)
Summary
- Pick/Omit reshape existing types.
- Partial/Required control optionality.
- Record is perfect for key-value maps.
- Keep utility type usage readable.
Looking for structured, offline interview prep?
Free online lessons • Portable Amazon Kindle / Paperback
Frontend Interview Guide (2025 Edition)
By Rajesh Dhiman
Comprehensive preparation covering React internals, Web Performance, CSS architecture, and system design questions.
JavaScript Interview Guide
By Rajesh Dhiman
Deep dive into the Event Loop, microtask draining, closures, prototypal inheritance, and asynchronous execution patterns.
Note: All lessons on Frontend Interview remain completely free to read online. As an Amazon Associate, we may earn from qualifying purchases.
Written by Rajesh Dhiman
Authored by Rajesh Dhiman and engineered at Eunix Tech. Focused on deep-dive frontend engineering, JavaScript runtime internals, React architecture, and web performance.