I have been asked these question in interviews...
1.How iis recognize that which web application we are requesting?
2.How iis recognize that web application is developed in which language?
Can anyone explain them in detail...
I am not going to cover the territory of what a web application is because that is not your question, so throughout this answer I will use the terms web application or virtual directory interchangeably. If you want to know more about what a web application is on IIS, then this article from an official MS site on IIS: Understanding Sites, Applications, and Virtual Directories on IIS 7 will be of assistance. While the title does say IIS7, it also delves into IIS6.
Keeping it simple, the request you make to the server has the virtual directory included in it, or IIS will already be configured to map the request to a specific virtual directory. If your requested URL looks like this:
http://someServer/myWebSite/default.aspx
then the myWebSite part of that url is the virtual directory and IIS knows exactly how to handle that because it is mapped directly to a folder on the file system. But like i said, that is just the simplistic approach, and is the one you are probably using to access your own web applications on your dev machine or on your company intranet. There is also another way to find the virtual directory from the url - with host headers. When you make a request to a (IIS based) website across the internet, it is most likely to be hosted on the same web server with dozens or even hundreds of other websites. In this case host header bindings are used to map the request to a specific web site / web application. You can read up about host headers work in this article: HOWTO: IIS 6 Request Processing Basics, Part 2 - Web Site, Virtual Directory, and Web Application.
The language of the page is specified in the page itself (in the aspx or ascx file). Whenever the app pool worker processes are started for the first time, or recycled (restarted) the web pages are recompiled, the language specified in the page or control is used as the guideline as to which compiler to use. The compiled code is then kept in temporary storage until files get changed and a recompilation needs to take place or the worker processes are recycled again.
If it is precompiled then it is not necessary to know the page language because it has already been compiled to an intermediate language called MSIL (Microsoft Intermediate Language, or more correctly CIL, Common Intermediate Language), this code is then JIT compiled to native code before being executed. (JIT compilation: simple explanation, wiki explanation, slightly more hardcore explanation).
If the web application has been ngen compiled then it is already in a native machine language, and therefore needs no compilation at all.