Both which and what are used to ask questions and might be used interchangeably. However, there’s a slight distinctive difference.
When we have limited choices (e.g. two or three things to choose from), we usually prefer which.
- Which of the shoes should I wear? The blue or pink one?
- He asked which of my daughters was getting married.
- Which of the World Cup matches were you referring to?
We prefer the use of what when we have an unlimited number of possible answers.
- What is your name?
- What is your opinion on this issue?
Apart from the above difference, we can use both in some general sentences, though it might depend on our knowledge of the question we want to ask—whether it has limited or unlimited answers.
- What plants grow better in the tropical regions?
- Which plants grow better in the tropical regions?