Tweet
Hire Me on Freelancer.com
Protected by Copyscape Web Plagiarism Finder

Wednesday 24 October 2012

Mostly asked Asp.Net Interview Qusetion and Answers 3.5 , 4.0 (Part - 3)




Asp.net interview, .NET Interview Questions and Answers, asp.net interview questions, asp.net interview questions and answers, C# interview questions and answers, IIS interview questions and answers, sql server interview questions and answers, vb.net interview questions and answers, XML interview questions and answers, Asp.Net 3.5,Asp.Net 4.0,Asp.Net4.5, Asp.Net C#, VB.Net.
 


Tricky Questions

1. If I’m developing an application that must accommodate multiple security levels though secure login and my ASP.NET web application is spanned across three web-servers (using round-robin load balancing) what would be the best approach to maintain login-in state for the users?
Answer: You can use the security state maintained using a database. (Use Authentication mode as database)

2. What’s the difference between Code behind=”MyCode.aspx.cs” and src=”MyCode.aspx.cs” mce_src=”MyCode.aspx.cs”?
Answer: Visual Studio uses the Code behind attribute to distinguish the page source or programming logic from the design. Also the src attribute will make the page compile on every request. That is the page will not be compiled in advance and stored in the bin as a dll instead it will be compiled at run time.

3. Suppose you want a certain ASP.NET function executed on Mouse Over over a certain button or textbox. Where do you add an event handler?
Answer: Every web control has an ability to add the attributes on client side which will execute on client side and run a client side script like a JavaScript function.
btnSubmit.Attributes.Add (“onMouseOver”,”someClientCode () ;”) //For on mouse over of a button
TextBox1.Attributes.Add(“onFocus”,“ClearText();”) //For on focus of a text box

4. Explain what a diffgram is and a good use for one?
Answer: The DiffGram is one of the two XML formats that you can use to render Dataset object contents to XML. For reading database data to an XML file to be sent to a Web Service.

5. What base class do all Web Forms inherit from?
Answer: The Page class.

6. Name two properties common in every validation control?
Answer: ControlToValidate and Text property.

7. What tags do you need to add within the Data grid tags to bind columns manually?
Answer: Set AutoGenerateColumns Property to false on the Data grid tag

8. What tag do you use to add a hyperlink column to the Data Grid?
Answer: asp: HyperLinkColumn

9. What is the transport protocol you use to call a Web service?
Answer: SOAP (Simple Object Access Protocol) is the preferred protocol.

10. Where on the Internet would you look for Web services?
Answer: http://www.uddi.org

11. Which control would you use if you needed to make sure the values in two different controls matched?
Answer: CompareValidator Control

12. What are the assembly entry points? An Assembly can have how many entry points at a time?
Answer: An assembly can have only one entry point from DllMain, Win Main or Main.

13. What does an assembly contain?
Answer:
• Manifest – The metadata describing the information below.
• Assembly name – Aids in versioning and visibility scope.
• Version information – The version number is integrated into the assembly’s identity.
• Types – Boundaries and scopes of methods, classes, properties, events, attributes.
• Locale – Information describing language/culture.
• Cryptographic Hash – Public key encoded hash acting as version/security check.
• Security Permissions – The permissions within the assembly determine the permissions that can be granted for all aspects of the assembly contents.

14. What does an assembly manifest contains?
Answer: It contains assembly name, version number (major.minor.build.revision) and culture Information. It also specifies the strong name information, which is useful for shared assemblies, and list of files, an assembly contains. It also provides information for type references in an assembly and other referenced assemblies.

15. Which tool is used to deploy an assembly, so as the assembly is available to all the application?
Answer: The GacUtil.exe is the tool, which allows us to add any assembly to the windows GAC.

16. How many catch statements can be associated with single try statement?
Answer: There can be a zero or more catch statement for each try statement. So it has not limit to the number of catch statement per try statement.

17. What is Console and System a Class/a Data Member/a routine/a namespace or a type?
Answer: Console is a class and System is namespace.

18. How many values can be returned from a method in C#?
Answer: Only one value can be returned from method, however you can use ref or out variable to change more than one value in called method.

19. How to declare a variable named this in C#, with data type string?
Answer: string @this;

20. Can we change the dimension of Array at run time like Array [3, 4]?
Answer: Yes, We can change only the first position of array dimension.

21. What keyword is used to accept a variable number of parameter in a method?
Answer: “params” keyword is used as to accept variable number of parameters.

22. What is a Namespace? What is the use of a namespace?
Answer: Namespaces are logical grouping of classes and other types in hierarchical structure. Namespaces are useful to avoid collision or ambiguity among the classes and type names. Another use of the namespace is to arrange a group of classes for a specific purpose.

23. What does a keyword using works for?
Answer: Using is just a convention or a short-cut method which allows us to access the classes in a namespace by referencing it once. So whenever we want use the classes or methods in them, we can avoid typing the entire namespace hierarchy. However it is not a good practice when there are likely chances to have name ambiguity or collision of class names.

24. What is Enums in C#?
Answer: Enums or Enumerators are used to declare a set of related constants (default start with 0); they are only available with primitive data types like int and short etc.

25. What is Delegates?
Answer: Delegates are a type-safe, object-oriented implementation of function pointers and are used in many situations where a component needs to call back to the component that is using it. Delegates are generally used as basis of events, which allow any delegate to easily be registered for as event.

26. Which are the namespaces that are imported automatically by Visual Studio in ASP.Net?
Answer: There are 7 namespaces which are imported automatically.

1.       System
2.       System. Collections
3.       System.IO
4.       System.web
5.       System.web.UI
6.       System.web.UI.HTMLControls
7.       System.web.UI.WebControls

27. Which namespaces are used for data access?

1.       System. Data
2.       System.Data.OleDB
3.       System.Data.SQLClient

28. What do you mean by boxing and un-boxing?
Answer: C# provides us with Value types and Reference Types. Value Types are stored on the stack and Reference types are stored on the heap. The conversion of value type to reference type is known as boxing and converting reference type back to the value type is known as un-boxing.
e.g.
int x = 10;
object o = x ; // Implicit boxing
object o = (object) x; // Explicit Boxing
x = o; // Implicit Un-Boxing
x = (int)o; // Explicit Un-Boxing

29. What are the different methods available under sqlcommand class to access the data?

1.       ExecuteReader –Used where one or more records are returned – SELECT Query.
2.       ExecuteNonQuery – Used where it affects a state of the table and no data is being queried – INSERT, UPDATE, DELETE, CREATE and SET queries.
3.       ExecuteScalar – Used where it returns a single record(a single value normally) – SQL Functions like MIN(), NAX()

30. What are the different types of Session state management options available with ASP.NET?
Answer: ASP.NET provides In-Process & Out-of-Process state management,
Also known as “In-Proc” and “Out-Proc”. In-Proc stores the session in memory of the web server, that is on the same server the ASP.Net page is.
On the other hand Out-Proc session state management stores the session data on external data source, which can be a SQL Server or Server State Service. Out-of-Process state management requires the objects stored in session, must be serializable.

31. What is Remoting? Give Example.
Answer: Remoting is a means by which one operating system process, or program, can communicate with another process. The two processes can exist on the same computer or on two computers connected by a LAN or the Internet. Web services are probably the best known type of remoting, but they are not the only option.

32. What is Marshalling?
Answer: Marshaling is a process of making an object in one process (the server) available to another process (the client). There are two ways to achieve the marshalling.

i. Marshal by value: the server creates a copy of the object passes the copy to the client. When a client makes a call to an object marshaled by value (MBV), the server creates an exact copy and sends that copy to the client. The client can then use the object’s data and executable functionality directly within its own process or application domain without making additional calls to the server. Objects that the application accesses frequently are best remoted using MBV.

ii. Marshal by reference: the client creates a proxy for the object and then uses the proxy to access the object. When a client makes a call to an object marshaled by reference (MBR), the .NET framework creates a proxy in the client’s application domain and the client uses that proxy to access the original object on the server. Large objects that the application accesses relatively infrequently are good candidates for MBR.

33. What is a Static class? What are its features?
Answer: Static class is a class which can be used or accessed without creating an instance of the class.
Important Features:

1.       Static class only contains static members and a private constructor.
2.       Static class cannot be instantiated.
3.       Static classes are sealed by default and therefore cannot be inherited.

34. What is sealed class? What are its features?
Answer: Sealed classes are those classes which can not be inherited and thus any sealed class member can not be derived in any other class. A sealed class cannot also be an abstract class.
In C# structs are implicitly sealed; therefore, they cannot be inherited.

35. Can we declare a method as sealed?
Answer: In C# a method can’t be declared as sealed. However when we override a method in a derived class, we can declare the overridden method as sealed. By declaring it as sealed, we can avoid further overriding of this method.
E.g.
Using System;
Class MyClass1
{
Public int x;
Public int y;
Public virtual void Method () {
Console.WriteLine (“virtual method”) ;}
}
Class My Class: MyClass1
{
Public override sealed void Method () {
Console.WriteLine (“sealed method”) ;}
}
Class Main Class
{Public static void Main () {
MyClass1 mC = new My Class ();
mC.x = 110;
mC.y = 150;
Console.WriteLine (“x = {0}, y = {1}”, mC.x, mC.y);
mC.Method () ;}
}

36. What is a Dataset?
Answer: A Dataset is an in memory representation of data loaded from any data source.

37. What is a Data Table?
Answer: A Data Table is a class in .NET Framework and in simple words a Data Table object represents a table from a database.

38. If you want to view an Assembly how to you go about it? What is ILDASM?
Answer: You can use the MSIL Disassembler (Ildasm.exe) to view Microsoft intermediate language (MSIL) information in a file. If the file being examined is an assembly, this information can include the assembly’s attributes, as well as references to other modules and assemblies. This information can be helpful in determining whether a file is an assembly or part of an assembly, and whether the file has references to other modules or assemblies.

39. Where is version information stored of an assembly?
Answer: The version number is stored in the assembly manifest along with other identity information, including the assembly name and public key, as well as information on relationships and identities of other assemblies connected with the application.

40. Is versioning applicable to private assemblies?
Answer: No

41. How to create a shared assembly or add an assembly to GAC?
Answer: There are several ways an assembly can be added to GAC.

1.       Use .msi installer designed to work with the global assembly cache.
2.       Use GACUtil.exe provided by the .NET Framework SDK.
3.       Use Windows Explorer to drag assemblies into the cache.


43. What is reflection?
Answer: All .NET compilers produce metadata about the types defined in the modules they produce. This metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection. The System. Reflection namespace contains classes that can be used to interrogate the types for a module/assembly. Reflection is ability to find information about types contained in an assembly at run time.

44. How can I produce an assembly?
Answer: Simply compile your class/module with the following command.
C#.Net – CSC /t: library yourclassname.cs
VB.Net – VBC /t: library yourmodulename.vb

45. What is an Application Domain? How they get created?
Answer: An Application Domain can be thought of as a lightweight processes controlled by the .Net runtime. Application Domains are usually created by hosts like Windows Shell, ASP.NET and IE. When you run a .NET application from the command-line, the host is the Shell. The Shell creates a new Application Domain for every application.

46. Do I have any control over the garbage collection algorithm?
Answer: Yes, we have a limited control over the GC algorithm, For example, the System.GC class exposes a Collect method – this forces the garbage collector to collect all unreferenced objects immediately.

47. What is a life span of a static variable?
Answer: A static variable’s life span is till the class is in memory.

48. What is a Page Life Cycle of an ASP.Net page?
Answer: There are various stages described as under.

1.       Init
2.       LoadViewState
3.       LoadPostBackData
4.       Load
5.       RaisePostBackDataChangedEvent
6.       RaisePostBackEvents
7.       Pre-Render
8.       SaveViewState
9.       Render
10.   Unload

49. Can the action attribute of a server-side <form>tag be set to a value and if not how can you possibly pass data from a form to a subsequent Page?
Answer: No, Assigning value will not work because will be overwritten at the time of rendering. We can assign value to it by register a startup script which will set the action value of form on client-side. On other hand we can use Server.Transfer or Response. Redirect.

50. How do you turn off cookies in one page of your asp.net application?
Answer: We may not use them at the max, However to allow the cookies or not, is client side functionality.

51. Which method do you use to redirect to user to another page without performing a round trip to Client?
Answer: Server. Transfer (“AnotherPage.aspx”).


53. Should Validation occur on Client/Server Side for Date Input?
Answer: Both. Client-side reduces extra round-trip. Server-Side ensures prevention against hacking and failure against automated requests.

54. What are the web form events?
Answer:

1.       The first event that occurs in the life of a Web Form is the Init event. This is raised so that we can have initialization code for the page. The controls on the page are not yet created at this point. This event is raised once for each user of the page.
2.       The Load event follows the Init event. Subsequently, it is raised each time the page is requested. When this event is raised, all child controls of the Web Form are loaded and accessible. You should be able to retrieve data and populate the controls so that they can render themselves on the page when sent back to the client.
3.       The PreRender event happens just before the page is rendered and sent back to the client. We don’t often handle this event; however, it depends on the situation.
4.       The last event in the life of a Web Form is the Unload event. This happens when the page is unloaded from memory. Final cleanup should be done here.


i will appreciate your comments and time for using my blog.
"Necessity is the mother of Invention".


83 comments:

  1. good blog :) I also write articles about .NET developing

    ReplyDelete
  2. really nice blog you have done great job

    ReplyDelete
  3. Excellent Post. Also visit http://msnetframework.com/#aspnet.php

    ReplyDelete
  4. Share about the Dot Net Material for Freshers and Experiences, Link as, dotnettrainingchennai

    ReplyDelete
  5. Superb Interview questions..Many thanks

    ReplyDelete
  6. Really is very interesting, I saw your website and get more details..Nice work. Thanks regards,
    Refer this link below,
    LoadRunnerTraining in Chennai

    ReplyDelete
  7. Hi Atul,

    nice post...

    Regards,
    Pramod

    ReplyDelete
  8. The information you have posted here is really useful and interesting too & here, I have gathered some useful tactics in programming, thanks for sharing and I have an expectation about your future blogs keep your updates please
    sas training center in Chennai

    ReplyDelete
  9. Thanks for sharing your view to our knowledge’s, its helps me plenty keep sharing…
    Informatica training center in Chennai

    ReplyDelete
  10. Thanks for your wonderful post.It is really very helpful for us and I have gathered some important information from this blog.If anyone wants to get Dot Net Training Chennai reach FITA, rated as No.1 Dot Net Training Institute in Chennai.

    ReplyDelete
  11. Hi, I wish to be a regular contributor of your blog. I have read your blog. Your information is really useful for beginner. I did Selenium Course in Chennai at Fita training and placement academy which offer best Software Testing Course in Chennai with years of experienced professionals. This is really useful for me to make a bright career.

    ReplyDelete
  12. Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information.
    sas training in Chennai|sas training institute in Chennai|sas training chennai

    ReplyDelete
  13. Android Training in Velachery

    Your blog is really useful for me. Thanks for sharing this useful blog..Suppose if anyone interested to learn Android Training in Chennai please visit fita academy which offers best Android Training Chennai at reasonable cost.

    Android Training Institutes in Chennai





    ReplyDelete
  14. Unix Course Chennai

    Thanks for sharing this informative blog. Suppose if anyone interested to learn Unix Training Chennai, Please visit Fita Academy located at Chennai, Velachery. Rated as No.1 Unix Training Centers in Chennai


    Regards....

    Best Unix Training in Chennai





    ReplyDelete
  15. Very helpful blog... :)

    Thanks,
    Sourav M

    ReplyDelete
  16. Pretty blog i had some useful interview question..
    Thanks,
    sas course in Chennai

    ReplyDelete
  17. Informative post for the freshers who looking .net queries with answer

    ReplyDelete
  18. I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.
    Regards,
    Salesforce training |Salesforce training in Chennai

    ReplyDelete
  19. I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.
    Regards,
    sas training in Chennai|sas training institute in Chennai

    ReplyDelete
  20. Quite Interesting post!!! Thanks for posting such a useful post. I wish to read your upcoming post to enhance my skill set, keep blogging.
    Regards,
    Python Training in Chennai|Python Training|Python Training Institutes in Chennai

    ReplyDelete
  21. really nice article and can u please tell me what types of questions are asking for 3 years experiance..

    ReplyDelete

  22. This information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic.

    Online Reputation Management

    ReplyDelete
  23. We Reduced the batch size to make our training more interactive, well structured & timing too made more flexible for students convenient. Android Training in Velachery |
    Android Training in Anna Nagar |
    Android Training in Velachery |
    Android Training in Chennai |

    ReplyDelete
  24. hi welcome to this blog. really you have post an informative blog.
    java training in chennai

    ReplyDelete
  25. hi welcome to this blog. really you have post an informative blog. thank you for sharing this useful blog.
    java training in chennai

    ReplyDelete
  26. hi really you have post an informative blog. it will be really helpful to many peoples. thank you for sharing this blog.
    java training in chennai

    ReplyDelete
  27. thank you for sharing this informative blog.. this blog really helpful for everyone.. explanation are clear so easy to understand...

    best dot net training in chennai | best dot net training institute | best dot net training institute in chennai | asp dot net training in chennai

    ReplyDelete
  28. hi welcome to this blog. really you have post an informative blog. it will be really helpful to many peoples. thank you for sharing this blog.
    java training in chennai

    ReplyDelete
  29. Nice tips for someone new into the world of java. Really great tips and finally definitely will help to develop a program in java
    java training in chennai

    ReplyDelete
  30. hi welcome to this blog. really informative..thank you for this blog.
    android training in chennai

    ReplyDelete
  31. Really i enjoyed very much. And this may helpful for lot of peoples. So you are provided such a nice and great article within this.

    Software Testing Training in Chennai

    Web Designing Training in Chennai

    ReplyDelete
  32. This comment has been removed by the author.

    ReplyDelete
  33. This comment has been removed by the author.

    ReplyDelete
  34. It’s always so sweet and also full of a lot of fun for me personally and my office colleagues to search your blog a minimum of thrice in a week to see the new guidance you have got.

    oracle training in Chennai

    ReplyDelete
  35. My rather long internet look up has at the end of the day been compensated with pleasant insight to talk about with my family and friends.
    amazon-web-services-training-institute-in-chennai

    ReplyDelete
  36. Hola peeps,


    I am supposed to do further processing on a .xlsx-File that was created elsewhere. So I'd like to change the order of worksheets within that Workbook - is that doable or would I have to create a new wb and then copy on sheet after the other into that new wb? ASP .Net



    Anyways great write up, your efforts are much appreciated.

    ,Merci
    Radhey

    ReplyDelete
  37. If you're a fan of The Nike Air Yeezys sneakers you are in the right place. You are about to discover everything Yeezy including Exclusive Yeezys like the Tinker Hatfield Edition, Stars and Celebrities in the Yeezys, Official Realeased Yeezy Colourways, Nike air Tiny Net Worth Prices, Yeezy Release Dates, Where you can find official Nike Air Yeezys and Where you can buy the Yeezys for cheap.

    ReplyDelete
  38. Thanks for the good words! Really appreciated. Great post. I’ve been commenting a lot on a few blogs recently, but I hadn’t thought about my approach until you brought it up. 


    java training in chennai | java training in bangalore

    java online training | java training in pune

    selenium training in chennai

    selenium training in bangalore

    ReplyDelete
  39. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Python training in pune
    AWS Training in chennai
    Python course in chennai

    ReplyDelete
  40. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    DevOps online Training
    Best Devops Training institute in Chennai

    ReplyDelete
  41. Good Post, I am a big believer in posting comments on sites to let the blog writers know that they ve added something advantageous to the world wide web.
    Java training in Chennai | Java training in Bangalore

    Java online training | Java training in Pune

    ReplyDelete
  42. Wonderful bloggers like yourself who would positively reply encouraged me to be more open and engaging in commenting.So know it's helpful.
    python interview questions and answers | python tutorialspython course institute in electronic city

    ReplyDelete
  43. Nice post, Thanks for sharing this with us.This information is very useful for the interview.For more information.
    aws online training
    aws training in hyderabad
    amazon web services(AWS) online training

    ReplyDelete
  44. This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.
    best rpa training in bangalore
    rpa training in bangalore | rpa course in bangalore
    RPA training in bangalore
    rpa training in chennai
    rpa online training

    ReplyDelete
  45. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.
    python Course in Pune
    python Course institute in Chennai
    python Training institute in Bangalore

    ReplyDelete
  46. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    Dot Net training in Electronic City

    ReplyDelete
  47. This is the exact information I am been searching for, Thanks for sharing the required infos with the clear update and required points. To appreciate this I like to share some useful information.Hadoop Training in Bangalore

    ReplyDelete
  48. Excellent information with unique content and it is very useful to know about the information.Informatica Training in Bangalore

    ReplyDelete
  49. Thank you for providing this kind of useful information,I am searching for this kind of useful information; it is very useful to me and some other looking for it. It is very helpful to who are searching python Training.python training in bangalore

    ReplyDelete
  50. It is very good and useful for students and developer .Learned a lot of new things from your post!Good creation ,thanks for give a good information at SAS.SAS Training in Bangalore

    ReplyDelete
  51. I just Learned here about the technology asp.net Under the asp.net.This is very Useful site for friendly use i can get FAQ and each and every details about the Automation Testing.Kindly check i just Add the link to this post.



    ASP.Net training in chennai | ASP.Net training in annanagar | ASP.Net training in omr | ASP.Net training in porur | ASP.Net training in tambaram | ASP.Net training in velachery

    ReplyDelete
  52. And indeed, I’m just always astounded concerning the remarkable things served by you. Some four facts on this page are undeniably the most effective I’ve had.
    Java training in Chennai

    Java training in Bangalore

    Java training in Hyderabad

    Java Training in Coimbatore

    Java Online Training

    ReplyDelete
  53. The Blog is really beautiful. every concept should be very neatly arranged and the concepts are very clear to understand.Nice blog,I understood the topic very clearly,And want to study more like this.
    Data Science Training In Chennai

    Data Science Online Training In Chennai

    Data Science Training In Bangalore

    Data Science Training In Hyderabad

    Data Science Training In Coimbatore

    Data Science Training

    Data Science Online Training

    ReplyDelete
  54. Sharma Academy is Central Indias largest provider of Mppsc Notes and Mppsc Study Material. You will get updated MPPSC Notes as per the latest syllabus of state level psc exam in Hindi and English medium

    ReplyDelete
  55. Sharma Academy is Central Indias largest provider of Mppsc Notes and Mppsc Study Material. You will get updated MPPSC Notes as per the latest syllabus of state level psc exam

    ReplyDelete
  56. I feel really happy to have seen your webpage and look forward to so
    many more entertaining times reading here. Thanks once more for all
    the details.
    dot net training center in Chennai
    best core java training in Chennai
    manual testing training in Chennai

    ReplyDelete
  57. Very Informative blog thank you for sharing. Keep sharing.

    Best software training institute in Chennai. Make your career development the best by learning software courses.

    php training institute in chennai
    best msbi training institute in chennai
    rpa training in chennai

    ReplyDelete
  58. This post is so interactive and informative.keep update more information...
    German Classes in Tambaram
    German Classes in chennai

    ReplyDelete

  59. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one.
    full stack web development course malaysia

    ReplyDelete