Showing posts with label .net interview questions. Show all posts
Showing posts with label .net interview questions. Show all posts

Tuesday, June 11, 2013

Difference between System.Web.UI.WebControls.WebParts.WebPart and Microsoft.SharePoint.WebPartPages.WebPart?

Microsoft.SharePoint.WebPartPages.WebPart is provided in MOSS 2007 to provide backwards compatability with MOSS 2003 webparts.

 In MOSS 2007, it is recommended to use System.Web.UI.WebControls.WebParts.WebPart instead.

System.Web.UI.WebControls.WebParts.WebPart does not provides a feature to get or provide to to other webparts.

Client Object Model vs Server Object Model in SharePoint 2010

Client Object Model 

Client object model is a new feature available in SharePoint 2010. .Client object model provides a  way to do the programming for a SharePoint site using scripting language such as Java Script .


In  Client object model an xml request will be sent  and then server will return JSON which is changed to appropriate object model. 

Mainly 2 assemblies to be referred while working with the Client object model.

Microsoft.SharePoint.Client.dll
Microsoft.SharePoint.Client.Runtime.dll

Below is the code sample for a list object from SharePoint site using Client object model :
ClientContext context = new ClientContext("http://sp2010:2012");
 List list = context.Web.Lists.GetByTitle("Title");
context.Load(list);
context.ExecuteQuery();
So, what else a developer can do with Client object model. Client object model provide a way where you can access SharePoint data with scripting language such as Java Script.
You can write simple java script code to perform all those operation. You can use CAML query to access data from SharePoint site.


Using Client object model you can do below tasks:
Get list items, Add list items, Update list items and many more.

Client object model gives result in fast manner, but there is a limitation. The limitation is, we can not access Farm Object using Client object model.
For Client object model silverlight is also an option to program for a SharePoint site.

So if you want to access Farm object then use Server object model.


Server Object Model :



Server object model contains following classes : SPFarm, SPServer, SPSite, SPSiteCollection etc.

Below is the code Sample for Server Object Model:
This code is to get the list items from a SharePoint site:

          using (SPSite oSite = new SPSite(@"http://sp2010:33051"))
            {
                using (SPWeb oWeb = oSite.RootWeb)
                {
                    SPList oList = oWeb.Lists["List1"];  
                    Console.WriteLine("Items in: " + oList);
                    foreach (SPListItem oItem in oList.Items)
                    {
                        string firstname = oItem["Fname"].ToString();
                        Console.WriteLine(firstname);
                    }
                 }
            }

If you want more on Client object model or Server object model then please comment your query. Your comment will be highly appreciated.

Wednesday, September 19, 2012

What is Group Discussion and its Importance - HR Interview Questions

It is a methodology used by an organization to gauge whether the candidate has certain personality traits and/or skills that it desires in its members. In this methodology, the group of candidates is given a topic or a situation, given a few minutes to think about the same, and then asked to discuss the it among themselves for 15-20 minutes.

As in a football game, where you play like a team, passing the ball to each team member and aim for a common goal, GD is also based on team work, incorporating views of different team members to reach a common goal.

Here are some of the most important personality traits that a candidate should possess to do well at a GD:

The skills that are usually assessed in a Group Discussion are:


    * Communication Skills
    * Interpersonal Skills
    * Leadership Skills
    * Motivational Skills
    * Team Building Skills
    * Tolerance to Ambiguity
    * Divergent Thinking
    * Listening skills
    * Presentation Skills
    * Analytical / Logical skills

So, it's important to assess your current strengths in all these areas and accordingly put efforts to strenthen your weaknesses.

What GD Panel Looks for - HR Interview Questions

All that one observes in a GD can be categorized into two broad areas: the Content and the Process. The content is all about the matter (or the 'what') spoken in the GD. Whereas, the process refers to the 'how', 'when' and 'why' of the GD. Both are equally important and need adequate attention at all stages. A high quality contribution with no regard to the 'process' is as suicidal as one which is high on packaging with little content.

Skills of an Individual that are Judged in Group Discussion are:

    * How good you are at communication with others.
    * How you behave and interact with group.
    * How open minded are you.
    * Your listening skill.
    * How you put forward your views.
    * Your leadership and decision making skills.
    * Your analysis skill and subject knowledge.
    * Problem solving and critical thinking skill.
    * Your attitude and confidence.

Important Points to Remember about Group Discussion (GD) - HR Interview Questions

   * It is important for all the members of a group discussion to use reasoning.
    * It is also important for you to ask questions that will allow you to determine how much the other members know about a specific topic.
    * You should not make a statement which gives your opinion about the accuracy of a comment that has been made by another member.
    * If you are the one who is planning or leading the group, it is important to make sure every members contributes something to the discussion.
    * It is important to make sure everyone is talking about the topic. The students should talk and make statements regarding the topic.
    * The best way to approach the topic of discussion is to start with a concept that is simple before moving to one that is complex.
    * Once you have researched the topic, you should develop your own thoughts or opinions about it.
    * To successfully participate in group discussion, you must know how to work well with others, and you must understand the topic or materials that are being discussed.

How to prepare and succeed in an job interview - HR Interview Questions

It has been effectively proven that in majority of all interviews that are done usually has a decision unto the applicants in a matter of minutes. And the rest is just for formality. This will mean that a glossy first impression will be of utmost importance during an interview to ensure that you get the perfect job.

By the time that you are given the knowledge that an interview is on its way. The first move is to observe and study the company that is offering the interview. A good knowledge and understanding with regards to the products and services offered along with who buys these things will be a great advantage at your part. A brief history about the company of your choice will give you something that other applicants would want. And make sure to get good information about the person who will give the interview to you. Mainly his position in the company along with his name.


On your way inside the place, make sure that every single person deserves a smile from you. Cheerfully great them along the way and politely talk with them. Do this as you can never know who among all of the people inside the building has great connections with the interviewer. Go into the establishment ahead of the interview time to make yourself comfortable with the atmosphere in the place and also to gather more information.

Take a good time going through your application and have enough time to think through the things about you so you don’t get blanked during the interview. Another good point is to bring along with you certain certificates that can be proof with regards to your professional and educational history. Do not bluntly show it to the interviewer. Instead, politely wait until this person asks to see it

As you have the time because you have went to the establishment early. Use some of it by thinking about 2 broad questions. This will come in handy because usually in the end of the interview. They tend to ask you if you got a few questions. This will most likely give the interviewer the idea that you are sharp and you think very fast.

Try to make yourself as simple as possible during the interview. Be the honest person that you can only think of before. Be sure to not let them see or at lost do not cross your arms in front of them and do not fold your legs while they see you. Look at them straightly and keep in mind that this whole interview is done only to acquire information’s and observations from you. This means your answers must be flawless along with your movements.

Body Language for an interview - HR Interview Questions

Posture
When the interviewer offers you a seat at the start of the job interview, sit upright but not too stiffly in your chair. This indicates that you are comfortable and feeling confident. Hunching down in your chair gives the impression of nervousness and low self-esteem. A sloppy posture indicates a careless attitude and a lack of energy. Sitting on the edge of your chair can come across as being nervous and tense.
Relax and lean slightly forward, about 10 degrees, towards your interviewer. This gives the message that you are both interested and involved. Leaning back makes you appear too relaxed and casual. Leaning to the side can be perceived as not feeling comfortable with the interviewer.

How you position your head also sends a message. Tilting your head very slightly to one side comes across as friendly and open. Keeping it straight comes across as self-assured and authoritative.

It is also important to pay attention to the posture of your interviewer. Sometimes you can establish rapport by adopting the same posture as the other person. This is called mirroring. If they have adopted a more formal posture do the same until you see that the interviewer has relaxed and become less formal.

C sharp basic interview questions and answers for freshers

Can an Interface contain fields?
No, an Interface cannot contain fields.

Can you create an instance of an interface?
No, you cannot create an instance of an interface.

1.Does C# support multiple-inheritance?
No. But you can use Interfaces.

2.Where is a protected class-level variable available?
It is available to any sub-class derived from base class

3.Are private class-level variables inherited?
Yes, but they are not accessible.

How do you create empty strings in C#?
Using string.empty as shown in the example below.
string EmptyString = string.empty;

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.

6.Which class is at the top of .NET class hierarchy?
System.Object.

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

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

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

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

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

12.How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.

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

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

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

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

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

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



1. How many types of JIT compilers are available?
There are Two types of JIT compilers.
standard JIT compiler.
EconoJIT compiler.

2.What are the different types of assemblies – name them?
Private
Public/Shared
Satellite assembly

3.What is GAC? What are the steps to be taken to pick up the latest version from GAC?
This Global Assembly Cache(GAC) stores .NET assemblies to be shared by several applications on that computer.publisher policy file is the configuration file to redirect to different version
1. Create the publisher Policy assembly using the assembly linker
2. Add the publisher policy assembly to the GAC using GACutil tool
Gacutil /i
3. During runtime CLR is looking into the publisher policy file and redirect the application to bind with new version assembly as specified inside the publisher policy.


4.How do we use different versions of private assemblies in same application without re-build?
In Asseblyinfo file need specify assembly version.
assembly: AssemblyVersion

5.Different methods of using a legacy COM component in .NET framework?
1. TLBIMP to create an Assembly from a COM component
2. Reference a COM component directly from .NET Editor

6.How do you implement SSL?
1. create certificate request
[
=>Right click on the website (VD)
=>Click Directory Security Tab and click Server Certificate
=> Type name of certificate , Organization name , server name
location info,
=> Type the path need to save certificate information Submit certificate request.
]

7.What is ref parameter? What is out parameter?
Ref Parameter: Used to pass a parameter as a reference so that the function called will set the value. This could be used to return more than 1 value by a function.
e.g.
public int AddMuliply( int a , int b, ref int c)
{
c = a*b;
return ( a+b);
}
The above function, returns the addition of two numbers as well as computes the multiplication result and passes to the calling function.
Out Parameter: Used to pass values from the aspx Code-behind to the aspx page.
The difference is that for a ref parameter, you have to assign a value before you call the function, while for OUT parameter, you dont have to assign a value, the calling function assumes that the called function would assign some value.

A ref parameter must first be initialized before being passed from the calling function to the called function. but a out parameter need not be initialized, we can pass it directly when we pass a parameter as ref to a method, the method refers to the same variable and changes made will affect the actual variable.
even the variable passed as out parameter is same as ref parameter, but implementation in c# is different, Arguement passed as ref parameter must be initialized before it is passed to the method. But in case of out parameter it is not necessary. But after a call to a method as out parameter it is necessary to initialize.
When to use out and ref parameter, out parameter is used when we want to return more than one value from a method. Ref parameter can be used as both input and o/p parameter out parameter can be used as only output parameter

8.What is boxing? What is the benefits and disadvantages?
Boxing is converting a value-type to reference type. An example is converting an integer value to an object value.

Ex:
int intValue = 10;
object obj = (object)intValue;

This is used if you want to pass variables of object types to certain functions or methods you have created. Commonly used in events for example (Object sender...).

9.Why multiple Inheritance is not possible in C#?
Multple inheritance is coneceptually wrong. It shouldn't be allowed in any language. Inheritance is the strongest relationship that can be expressed in OO languages.
It's used to express IS-A relationship. Aggregation is used to express IS CONSTRUCTED IN TERMS OF. If you're using multiple inheritance in C++ then you're design is wrong and you probably want to use aggregation. On the other hand it's plausible to want to use multiple interfaces. For instance you might have a class wheel and a class engine. You could say that your class car inherits from wheel and from engine but that's wrong. In fact car aggregates wheel and engine because it is built in terms of those classes. If wheel is an interface and engine is an interface then car must inherit both of these interfaces since it must implement the functionaity of wheel and engine .On this basis we can see that multiple inheritance for classes should not be allowed because it promotes mis-use of the strong IS-A relationship. C# enforces the correct concepts whilst C++ allows mis-use. multiple interface inheritance is permissible and C# allows this. It's all to do with properly understanding OO concepts.

Absolute Multiple Inheritance is not possible in c# but partially it supports multiple inheritance by the use of Interfaces. As interfaces force a class to implement same type of behaviour (as defined in interface) which classes implements that interface

Differences between an abstract class and an interface

1. Abstract classes can have implementations for some of its members, but the interface can't have implementation for any of its members.

2. Interfaces cannot have fields where as an abstract class can have fields.

3. An interface can inherit from another interface only and cannot inherit from an abstract class, where as an abstract class can inherit from another abstract class or another interface.

4. A class can inherit from multiple interfaces at the same time, where as a class cannot inherit from multiple classes at the same time.

5. Abstract class members can have access modifiers where as interface members cannot have access modifiers.

Another common C# Interview Question, that is commonly asked is, When do you choose interface over an abstract class or vice versa?
A general rule of thumb is, If you have an implementation that will be the same for all the derived classes, then it is better to go for an abstract class instead of an interface. So, when you have an interface, you can move your implementation to any class that implements the interface. Where as, when you have an abstract class, you can share implementation for all derived classes in one central place, and avoid code duplication in derived classes.

What is a Web Application - Interview Questions

A web application is any application that uses a web browser as a client. The application can be as simple as a message board or a guest sign-in book on a website, or as complex as a word processor or a spreadsheet

A web application is a dynamic extension of a web or application server. There are two types of web applications:

Presentation-oriented: Web application

A presentation-oriented web application generates interactive web pages containing various types of markup language (HTML, XML, and so on) and dynamic content in response to requests.

Service-oriented: Web application

A service-oriented web application implements the endpoint of a web service. Presentation-oriented applications are often clients of service-oriented web applications.

Web Development Company

What is ASP.NET - Asp.net Interview Questions


  • ASP.NET is a Web application framework marketed by Microsoft that can be used to build dynamic Web sites, Web applications, and XML Web services.
  • It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology.
  • Applications developed using ASP.NET must be hosted on an Internet Information Services (IIS) server.