Sunday, March 20, 2011

HCL Written Qns

1) Write a C# program such that all zeroes in the array should be at left side and all ones should be at right side.
a = { 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0 }

static void Main(string[] args)
{
int[] a = { 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0 };

for (int i = 0; i < a.Length - 1; ++i)
{
for (int j = 0; j < a.Length - i - 1; ++j)
{
if (a[j] > a[j + 1])
{
int Temp = 0;
Temp = a[j + 1];
a[j + 1] = a[j];
a[j] = Temp;
}
}
}
Console.Write("a = {");
for (int k = 0; k <= a.Length - 1; k++)
{
Console.Write(a[k].ToString() + " ");
}
Console.Write("}");
Console.WriteLine("\n");
}



2) Find the 6th highest salary from Employee Table?


3) What is the functionality of the following..
  1. inetinfo.exe
  2. aspnet_isapi.dll
  3. aspnet_wp.exe
inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes care of it by passing the request to the actual worker process aspnet_wp.exe. Worker process process the request and send back response to browser.
    4) What is the difference between session and application object?


    5) Constructor of child class first calls ___Constructor_______________ of the parent class.


    6) Interface members by default _____Public_____________ and ______abstract__________


    7) a = {1,2,3,4,5,6,6,7,8,9,10}
    Without comparing each cell with the other, how can you find duplicate number in the given array?


    8) What is difference between web.config and global.asax?


    Global.asax
    The Global.asax file, also known as the ASP.NET application file, is an optional file that contains code for responding to application-level events raised by ASP.NET or by HTTP modules. The Global.asax file resides in the root directory of an ASP.NET based application. At run time, Global.asax is parsed and compiled into a dynamically generated .NET Framework class derived from the HttpApplication base class. The Global.asax file itself is configured so that any direct URL request for it is automatically rejected. External users cannot download or view the code written within it.


    Web.Config
    The Web.Config is an XML based file that contains configuration information for ASP.NET resources. This file contains information about how the server will handle your application. You can set options for security, permissions, tracing, etc in this file.


    9) Write a query on Employee table which gives the employees who have atleast two phone numbers?
    Also write a query which gives the employees who have no phone number?





    No comments:

    Post a Comment

    Note: Only a member of this blog may post a comment.