# Write a SOQL query on a Junction Object (Job_Application__c) to fetch details from both Master objects (Candidate__r.Name and Position__r.Title__c).

**Topic:** Development · **Difficulty:** Medium · **Asked at:** Infosys, Accenture, Capgemini · **Tags:** soql, scenario, junction, child-to-parent

Read it on the site: https://www.forcechallenges.com/interview-questions/write-a-soql-query-on-a-junction-object-job-application-c-to-fetch-details-from-both-master-objects-candidate

## Answer

The junction object has two master-detail (or lookup) fields, so query from the junction and traverse both parents with `__r`.

```soql
SELECT Id, Candidate__r.Name, Position__r.Title__c, Status__c
FROM Job_Application__c
```
This is child-to-parent traversal from the junction to each of its two masters.

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