Plant A produced 450, 520 and 600 units over three years, and Plant B produced 300, 390 and 480 units. What is B's total output as a percentage of A's, and in which year was B's output closest to A's?
B's total (1,170) is about 74.52% of A's total (1,570). Year by year, B/A is 66.7%, 75% and 80%, so B came closest to A in the third year, even though the gap in units (120) was smallest in the first and third years.
Explain it simply
DI questions often ask "X as a percentage of Y". The thing after "of" is always the base, the denominator. Another trap is "closest": it can mean the smallest gap in units or the highest ratio. Read which one the question means; when it says "as a share" or "relative", use the ratio.
Example
Data:
| Year | Plant A | Plant B | B/A |
|---|---|---|---|
| 1 | 450 | 300 | 66.67% |
| 2 | 520 | 390 | 75.00% |
| 3 | 600 | 480 | 80.00% |
| Total | 1,570 | 1,170 | 74.52% |
- B as % of A = 1,170 / 1,570 x 100 = 74.52%.
- Highest ratio B/A: year 3 (80%).
- Gaps in units: 150, 130, 120. So by the unit gap, year 3 is also the closest; by ratio it is clearly year 3.
const A = [450, 520, 600], B = [300, 390, 480];
const sum = a => a.reduce((x, y) => x + y);
console.log(((sum(B) / sum(A)) * 100).toFixed(2)); // Output: 74.52
console.log(B.map((b, i) => ((b / A[i]) * 100).toFixed(1))); // Output: ["66.7","75.0","80.0"]What to say in the interview
"The base is whatever comes after 'of', so it's 1,170 over 1,570, about 74.5%. For 'closest' I compare ratios year by year, and B reached 80% of A in year 3."
Common mistakes
- Dividing A by B (134%) when the question asks for B as a percentage of A.
- Averaging the yearly percentages (73.9%) instead of dividing the totals.