Sunday, February 14, 2010

Guide Line For Developing Good Asp.net Web application

The following are the some of the guidelines to create a good ASP.NET application.

1)      Disable session when not using it. This can be done at the application level in the "machine.config" file or at a page level.
2)      The in-proc model of session management is the fastest of the three options. SQL Server option has the highest performance hit.
3)    Minimize the amount and complexity of data stored in a session state. The larger and more complex the data is, the cost of serializing/deserializing of the data is higher (for SQL Server and State server options).
4)    Use Server.Transfer for redirecting between pages in the same application. This will avoid unnecessary client-side redirection.
5)    Choose the best suited session-state provider - In-process is the fastest option.
6)    Avoid unnecessary round-trips to the server - Code like validating user input can be handled at the client side itself.
7)    Use Page.IsPostback to avoid unnecessary processing on a round trip.
8)    Use server controls in appropriate circumstances. Even though are they are very easy toimplement, they are expensive because they are server resources. Sometimes, it is easier to use simple rendering or data-binding.
9)    Save server control view state only when necessary.
10) Buffering is on by default. Turning it off will slow down the performance. Don't code for string buffering - Response.Write will automatically buffer any responses without the need for the user to do it. Use multiple Response.Writes rather than create strings via concatenation,
especially if concatenating long strings.
11) Don't rely on exceptions in the code. Exceptions reduce performance. Do not catch the
exception itself before handling the condition.
// Consider changing this...
try { result = 100 / num;}
catch (Exception e) { result = 0;}
14
// to this...
if (num != 0)
result = 100 / num;
else
result = 0;

12) Use early binding in VB.NET and Jscript code. Enable Option Strict in the page directive to ensure that the type-safe programming is maintained.
13) Port call-intensive COM components to managed code. While doing Interop try avoiding lot of calls. The cost of marshalling the data ranges from relatively cheap (i.e. int, bool) to more expensive (i.e. strings). Strings, a common type of data exchanged for web applications, can be
expensive because all strings in the CLR are in Unicode, but COM or native methods may require other types of encoding (i.e. ASCII).
14) Release the COM objects or native resources as soon as the usage is over. This will allow other requests to utilize them, as well as reducing performance issues, such as having the GC release them at a later point.
15) Use SQL server stored procedures for data access.
16) Use the SQLDataReader class for a fast forward-only data cursor.
17) Datagrid is a quick way of displaying data, but it slows down the application. The other alternative, which is faster, is rendering the data for simple cases. But this is difficult to maintain. A middle of the road solution could be a repeater control, which is light, efficient,
customizable and programmable.
18) Cache data and page output whenever possible.
19) Disable debug mode before deploying the application.
20) For applications that rely extensively one external resource, consider enabling web gardening on multiprocessor computers. The ASP.NET process model helps enable scalability by distributing work to several processes, one on each CPU. If the application is using a slow
database server or calls COM objects that access external resources, web gardening could be a solution.
21) Enumerating into collections sometimes is more expensive than index access in a loop. This is because the CLR can sometimes optimize array indexes and bounds checks away in loops, but can't detect them in for each type of code.
22) JScript .NET allows methods within methods - to implement these in the CLR required a more expensive mechanism which can be much slower, so avoid them by moving inner methods to be just regular methods of the page.
23) Do a "pre-batch" compilation. To achieve this, request a page from the site.
24) Avoid making changes to pages or assemblies that are there in the bin directory of the application. A changed page will only recompile the page. Any change to the bin directory will result in recompile of the entire application.
25) The config file is configured to enable the widest set of features. For a performance boost it is better to tune it to the requirements. Some key points here are:
A)   Encoding - Request/Response - The default is UTF-8 encoding. If the site is completely ASCII,
change the option to ASCII encoder.
B) Session State - By default is ON. If session state is not maintained then the value should be changed to OFF.
26)   ViewState - Default is ON. Turn it off if not being used. If ViewState is being used there are different levels of security that need to be considered which can impact the performance of the application.
26) AutoEventWireup - Turning off AutoEventWireup means that the page will not try and match up method names to events and hook them up (i.e. Page_Load, etc). Instead, if the application
writer wishes to receive them, they need to override the methods in the base class (i.e. override
OnLoad for the page load event instead of using a Page_Load method). By doing so, the page will get a slight performance boost by not having to do the extra work itself, but leaving it to the page author.
27) For efficient debugging Use ASP.NET trace feature instead of Response.Write.

Wednesday, February 10, 2010

Mphasis Dotnet interview Questions

 Mphasis Dot net Interview Questions.
One of my friend  Rajeev chandra Recently  gone with mphasis interview  and I am posting those question here.
1)what is fall back through in .net?

2)can a class compile with out namespace?

3)by using xpath we cant find information in which scenereao?
items
 item id = "10" name='rajeev"
items/item/[@id = '@id'] -> in this scenereao one time xpath will be failed when?

4)how to not open a windows from if already a form is opened? different ways

5)i have a tree control in which i dupliacate item names.how you will fetch the data based on duplicate items?

6)emp rate emp salary
   1 1   1   10%
   2 5   2   20%
   3    7   3   25%
how to revise the empolyee salary based on rate?

7)i had a table and i have stored procedures and triggers on that table when i drop the table what about the remaining objects like trigger,stored procedures based on that table?
For HCL Interview Questions Click Here
For Satyam Interview Questions Click Here
For Deloitte Interview Questions Click Here 
Please Send ur Interview Experinces to my mail id : nsubhash007@gmail.com 
 

Monday, February 1, 2010

Sharepoint Interview Questions of Top MNC

Hi Friends I gather some SharePoint Interview Questions which are recently  asked in top mnc's 
 

Hi friends iam getting too many mails  and everybody expecting more interview questions on sharepoint, so if anybody attend the interview  please share your interview experince


Why it s necessary to  mention that is a  safecontrol ?


Please Send ur interview Experiences to my mail id  : nsubhash007@gmail.com
Introduce ur  self….?   Can u explain ur current project…?  Roles and responsibilities

1)    -- How to crate & place themes in Share point sites?
2)   -- How can u  call the custom CSS in Share point?
3)   -- How many types of permissions in Share point?
4)    --How to change the default date format (mm/dd/yyyy) to jan-01-2008?
5)   -- BDC? Why to go for BDC?
6)    --In how many ways backup and restore the SharePoint site?
7)   -- What is Audience targeting?
8)    --Can u write the code to copy the existing list to another list?
9)    --What is the use of STSADM tool?
10-- How to create & delete list using object data model?
11--Did u create any workflows in ur project  ? what are the workflows u created  ( and either by using  sharepoint designer or  visualstudio)
12--Difference between Seq.work and statemac. Workflow  ?
13--How do u debug the workflows ( how do u handle exceptions) ?
14--Can we generate the strong name key to private assembiles ?
15--How can u deploy the  webpart to sharepoint gallery
Sub question : ( I don’t want to put the assembly in GAC i want that is as a private assembly )