Pages

Thursday, June 16, 2011

C# Interview Questions & Answers :


C# Interview Questions & Answers :

1. Does C# support multiple-inheritance?
No.

2. Who is a protected class-level variable available to?
It is available to any sub-class (a class inheriting this class).

3. 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.

4. Describe the accessibility modifier "protected internal".
It is available to classes that are within the same assembly and derived from the specified base class.

5. What's the top .NET class that everything is derived from?
System.Object.

6. 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.

7. 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.

8. 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.

9. Can you store multiple data types in System.Array?
No.

10. 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.
11.How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.

12. What's the .NET collection class that allows an element to be accessed using a unique key?
HashTable.

13. What class is underneath the SortedList class?
A sorted HashTable.

14. Will the finally block get executed if an exception has not occurred?
Yes.

15. 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 {}.

16. 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).

17. 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)

--
Thanks and regards,
S.KARTHIKESAN


No comments:

Post a Comment

Labels

.resume (CCL) (engg) (finance) (NTPC) (www.bajajallianzlife.co.in) (www.carpeltechnologies.com) (www.empresscyber.com) (www.hcltech.com) (www.infosys.com) (www.mu-sigma.com) (XHTML) /Instructor 2009/2010 2010 2010- 2011 2011batch 2nd 2nd/3rd 3rd Academy Accent Accenture Accountant Accounts Admin ADP-Freshers Agent Allianz Alpine Analyst Andhra Applicatio​ns Aptel Aquaculture Archieve Assistant Augusht august Authority Bajaj bangalore Bangalore Banking batch Batch Beans BHEL Bhilai Bhopal Bombardier Bosch branches Bureau Business campus CAMPUS Careers Carpel Cements Center Central Chennai Chester Chief Civil clients Coalfields Coastal Cognizant Common Concurrent Consultancy Consultant Consulting Convent Coordinator Court Current Customer Cybernetic DCKAP Dehradun Delhi Delhi/NCR Dermatologist Design details Developer Development Digiblitz Digital Director disabilities DOEACC Drive Economist Electrical Empress Emtex Engineer Engineering Engineers Engineers: Exam.-2011 Exclusive Executive experiecnce experience Experienced Factory Finance Firstsource Ford Format Fresher Fresher-Moksha Freshers friends Government Grade-II/Executive graduate Graduates Group’s Gujarat Gurgaon guys Guys Gynecologist Hiring hospitality hotel ICFRE ICICI IGATE IMAGE Impressive India Indore Industrial infinite Infopro Information Infosys Infotech Insurance Intelligence Interview iOPEX Itarsi Java/J2EE Jnport Job4all jobs Jobs Judge Judicial July Karnataka Kolkata KSRTC lakhs Lakhs Latest Leprosy Librarian Libsys Limited link linux Livicsa Machinary Madras Manager Manual Manufacturing Marketing master Materials Mechanical Mechsoft Mills Mission Moksha month MphasiS Mumbai Muthoot Nagpur NALCO National Nettpositive Nirvana Noida Northern Odisha Officer Officer-2011 Officers Opening Openings Ophthalmologist opportunities Oracle Ordnance Orissa Outdoor Painting Paper passed Performance Personnel POOLED Post) posting Posts Power Pradesh Probationary problem process Process process. Professionals Project Punjab Qualcomm Questions Rayagada Recritment recruiting Recruitment Recruits recuriting Refer registration Representatives required requires RESIZING restaurant Resume Robert Saadhvi Salary Sales Sapient School Section seeking Senior Services Shimla Sigma Simple SKATING Software Solutions Specialist SPORTS supervisor Support Surgeon Synechron Systems TAEKWONDO TEACHER technical Technologies Technology Tendering Testers Testing Thermal Thsti Trainee Trainer Trust Urgent Uttarakhand vacancies vacancy verizon Voice walk-in Walk-in walkin Wipro www.aptel.gov.in www.bgsbuniversity.org www.ciil.org www.cirtindia.com www.detgujarat.org www.hc.ap.nic.in www.icfre.org www.iica.in www.iitb.ac.in www.jnport.gov.in www.jobs.undp.org.in www.karnatakajudiciary.kar.nic.in www.kmrc.in www.ksrtc-jobs.com www.ncl.gov.in www.thsti.res.in