Monday, March 24, 2008

.Net & C# Interview question, along with general programming questions

.Net & C# Interview question, along with general programming questions
Hey, These are some Interview Questions with suggested answers we collected in Middle-East-Developers, for more questions in other fields like C++, you can check the group.
These questions are collected by

* Adel Khalil
* Yehia Megahed
* Hisham Abd El-Hafez
* Mohammed Hossam

Q1: Can DateTime variables be null?
A1: No, because it is a value type (Struct)

Q2: Describe the Asp.net Page Life Cycle?
A2: http://msdn2.microsoft.com/en-us/library/ms178472.aspx

Q3: Describe the Asp.net pipeline ? Give an Example when you need to extend it? How do you do so?
A3: http://msdn.microsoft.com/msdnmag/issues/02/09/HTTPPipelines/

Q4: Describe the accessibility modifier protected internal
A4: Members are accessible to derived classes and classes within the same Assembly

Q5: Difference between an interface and abstract class?
A5: In the interface all methods must be abstract, in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes.

Q6: How do you perform pre- and post-processing to extend a WebMethod ?
A6: Use SOAP extensions ...http://msdn.microsoft.com/msdnmag/issues/04/03/ASPColumn/

Q7: What are Design Patterns?
A7: It is a big topic in Object Oriented, so for more information see this, http://dofactory.com/Patterns/Patterns.aspx

Q8: What do you know about .net framework 3.0 ?
A8: any answer that introduces Windows Communication Foundation (WCF), Windows Workflow Foundation (WF), Windows Presentation Foundation (WPF) and Windows Card Space (WCS) is right, also you can mention that it was originally called WinFX

Q9: What do you know about ATLAS (Microsoft ASP.net AJAX Extensions) ?
A9: for more information check here, http://ajax.asp.net

Q10: What do you know about Agile software methodologies?
A10: http://en.wikipedia.org/wiki/Agile_software_development

Q11: What do you know about Web Services Enhancements (WSE)?
A11: http://msdn.microsoft.com/webservices/webservices/building/wse/default.aspx

Q12: What is AJAX ?
A12: Asynchronous Javascript And XML

Q13:What is NUnit, or What is Unit testing?
A13: Unit testing: is a procedure used to validate that a particular module of source code is working properly from each modification to the next. The procedure is to write test cases for all functions and methods so that whenever a change causes a regression, it can be quickly identified and fixed. Ideally, each test case is separate from the others; constructs such as mock objects can assist in separating unit tests. This type of testing is mostly done by the developers, NUnit is a famous tool for Unit Testing in .net

Q14: What is an Asp.net Http Handler & Http Module?
A14: http://www.15seconds.com/issue/020417.htm

Q15: What is mutable type ? immutable type ?
A15: Immutable type are types whose instance data, fields and properties, does not change after the instance is created. Most value types are immutable, but the mutable type are A type whose instance data, fields and properties, can be changed after the instance is created. Most Reference Types are mutable.

Q16: What is the HttpContext Object? Where is it accessible?
A16: It's is an Object that Encapsulates all HTTP-specific information about an individual HTTP request. it is avaliable through out the Asp.net request pipline.

Q17: What is the difference between String & StringBuilder classes?
A17: String is an immutable type while StringBuilder is a mutable type

Q18: What's the difference between C# 1.0 & C# 2.0?
A18: Any answer that introduces stuff like, Generics, Anonymous Methods, Nullable types, Iterators ... etc, is correct

Q19: Without using the multiplication or addition operations, how can you multiply a number x by 8?
A19: Shift x to the left 3 times, x << 3, because every shift left multiplies the number by 2

Q20: What is the difference between ASP.net 1.x & ASP.net 2.0 ?
A20: Any answer that include stuff like Provider model (membership provider, role provider ... etc) and Master Pages, Code Beside model, new web controls will be ok.

If you have more questions feel free to join the user group and add them directly to the database.
kick it on DotNetKicks.com
Published Monday, February 26, 2007 5:38 PM by Mohammed Hossam
Filed Under: C# Language
Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS
Comments
# Interview Questions for DotNet, C#, OOP, ASP.net ... etc
Monday, February 26, 2007 6:10 PM by DotNetKicks.com
You've been kicked (a good thing) - Trackback from DotNetKicks.com
# re: .Net & C# Interview question, along with general programming questions
Tuesday, February 27, 2007 9:11 AM by Mohamed Tanna
More Interview question

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 happens if you inherit multiple interfaces and they have conflicting method names?

-It’s up to you to implement the method inside your own class, so implementation is left entirely up to you. This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares you’re okay.
To Do: Investigate


13-If a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?

-Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.


14-What’s a multicast delegate?
-A delegate that has multiple handlers assigned to it. Each assigned handler (method) is called.


15-How do you debug an ASP.NET Web application?

-Attach the aspnet_wp.exe process to the DbgClr debugger.

16-How is the DLL Hell problem solved in .NET?

-Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.


# re: .Net & C# Interview question, along with general programming questions
Tuesday, February 27, 2007 2:40 PM by Adel Khalil
Great stuff, but must advice that this ain't a cheat list you have to investigate the topics introduced of every question.

thanks Bashmohandes.
# re: .Net & C# Interview question, along with general programming questions
Wednesday, February 28, 2007 3:32 AM by Michal Talaga
Some questions are valid, but some of them are just plain improper.
For example:
"What's the difference between C# 1.0 & C# 2.0?"

Why not ask for the difference between C# 2.0 and C? I mean, why do we need to know the history of the language?

I also don't like the general questions where you say: "any anwser that..."
# re: .Net & C# Interview question, along with general programming questions
Wednesday, February 28, 2007 5:54 AM by Mohammed Hossam
Thanks Tanna for adding more questions.
@Michal Talaga
Knowing the difference between C# 1.x & C# 2.0 is as important as knowing the difference between C# & C++ or C, because it gives the interviewer the impression that you are a continuous learner kind of person, and also you know in details why to use a certain technology, it is a tricky question.
# re: .Net & C# Interview question, along with general programming questions
Saturday, March 17, 2007 5:28 AM by lokesh
good for me
# re: .Net & C# Interview question, along with general programming questions
Thursday, March 22, 2007 9:43 AM by stanley
Fine!
# re: .Net & C# Interview question, along with general programming questions
Saturday, March 31, 2007 2:51 AM by Rami
Thanks for the links and questions. You may also consider http://www.technical-interview.com
# re: .Net & C# Interview question, along with general programming questions
Wednesday, April 11, 2007 1:04 PM by Ripal Soni
greate stuff , find more interview questions in .netframework and asp.net ,click here
http://www.ripalsoni.wordpress.com
# re: .Net & C# Interview question, along with general programming questions
Thursday, April 12, 2007 4:31 AM by Ahmed Baghdadi
Great ,thanks for these questions.
# One year of technical blogging
Sunday, May 06, 2007 10:19 AM by Bashmohandes
Bashmohandes.com, 1 year of technical blogging
# re: .Net & C# Interview question, along with general programming questions
Tuesday, May 08, 2007 5:24 AM by Pravin
Helped me a lot for preparing myself for facing Interviews
# re: .Net & C# Interview question, along with general programming questions
Sunday, June 24, 2007 5:59 AM by sushil
good one
# 9-Can you store multiple data types in System.Array?
Saturday, July 07, 2007 1:09 AM by Jim Lee
9-Can you store multiple data types in System.Array?

I think the correct answer should be yes, for example, the C# code below works perfectly:

System.Object[] test_array = new System.Object[3];
test_array[0] = "Hello world!";
test_array[1] = 2007.7;
test_array[2] = DateTime.Now;
# re: .Net & C# Interview question, along with general programming questions
Thursday, July 12, 2007 10:50 PM by Alex George
Good Questions!

You can find more .Net interview faqs at

http://www.dotnetinterviewfaqs.com
# re: .Net & C# Interview question, along with general programming questions
Saturday, August 18, 2007 8:22 AM by Dot Net Faqs Master
For .net interview faqs visit

http://www.dotnetinterviewfaqs.com
# re: .Net & C# Interview question, along with general programming questions
Monday, August 27, 2007 4:21 PM by Jim Jackson
@ Jim Lee:

That would be the same type (System.Object). The answer is no.
# ASP.Net, C#, SQL Server, XML, UML, BizTalk, Data warehouse, more.. - Interview question
Thursday, October 18, 2007 11:13 AM by Reena
You can find some more interview questions on programming languages such as ASP.Net, C#, SQL Server, XML, UML, BizTalk, Data warehouse, Software Testing & more.

Thanks,
Reena
# re: .Net & C# Interview question, along with general programming questions
Thursday, November 01, 2007 1:04 AM by Sri
.Net, C#, SQL Server Interview Questions and Answers..
# re: .Net & C# Interview question, along with general programming questions
Thursday, November 01, 2007 6:42 PM by Biswaz
Hi..Thanks Reena.
Helped me lot :)

WWW.FAQSFUSION.COM
# re: .Net & C# Interview question, along with general programming questions
Monday, November 05, 2007 11:53 PM by ganesh
You can find some more interview questions on programming languages such as Microsoft ASP.Net, C#, SQL Server, XML, UML, Data warehouse, HR , Software Testing & more.
# re: .Net & C# Interview question, along with general programming questions
Friday, December 28, 2007 1:40 AM by satheeshbabu n
hi dude....u hav good heart to share valuable informations .it helps me alot in interviews .plz alert ur new information into my mail....
# re: .Net & C# Interview question, along with general programming questions
Tuesday, March 04, 2008 8:12 AM by Dinesh
what is difference between string and String
in C#.

No comments:

如何发掘出更多退休的钱?

如何发掘出更多退休的钱? http://bbs.wenxuecity.com/bbs/tzlc/1328415.html 按照常规的说法,退休的收入必须得有退休前的80%,或者是4% withdrawal rule,而且每年还得要加2-3%对付通胀,这是一个很大...