A step-by-step solution can look like this (I didn't see the solution at the link):
(Well, no spoilers since a solution is already given by the OP)
Let's enumerate the conditions for better referencing:
(1) B works in department M and earns more than 20,000.
(2) Person who is 28 years old works in department Q.
(3) 32 years old person earns at least 20,000.
(4) The person who is 26 years old earns 25,000.
(5) A earns 15,000, but does not work in department N or P.
(6) Person who is 30 years old earns highest salary but does not work in department M and N.
(7) E does not work in department P or Q, and his age is not 32.
(8) The salary of D is less than 20,000.
Now, look at (8). We know that D's salary can be either 10000 or 15000. But the all 5 people earn different salaries, and from (5) we know that the sum of 15000 is already "taken" by A. Therefore, D earns 10000.
Then, we can deduce that neither A or D (which both earn less than 20000) can be 26 (from (4)), 30 (from (6), since the highest salary is 30000), or 32 (from (3)) years old. That means that A and D are 24 and 28 years old, in some order.
B can earn either 25000 or 30000. But from (1) we know that B works in M, and from (6) the person who earns 30000 does not work in M. That means that B cannot earn 30000, so B earns 25000 and (from (4)) is 26 years old.
For the remaining persons (C and E), there are 2 remaining age options left: 30 and 32 (since B is 26, and the ages 24 and 28 are taken by A and D). But from (7) we know that E is not 32, so E is 30, and C is 32. Now, since E is 30, we can say that E works in O (since from (7) E does not work in P or Q, and from (6) a 30-year-old person does not work in M or N). Also, E (being 30 years old) earns 30000, so C earns 20000 (this is the only remaining option).
A can now work in either N, P or Q (since M and O are already taken by B and E respectively). But from (5) we know that A does not work in N or P, so A works in Q and (from (2)) is 28 years old. Since A and D are 24 and 28 in some order, then D must be 24.
Well, now we used all the information provided. Our deductions can be summarised in the following table:
||N or P
||N or P
From there, we cannot in fact say if C or D works in N, there are insufficient data for this.