Wednesday 25 December 2013

Interview Questions on web farm and web garden in Dot Net


Web Garden- Web application deployed on a server with multiple processors.
Web Farm- Web application deployed on multiple server.

Q : What is the difference between a web farm and a web garden?
Ans :Web Farm :-After developing our  web application we host it on IIS Server.  Now one standalone server is sufficient to process ASP.NET Request and response for a small web sites but when the site comes for big organization where there an millions of daily user hits then we need to host the sites on multiple Server. This is called web farms. Where single site hosted on multiple IIS Server and they are  running behind the Load Balancer.
Web Garden :-All IIS Request process by worker process ( w3wp.exe). By default each and every application pool contain single worker process. But An application pool with multiple worker process is called Web Garden.   Many worker processes with same Application Pool can sometimes provide better throughput performance and application response time. And Each Worker Process Should have there own Thread and Own Memory space.

Q : How to configure our web garden?
Right Click on Application Pool > Properties > GoTo Performance Tab 
In bottom Group Section  Increase the Worker Process Count.

Q : What is the restriction in web garden?
There are some Certain Restriction to use Web Garden with your web application. If we use Session Mode to "in proc", our application will not work correctly because session will be handled by different Worker Process. For Avoid this Type of problem we should have to use Session Mode "out proc" and we can use "Session State Server" or "SQL-Server Session State".

Q : What are the implications on Application and Session state variables in a web farm or a web garden?
Ans : In both a Web garden and a Web farm, client requests are directed to the ASP.NET process that is currently least busy. That means that a single client can interact with different CPUs or servers over the course of his or her session. This has the following implications for Application and Session state variables:
Q : Application state variables are unique to each separate instance of the Web application.
Ans :Clients can share information through Application state if the Web application is running on a Web garden or a Web farm.
Q : Session state variables are stored in-process by default.
Ans : To enable Session state in a Web garden or Web farm, you need to specify a Session state provider.
Q : How can you share Application State in a web farm or a web garden?
Ans : To share data across multiple sessions in a Web garden or Web farm, you must save and restore the information using a resource that is available to all the processes. This can be done through an XML file, a database, or some other resource using the standard file or database access methods.
Q : What are the two built-in ways provided by ASP.NET to share Session state information across a Web garden or Web farm?
Ans : ASP.NET provides two built-in ways to share Session state information across a Web garden or Web farm. You can share Session state using:

A state server, as specified by a network location
This technique is simple to implement and doesn’t require you to install Microsoft SQL Server.
A SQL database, as specified by a SQL connection
This technique provides the best performance for storing and retrieving state information.
Q : What are the steps to follow to share Session state information using a state server?
Ans : To share Session state information using a state server, follow these steps:
1. In the Web application’s Web.config file, set the sessionState element’s mode and stateConnectionString attributes.
2. Run the aspnet_state.exe utility on the Session state server. The aspnet_state.exe utility is installed in the \WINDOWS\Microsoft.NET \Framework\version folder when you install Visual Studio .NET Professional or Visual Studio .NET Enterprise Architect editions.
Q : What are the steps to follow to share Session state information using a SQL database?
Ans :To share Session state information using a SQL database, follow these steps:
1. In the Web application’s Web.config file, set the sessionState element’s mode and sqlConnectionString attributes.
2. Run the InstallSqlState.sql utility on the Session state server. This utility installs the SQL database that shares Session state information across processes. The InstallSqlState.sql utility is installed in the \WINDOWS\Microsoft.NET \Framework\version folder when you install Visual Studio .NET Professional, Visual Studio .NET Enterprise Developer, or Visual Studio .NET Enterprise Architect editions.

Q : What does the term Scalability mean?
Ans :scalability is the ability of a system, network, or process to handle a growing amount of work in a capable manner or its ability to be enlarged to accommodate that growth.For example, it can refer to the capability of a system to increase total throughput under an increased load when resources (typically hardware) are added. ASP.NET Web applications support this concept through their ability to run in multiple processes and to have those processes distributed across multiple CPUs and/or multiple servers.

C# program Selection Sorting

Selection sort is a straightforward sorting algorithm. This algorithm search for the smallest number in the elements array and then swap i...