# What does it mean to "Bulkify" an Apex Trigger?

**Topic:** Apex Trigger · **Difficulty:** Easy · **Asked at:** TCS, Accenture, Deloitte · **Tags:** apex-trigger, trigger, bulkification, best-practices

Read it on the site: https://www.forcechallenges.com/interview-questions/what-does-it-mean-to-bulkify-an-apex-trigger

## Answer

Bulkifying means writing the trigger to handle up to 200 records per invocation (and more through chained chunks) efficiently, without hitting governor limits.

- No SOQL or DML inside `for` loops
- Collect Ids into Sets, query once, put results in Maps
- Collect records to modify into a List and run one DML after the loop
- Never assume `Trigger.new` has one record

```apex
Set<Id> accIds = new Set<Id>();
for (Contact c : Trigger.new) accIds.add(c.AccountId);
Map<Id, Account> accs = new Map<Id, Account>([SELECT Id, Name FROM Account WHERE Id IN :accIds]);
```

---
Source: ForceChallenges · last updated 2026-10-21
