The word which functions as pronoun and determiner in sentences.
1. Which as pronoun
Which can be an interrogative or a relative pronoun.
1.1 Interrogative pronoun
Which can function as an interrogative pronoun. An interrogative pronoun (who, whom, whose, what, and which) is a pronoun used to ask direct or indirect questions. Examples:
(Comments are in square brackets.)
Which is the best book you read last year?
“Which is the best restaurant in the town?” Sam asked.
We’ll soon find which is more efficacious vaccine. [Indirect question. It’s also known as wh-noun clause]
I don’t know which to pick. [Indirect question. It’s a non-finite clause though]
Some mistakenly treat which introducing a noun clause as subordinating conjunction. That’s because, in common parlance, the term subordinating conjunction is associated with any word that joins a dependent clause to an independent clause. But in noun clauses, none of wh-elements (how, when, where, why, who, whom, whose, what, which) is a subordinating conjunction. They are either interrogative adverb, interrogative pronoun, or interrogative determiner. Which, for example, functions as interrogative pronoun and determiner.
1.2 Relative pronoun
Which can also be used as relative pronoun, where it’s not a question word. Examples:
The house which was leaning dangerously after the recent flood was razed down by the municipal corporation. [Relative clause has been underlined]
Some mistakenly treat which introducing relative clauses as subordinating conjunction. This error though is less common than the one in noun clause. But which, in this role, is a pronoun – relative pronoun – and not conjunction.
2. Which as determiner
Which can function as an interrogative determiner. (Some grammar books term it as interrogative adjective.) An interrogative determiner (what, which, and whose), while asking a direct or indirect question, modifies a noun and is placed immediately before it. Examples:
Which ice-cream do you prefer? [Which modifies the noun ice-cream, narrowing down the options to a particular ice-cream, and it comes immediately before it]
“Which restaurant would you recommend for dinner?” Sam asked.
I can’t decide which option will be better. [Indirect question. It’s also known as wh-noun clause]
I don’t know which route to take. [Indirect question. It’s a non-finite clause though]
If you noticed, which introduces two dependent clauses – relative and noun clause. Since it doesn’t introduce adverb clause, it’s not a subordinating conjunction.
Summary
Which functions as pronoun (interrogative and relative) and determiner:
Which is your favorite story? [Interrogative pronoun]
I can’t decide which is my favorite story. [Interrogative pronoun in an indirect question (noun clause)]
I like stories which have setting in countryside. [Relative pronoun]
Which story is your favorite? [Interrogative determiner]
I can’t decide which story is my favorite. [Interrogative determiner in an indirect question (noun clause)]