The word what functions as pronoun and determiner in sentences. Occasionally, it can also function as noun, adverb, and interjection.
1. What as pronoun
What 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.)
What do you want?
What’s the best place to shop for local artefacts?
I’m embarrassed at what happened at the party. [Indirect question. It’s also known as wh-noun clause]
I don’t know what to say. [Indirect question. It’s a non-finite clause though]
2. What as determiner
What 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:
What day was it? [What modifies the noun day, narrowing down the options to a particular day, and it comes immediately before it]
What evidence has the police got against me?
The College wants to know what factors students weigh in while shortlisting colleges. [Indirect question. It’s also known as wh-noun clause]
I don’t know what factors to take into account. [Indirect question. It’s a non-finite clause though]
Some mistakenly treat what 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. What, for example, functions as interrogative pronoun and determiner.
If you noticed, what introduces only one dependent clause – noun clause. Since it doesn’t introduce relative clause, it’s not a relative pronoun. And since it doesn’t introduce adverb clause, it’s not a subordinating conjunction.
3. What as noun
What can sometimes function as a noun. Examples:
We’ve to find out the what and why behind this conspiracy.
This is a book on what and how of human longevity.
4. What as adverb
What can sometimes function as an adverb. Examples:
What waste of talent! [Adverb of degree: What shows the degree of waste.]
What with the bad weather, the helicopter unsurprisingly went down. [Adverb of reason: What with is used to show the reason for a particular situation.]
5. What as interjection
What can sometimes function as an interjection to express surprise or disbelief. It can also be used to ask what the other person wants. Examples:
What! The match has been called off. [Surprise]
What! I don’t have time at the moment. [What do you want?]
Summary
What mainly functions as pronoun and determiner, but it can sometimes play other roles such as noun, adverb, and interjection:
What would you like to have in lunch? [Interrogative pronoun]
You didn’t tell what you would like to have in lunch. [Interrogative pronoun in an indirect question (noun clause)]
What type of food do you like in lunch? [Interrogative determiner]
You didn’t tell what type of food you like in lunch. [Interrogative determiner in an indirect question (noun clause)]
I’m too hungry to be interested in what and how of the lunch. [Noun]
What a delicious dessert! [Adverb]
What! No food will be served tonight. [Interjection]