Well, even if a class does not have getters and setts it does not mean there are no other methods in the class that could modify its state. After all if they are in the class is because the class needs them to carry out any kind of task. So, chances are that other methods could modify the state of a class as part of their responsibility.
For instance, if your class was a bank account class, probably there is no method to set the balance of an account directly, but maybe there are methods that accept transactions like withdrawals or deposits which would ultimately modify the state of the class internally.
So this is really a bad question from the begining, because without enough context the answer is difficult. Reflection could be an option, but if you are using a security manager, that may prevent reflection from modifying private fields, so that may also be a wrong answer.
So, you see, the question is not good enough and without context it makes no sense. Based on the detail that you were given, perhaps the answer to the question should have been another question like:
Why would you like to modify the private fields of a class? After all they are private for a reason. So, basically if you find you need to change them, what you need to do is to sit down and reconsider you design and determine if your class does not have the proper public interface.
That answer could lead the interviewer to give you more context and then you can provide the appropriate answer. For instance, now the interviewer could say that the class is part of a third-party framework and you do not have the source code for it, so it is not possible to provide getters/setter methods but you are forced to read/wrtite some private state of a given object of this framework as workaround to solve some issue.
Now, you would have more context and you could ask another question, like: are you using a security manager on this application? If he/she says no, then you can say, well in that case, reflection is an option.....