Placement Aptitude (Quant, Logical, Verbal) Module 12 – Arrangements, relations and puzzles
Blood relations and family trees
Blood relations for aptitude tests: draw family trees from statements, decode coded relations, read photograph items and spot answers that stay open.
What you will learn
- Draw family trees from statements
- Decode coded relations such as 'A + B means A is B's father'
- Decide when a relation or a gender cannot be determined
What you’ll learn
What you will learn
- Draw family trees from statements
- Decode coded relations such as 'A + B means A is B's father'
- Decide when a relation or a gender cannot be determined
On this page
Blood relations questions describe a family in a few statements and ask how two people are related. The reliable method is to draw family trees with fixed symbols, one generation per row, and to name the relation only at the end, by reading the tree. Three traps decide most marks: a name does not fix a gender; a “pointing to a photograph” statement must be read outward from the speaker; and words such as cousin, nephew and sister-in-law depend on the generation and on whether the link is by birth or by marriage. When two different trees fit the statements and give different answers, the answer is “cannot be determined”. This lesson sets out the symbols and the kin terms, solves five examples, and runs a solver that builds each tree and tries every gender the statements leave open.
Symbols for family trees
Family trees drawn with the same symbols every time are quick to read. Draw a square for a male, an oval for a female and just the name when the gender is not given. A double line joins a married couple, a bar over a group joins brothers and sisters, and a vertical line runs from a couple or a parent down to the children. Keep each generation on its own row, so that counting rows gives the generation gap.
One generation per row, with a symbol for each kind of link
Text description of the diagram
The top row holds Ramesh, drawn as a square for a male, and Sita, drawn as an oval for a female, joined by a double line because they are married. A vertical line runs down from the couple to a bar that joins their two children, Arun and Meera, who are brother and sister. Meera is joined by a double line to her husband, Vikram. The bottom row holds Kiran, Arun's son, and Tara, the daughter of Meera and Vikram; a dotted label marks them as cousins. Read from the tree: Arun is Tara's uncle, Vikram is Arun's brother-in-law, and Ramesh is Kiran's grandfather. A legend shows the square for a male, the oval for a female, a name with no shape when the gender is not given, the double line for a married couple, the bar for brothers and sisters, and the vertical line from a parent to a child.
Kin terms by generation
| Generation | By birth | By marriage |
|---|---|---|
| Two above you | Grandfather, grandmother | |
| One above | Father, mother; uncle, aunt | Father-in-law, mother-in-law; an aunt’s husband, an uncle’s wife |
| Your own | Brother, sister; cousin | Husband, wife; brother-in-law, sister-in-law |
| One below | Son, daughter; nephew, niece | Son-in-law, daughter-in-law; a spouse’s nephew or niece |
| Two below | Grandson, granddaughter |
Most blood relations items need only this table. A cousin is a child of your aunt or uncle, so a cousin is in your own generation; a nephew is the son of your brother or sister, or of your husband’s or wife’s. A brother-in-law is your husband’s or wife’s brother, or your sister’s husband. Oxford’s learner’s dictionary labels “cousin brother” as informal Indian English; in an English test, write “cousin”.
Reading “pointing to a photograph” items
Read the chain from the speaker outward and replace each phrase with a person as soon as you know who it is. “My father’s only son”, said by a man, is the speaker himself; “my mother’s only daughter”, said by a woman, is the speaker herself. The speaker is often part of the chain, which is the trap.
Coded relations
A code such as “A + B means A is B’s father” is always read “A is B’s …”, left to right, one pair at a time. In “P # Q @ R”, with # meaning “is the brother of” and @ “is the mother of”, P is Q’s brother and Q is R’s mother, so P is R’s uncle. Writing each pair into the tree before naming anything keeps the direction straight.
When the answer cannot be determined
A name, or a word such as “child” or “sibling”, does not fix a gender. If the term asked for depends on it, as nephew and niece do, build one tree for each gender. The same answer from both is the answer; different answers mean “cannot be determined”.
Five solved examples
- A photograph. Pointing to a girl, Varun says, “She is the daughter of my father’s only son.” Varun is his father’s only son, so she is Varun’s daughter.
- A code. With # for “brother of” and @ for “mother of”, P # Q @ R makes P the brother of R’s mother: R’s uncle. R is P’s nephew or niece, since nothing gives R’s gender.
- A gender left open. “Neha’s mother is the only daughter of Sam’s father.” If Sam is a woman, she is that only daughter, so Sam is Neha’s mother. If Sam is a man, the daughter is Sam’s sister, and Sam is Neha’s uncle. Two trees, two answers: cannot be determined.
- Generations. Kiran’s father is the brother of Meera’s mother, so Kiran is the child of Meera’s uncle: her cousin, in her own generation.
- By marriage. Rina is the sister of Asha’s husband, and Tushar is Rina’s son. Tushar is the son of Asha’s husband’s sister: her nephew.
The solver builds each tree from the statements, finds the shortest chain of parent, child and spouse links between the two people with a breadth-first search, and names it.
// A small family-tree solver for the lesson's five solved examples: it builds the tree from the statements, finds the
// shortest chain of parent, child and spouse links between two people, and names it. When a gender that the
// statements leave open would change the name, it builds one tree for each gender and compares the answers.
/** A family tree: people with a gender ('M', 'F' or unknown), parents, children and a spouse. */
function family() {
const people = new Map();
const person = (name, gender) => {
if (!people.has(name)) people.set(name, { name, gender: null, parents: new Set(), children: new Set(), spouse: null });
const p = people.get(name);
if (gender) p.gender = gender;
return p;
};
const link = (child, parent) => {
person(child).parents.add(parent);
person(parent).children.add(child);
// A child's two parents are taken to be a married couple, as test items assume.
const [a, b] = [...person(child).parents];
if (b && !person(a).spouse && !person(b).spouse) {
person(a).spouse = b;
person(b).spouse = a;
}
};
return {
person,
/**
* `parent` is a parent of `child`; the parent's spouse is the child's other parent. If the child so far had only
* an unnamed parent shared with a brother or sister, this is that parent, now named.
*/
parentOf(parent, child, gender) {
person(parent, gender);
const unnamed = [...person(child).parents].find((q) => q.startsWith('the parent of '));
if (unnamed) {
for (const c of [...people.get(unnamed).children]) {
person(c).parents.delete(unnamed);
link(c, parent);
}
people.delete(unnamed);
} else link(child, parent);
const spouse = person(parent).spouse;
if (spouse) for (const c of person(parent).children) link(c, spouse);
},
/** A married couple shares every child. */
couple(husband, wife) {
person(husband, 'M').spouse = wife;
person(wife, 'F').spouse = husband;
for (const c of [...person(husband).children, ...person(wife).children]) {
link(c, husband);
link(c, wife);
}
},
/** Brothers and sisters share a parent; one is added, unnamed, if neither has a parent yet. */
siblings(a, b, genderOfA) {
person(a, genderOfA);
person(b);
const shared = [...person(a).parents, ...person(b).parents];
const parent = shared[0] ?? `the parent of ${a} and ${b}`;
link(a, parent);
link(b, parent);
},
people,
};
}
const TERMS = {
'up': ['father', 'mother', 'parent'],
'up up': ['grandfather', 'grandmother', 'grandparent'],
'down': ['son', 'daughter', 'child'],
'down down': ['grandson', 'granddaughter', 'grandchild'],
'up down': ['brother', 'sister', 'brother or sister'],
'up up down': ['uncle', 'aunt', 'uncle or aunt'],
'up down down': ['nephew', 'niece', 'nephew or niece'],
'up up down down': ['cousin', 'cousin', 'cousin'],
'spouse': ['husband', 'wife', 'spouse'],
'spouse up': ['father-in-law', 'mother-in-law', 'parent-in-law'],
'down spouse': ['son-in-law', 'daughter-in-law', 'child-in-law'],
'up down spouse': ['brother-in-law', 'sister-in-law', 'brother-in-law or sister-in-law'],
'spouse up down': ['brother-in-law', 'sister-in-law', 'brother-in-law or sister-in-law'],
'up up down spouse': ['uncle', 'aunt', 'uncle or aunt'],
'spouse up down down': ['nephew', 'niece', 'nephew or niece'],
};
/** "x is y's ___": the shortest chain of links from y to x (breadth-first), named from the table and x's gender. */
function relation(tree, x, y) {
const seen = new Map([[y, []]]);
const queue = [y];
while (queue.length) {
const at = queue.shift();
const p = tree.people.get(at);
const next = [...[...p.parents].map((q) => [q, 'up']), ...[...p.children].map((q) => [q, 'down']), ...(p.spouse ? [[p.spouse, 'spouse']] : [])];
for (const [q, step] of next) {
if (seen.has(q)) continue;
seen.set(q, [...seen.get(at), step]);
queue.push(q);
}
}
const path = (seen.get(x) ?? []).join(' ');
const names = TERMS[path];
if (!names) return `no single term (${path || 'the same person'})`;
const g = tree.people.get(x).gender;
return g === 'M' ? names[0] : g === 'F' ? names[1] : names[2];
}
// 1. Pointing to a girl, Varun says: "She is the daughter of my father's only son." Varun is a son of his father,
// and the only one, so "my father's only son" is Varun himself.
const t1 = family();
t1.parentOf("Varun's father", 'Varun', 'M');
t1.person('Varun', 'M');
t1.parentOf('Varun', 'the girl', 'M');
t1.person('the girl', 'F');
console.log(`1. The girl is Varun's ${relation(t1, 'the girl', 'Varun')}`);
// 2. Codes: A @ B means A is B's mother, A # B means A is B's brother. P # Q @ R: P is Q's brother, Q is R's mother.
const t2 = family();
t2.siblings('P', 'Q', 'M');
t2.parentOf('Q', 'R', 'F');
console.log(`2. P # Q @ R: P is R's ${relation(t2, 'P', 'R')}, and R is P's ${relation(t2, 'R', 'P')}`);
// 3. "Neha's mother is the only daughter of Sam's father." Sam's gender is not given, so build both trees.
const answers = [];
for (const g of ['M', 'F']) {
const t3 = family();
t3.parentOf("Sam's father", 'Sam', 'M');
t3.person('Sam', g);
// If Sam is a woman, she is a daughter of her father, so she is the only daughter; otherwise the daughter is
// someone else, Sam's sister.
const daughter = g === 'F' ? 'Sam' : "Sam's sister";
if (g === 'M') t3.parentOf("Sam's father", daughter, 'M');
t3.person(daughter, 'F');
t3.parentOf(daughter, 'Neha', 'F');
answers.push(`if Sam is ${g === 'M' ? 'a man' : 'a woman'}, Sam is Neha's ${relation(t3, 'Sam', 'Neha')}`);
}
console.log(`3. ${answers.join('; ')}: cannot be determined`);
// 4. Kiran's father is the brother of Meera's mother.
const t4 = family();
t4.parentOf("Kiran's father", 'Kiran', 'M');
t4.parentOf("Meera's mother", 'Meera', 'F');
t4.siblings("Kiran's father", "Meera's mother", 'M');
console.log(`4. Kiran is Meera's ${relation(t4, 'Kiran', 'Meera')}`);
// 5. Rina is the sister of Asha's husband, and Tushar is Rina's son.
const t5 = family();
t5.couple("Asha's husband", 'Asha');
t5.siblings('Rina', "Asha's husband", 'F');
t5.parentOf('Rina', 'Tushar', 'F');
t5.person('Tushar', 'M');
console.log(`5. Tushar is Asha's ${relation(t5, 'Tushar', 'Asha')}, and Asha is Tushar's ${relation(t5, 'Asha', 'Tushar')}`); Output
1. The girl is Varun's daughter 2. P # Q @ R: P is R's uncle, and R is P's nephew or niece 3. if Sam is a man, Sam is Neha's uncle; if Sam is a woman, Sam is Neha's mother: cannot be determined 4. Kiran is Meera's cousin 5. Tushar is Asha's nephew, and Asha is Tushar's aunt
Recorded with Node.js 24.21.0 on macOS 26 arm64. To run it yourself: mise exec node@24.21.0 -- node relations.mjs
Runs on this device, in your browser. The first run downloads JavaScript (about 0.6 MB), which is kept for the next runs.
Your run, in this browser
Your turn
The exercise names a relation from a chain of links; the ten questions after it are untimed.
Exercise · Medium · JavaScript
Name a relation from a chain of links
A relation can be written as the chain of links that leads from you to a relative: 'up' to a parent, 'down' to a child and 'spouse' to a husband or wife. Your father's sister is ['up', 'up', 'down']: up to your father, up to his parent, down to her. Write kinTerm(steps, gender), which names the relative, whose gender is 'M', 'F' or null for unknown.
- By birth: some
'up'steps, then some'down'steps, at most two of each. One up is a parent, two a grandparent; one down a child, two a grandchild; one up and one down a brother or sister; two up and one down an uncle or aunt; one up and two down a nephew or niece; two of each a cousin. - Your spouse's relatives:
'spouse'first, then a chain by birth: alone, husband or wife; then one up, father-in-law or mother-in-law; one up and one down, brother-in-law or sister-in-law; one up and two down, nephew or niece. - Your relatives' spouses: a chain by birth, then
'spouse': one down, son-in-law or daughter-in-law; one up and one down, brother-in-law or sister-in-law; two up and one down, uncle or aunt.
Return the male term for 'M', the female term for 'F', and both joined by ' or ' for null (but 'cousin' stays 'cousin'). Return null for any other chain, such as a 'down' before an 'up'.
Starter code · kin.mjs
/**
* steps: links from you to a relative ('up' to a parent, 'down' to a child, 'spouse'); gender: 'M', 'F' or null.
* Returns the relative's kin term, or null for a chain outside the rules of the exercise.
*/
export function kinTerm(steps, gender) {
// Replace this line with your code (this one only knows parents).
return gender === 'F' ? 'mother' : 'father';
} The sample tests · kin.test.mjs
import { test, assert } from 'mysmartcopilot:test';
import { kinTerm } from './kin.mjs';
test('one step up is a parent', () => {
assert.equal(kinTerm(['up'], 'M'), 'father');
});
test("your father's sister", () => {
assert.equal(kinTerm(['up', 'up', 'down'], 'F'), 'aunt');
});
test('a brother or sister of unknown gender', () => {
assert.equal(kinTerm(['up', 'down'], null), 'brother or sister');
});
test('a cousin is a cousin either way', () => {
assert.equal(kinTerm(['up', 'up', 'down', 'down'], 'F'), 'cousin');
});
test("your wife's mother", () => {
assert.equal(kinTerm(['spouse', 'up'], 'F'), 'mother-in-law');
});
test("your daughter's husband", () => {
assert.equal(kinTerm(['down', 'spouse'], 'M'), 'son-in-law');
});
test("your husband's brother and your brother's wife", () => {
assert.equal(kinTerm(['spouse', 'up', 'down'], 'M'), 'brother-in-law');
assert.equal(kinTerm(['up', 'down', 'spouse'], 'F'), 'sister-in-law');
});
test("your wife's sister's daughter", () => {
assert.equal(kinTerm(['spouse', 'up', 'down', 'down'], 'F'), 'niece');
});
test('a spouse of unknown gender', () => {
assert.equal(kinTerm(['spouse'], null), 'husband or wife');
});
test('chains outside the rules', () => {
assert.equal(kinTerm(['down', 'up'], 'M'), null);
assert.equal(kinTerm(['up', 'up', 'up'], 'M'), null);
assert.equal(kinTerm(['up', 'spouse', 'down'], 'F'), null);
}); A hint
First take off a 'spouse' step at the front or at the end, and remember which; a 'spouse' anywhere else means null. Then count the 'up' steps at the start and the 'down' steps after them; if anything is left over, return null. Three small tables, one for each case, keyed by the two counts, give the male and female terms.
Results of the sample tests
| Test | Result | Details |
|---|
What your code printed
The sample tests run on this device, in your browser (QuickJS): nothing is sent to mysmartcopilot.com. The first run downloads JavaScript (about 0.6 MB), which is kept for the next runs. A check in your browser is feedback for you, not proof that the code is right for every input.
Ten questions, untimed
10 questions about this lesson. Every answer and why it is right is on the page, behind “Show the answer”. Your score stays in this browser.
Twelve more relation items, with full working Pro: opens with a Pro, Premium or Ultimate pass
Relation items come in a few families: photographs, codes, chains through several generations, in-laws, and genders the text leaves open. The dozen below are new; every one is drawn as a tree, solved step by step and paired with the answer a careless reading gives.
In this part:
- Photograph statements, worked
- Coded relations, worked
- Chains, in-laws and cousins, worked
- Genders and family sizes, worked
1 runnable example (JavaScript) · about 3 minutes
Opening this part with your pass…
This part opens with any MySmartCoPilot pass.
- Pro pass · 1 week₹79$2.99
- 30 days₹179$5.99
- 1 year₹1,699$45
One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.
Passes can’t be bought right now, so this part can’t be opened at the moment. The free part above stands on its own. If you have a pass, enter your licence key.
It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).
Why the kin terms work, and how two trees expose an open answer Pro: opens with a Pro, Premium or Ultimate pass
Every kin term is a chain of parent, child and spouse links read in generations, and every “cannot be determined” is two trees that fit the same words. This part derives the terms from generation counts, reproduces the most common coding error, and measures how many people each tree needs.
In this part:
- Kin terms derived from generation counts, with the table
- A coding error reproduced: the code read backwards
- Two trees, one statement: the open answers, counted
- How many people a tree needs, measured
1 runnable example (JavaScript) · about 2 minutes
Opening this part with your pass…
This part opens with any MySmartCoPilot pass.
- Pro pass · 1 week₹79$2.99
- 30 days₹179$5.99
- 1 year₹1,699$45
One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.
Passes can’t be bought right now, so this part can’t be opened at the moment. The free part above stands on its own. If you have a pass, enter your licence key.
It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).
A ten-minute timed set, with answers and a rubric Pro: opens with a Pro, Premium or Ultimate pass
Give yourself ten minutes for the ten relation items below, sketching a tree for each one. Then go through the worked answers and find your band in the rubric.
In this part:
- Ten items for ten minutes
- Answers, with the shortest working and the trap
- A rubric for what your score says
1 runnable example (JavaScript) · about 3 minutes
Opening this part with your pass…
This part opens with any MySmartCoPilot pass.
- Pro pass · 1 week₹79$2.99
- 30 days₹179$5.99
- 1 year₹1,699$45
One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.
Passes can’t be bought right now, so this part can’t be opened at the moment. The free part above stands on its own. If you have a pass, enter your licence key.
It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).
Interview questions
-
Fresher · Warm-up
What decides whether a relative is your cousin or your nephew, and why are the two often confused?
The generation decides. A cousin is a child of your uncle or aunt, so a cousin is in your own generation: two steps up to a grandparent, then two steps down. A nephew or niece is a child of your brother or sister, or of your husband's or wife's, so one generation below you: one step up to a parent and two steps down. The two get confused because both are a child of someone on a side branch of the family, and in a hurry people stop counting generations. Drawing one generation per row settles it: a relative on your own row is a cousin, one row below is a nephew or niece. Kiran, whose father is the brother of Meera's mother, is on Meera's row, so he is her cousin.
-
Fresher
Pointing to a man, Ira says to her brother, "He is the son of the only son of my grandfather." How is the man related to Ira? Say what you have to assume, and show how the answer changes if the grandfather is her mother's father.
-
Fresher
When should you answer "cannot be determined" in a blood relations item? Make up a short statement whose answer depends on a gender the text never gives, show its two trees, and say how the options can change your decision.
-
Fresher
In a code, "A + B" means A is B's father and "A − B" means A is B's wife. A friend decodes "P + Q − R" as "R is Q's wife and Q is P's father". Find the error, give P's relation to R, and name a habit that prevents the slip.
Key takeaways
- Draw the tree first: squares, ovals, plain names for unknown genders, one generation per row.
- A cousin is in your own generation; a nephew or niece is one below.
- In photograph items the speaker is often in the chain; in codes, read every pair as “A is B’s …”.
- If two trees fit and disagree, the answer is “cannot be determined”.
References
- breadth-first search (Dictionary of Algorithms and Data Structures) (National Institute of Standards and Technology (NIST))
- cousin (noun), Oxford Advanced Learner’s Dictionary (Oxford University Press)
- cousin brother (noun, Indian English), Oxford Advanced Learner’s Dictionary (Oxford University Press)
- nephew (noun), Oxford Advanced Learner’s Dictionary (Oxford University Press)
- uncle (noun), Oxford Advanced Learner’s Dictionary (Oxford University Press)
- brother-in-law (noun), Oxford Advanced Learner’s Dictionary (Oxford University Press)
Related tools
Report a problem with this lesson
Kept only in this browser. Your Learn progress