Tuesday, May 17, 2011

Pro C# 2008 and the .NET 3.5 Platform, Fourth Edition (Pro Series)

Pro C# 2008 and the .NET 3.5 Platform, Fourth Edition (Pro Series)

ASP.NET Questions

  1. Explain the .NET architecture.
  2. How many languages .NET is supporting now? – When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. The site DotNetLanguages.Net says 44 languages are supported.
  3. How is .NET able to support multiple languages? – a language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.
  4. How ASP .NET different from ASP? – Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.
  5. Resource Files: How to use the resource files, how to know which language to use?
  6. What is smart navigation? – The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.
  7. What is view state? – The web is stateless. But in ASP.NET, the state of a page is maintained in the in the page itself automatically. How? The values are encrypted and saved in hidden controls. this is done automatically by the ASP.NET. This can be switched off / on for a single control
  8. Explain the life cycle of an ASP .NET page.
  9. How do you validate the controls in an ASP .NET page? – Using special validation controls that are meant for this. We have Range Validator, Email Validator.
  10. Can the validation be done in the server side? Or this can be done only in the Client side? – Client side is done by default. Server side validation is also possible. We can switch off the client side and server side can be done.
  11. How to manage pagination in a page? – Using pagination option in DataGrid control. We have to set the number of records for a page, then it takes care of pagination by itself.
  12. What is ADO .NET and what is difference between ADO and ADO.NET? – ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.
  13. Does C# support multiple-inheritance?
    No. 
  14. Who is a protected class-level variable available to?
    It is available to any sub-class (a class inheriting this class). 
  15. Are private class-level variables inherited?
    Yes, but they are not accessible.  Although they are not visible or accessible via the class interface, they are inherited.  
  16. Describe the accessibility modifier “protected internal”.
    It is available to classes that are within the same assembly and derived from the specified base class.  
  17. What’s the top .NET class that everything is derived from?
    System.Object.  
  18. What does the term immutable mean?
    The data value may not be changed.  Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.  
  19. What’s the difference between System.String and System.Text.StringBuilder classes?
    System.String is immutable.  System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.  
  20. What’s the advantage of using System.Text.StringBuilder over System.String?
    StringBuilder is more efficient in cases where there is a large amount of string manipulation.  Strings are immutable, so each time a string is changed, a new instance in memory is created. 
  21. Can you store multiple data types in System.Array?
    No.  
  22. What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
    The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array.  The CopyTo() method copies the elements into another existing array.  Both perform a shallow copy.  A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array.  A deep copy (which neither of these methods performs) would create a new instance of each element’s object, resulting in a different, yet identacle object. 
  23. How can you sort the elements of the array in descending order?
    By calling Sort() and then Reverse() methods.  
  24. What’s the .NET collection class that allows an element to be accessed using a unique key?
    HashTable.  
  25. What class is underneath the SortedList class?
    A sorted HashTable.  
  26. Will the finally block get executed if an exception has not occurred?­
    Yes. 
  27. What’s the C# syntax to catch any possible exception?
    A catch block that catches the exception of type System.Exception.  You can also omit the parameter data type in this case and just write catch {}.  
  28. Can multiple catch blocks be executed for a single try statement?
    No.  Once the proper catch block processed, control is transferred to the finally block (if there are any).  
  29. Explain the three services model commonly know as a three-tier application.
    Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources). 

Monday, March 9, 2009

ASP.net Interview Question

- Difference between asp and asp.net
- How do you do exception management
- If you are using components in your application, how can you handle exceptions raised in a component
- Can we throw exception from catch block
- How do you relate an aspx page with its code behind page
- What are the types of assemblies and where can u store them and how
- What is difference between value and reference types
- Is array reference type / value type
- Is string reference type / value type
- What is web.config. How many web.config files can be allowed to use in an application
- What is differnce between machine.config and web.config
- What is shared and private assembly
- What are asynchronous callbacks
- How to write unmanaged code and how to identify whether the code is managed / unmanaged.
- How to authenticate users using web.config
- What is strong name and which tool is used for this
- What is gacutil.exe. Where do we store assemblies
- Should sn.exe be used before gacutil.exe
- What does assemblyinfo.cs file consists of
- What is boxing and unboxing
- Types of authentications in ASP.NET
- difference between Trace and Debug
- Difference between Dataset and DataReader
- What is custom tag in web.config
- How do you define authentication in web.Config
- What is sequence of code in retrieving data from database
- About DTS package
- What provider ADO.net use by default
- Where does web.config info stored? Will this be stored in the registry?
- How do you register the dotnet component or assembly?
- Difference between asp and asp.net
- Whis is stateless asp or asp.net?
- Authentication mechanism in dotnet
- State management in asp.net
- Types of values mode can hold session state in web.config
- About WebService
- What are Http handler
- What is view state and how this can be done and was this there in asp?
- Types of optimization and name a few and how do u do?
- About DataAdapters
- Features of a dataset
- How do you do role based security
- Difference between Response.Expires and Expires.Absolute
- Types of object in asp
- About duration in caching technique
- Types of configuration files and ther differences
- Difference between ADO and ADO.net
- About Postback
- If you are calling three SPs from a window application how do u check for the performance of the SPS

Search Asp.Net , VB.Net , C# Question With Solution And Code