I know these both mean "to ask" but would you use these in different circumstances or are they interchangeable?
What is the difference between preguntar and pedir?
They are not interchangeable.
Preguntar= to ask (as in a question)
Por ejemplo: preguntar algo a alguien = to ask somebody something (a question)
Pedir=to ask for (as in a request)
Por ejemplo: pedir algo a alguien = to ask somebody for something (a drink of water)
Here's a link to study the differences a bit more.
p.s I got these examples straight from SpanishDict's dictionary.