Selecting 2 chairs out of 5: use two slots 5 x 4 = 20 possible permutations but divide by 1 x 2 = 2! because the order doesn't matter, which gives 10 possbile combinations.
Selecting 2 tables out of n (unknown): use two slots giving n(n-1) possible permutations but divide again by 2! because the order of selection doesnt matter, which gives n(n-1)/2 possible combinations.
Combine the two independent selections of chairs and tables by multiplying their possibilities:
10n(n-1)/2 = 150
Simplify: n(n-1) = 30
This is a quadratic equation in n. You can open the brackets and try to factorize it to find the roots but way faster is to simply plug in the answer choices and see which one work. The answer 6 gives 6 x 5 = 30 and is the correct one.
Alternatively, if you don't like algebra, you could have started plugging the anwers from the very begining. You would go through the same reasoning for the talbes and chairs but with numbers not variables like n and will see that only the answer 6 gives the target of 150 total combinations.