If it doesn't say which colour you add, there's more than one answer.
The scenario suggested above certainly works.
But there's also e.g.
Original ratio is 5:6
Final ratio is 1:2 which is equivalent to 5:10
Therefore 4 'parts' of yellow marbles have been added.
Therefore 1 'part' of yellow marbles = 7
Therefore you started off with 35 purple and 42 yellow, added 28 yellow to get 35 purple and 70 yellow, i.e. 105 altogether.
Or:
Start off with 20 purple and 24 yellow.
Add 4 purple and 24 yellow to give 24 purple and 48 yellow.
Think those are the only 3 possibilities. Was this a multiple choice question? If there was only one choice of answer that worked, I suppose that's ok
But otherwise you have to make assumptions, which isn't ok.