Development questions

How many levels deep can you traverse in a Child-to-Parent relationship query in SOQL? (Up to 5 levels, or 55 in newer API versions—explain both).

DevelopmentMediumSalesforceDeloittePwC

Child-to-parent traversal can go up to 5 levels deep using dot notation in a single path, e.g. Contact.Account.Parent.Owner.Manager.Name.

Separately, a query can reference many parent relationships overall: the documented limit for the total number of child-to-parent relationships in one query is 55 (a count of relationships, not depth). Mixing these up is a common interview mistake.

The exact numbers have changed across API versions, so confirm against the current SOQL limits documentation for your API version.

soqlrelationshipslimits