Absolutely.
Always ask for time.
The idea that you should always be answering on the spot was propagated by candidates through peer practice, not interviewers.
Interviewers don't expect you to answer on the spot.
Here's also a resource you might find useful for brainstorming question focusing specifically on the different techniques you can use:
Best,
Cristian