29 June 2012

SharePoint Interview Question and Answers

Q) Difference between MOSS and WSS
WSS is foundation and MOSS is optional add-on.
You cannot install MOSS of itself. If you try to do this, you will be requested to install WSS first.
Characteristics of WSS
It is a Web Based Application
It stores all information in an MS SQL database.
It displays information using web Parts.
It comes with site templates.
What WSS does not have?
There is no support for indexing and Searching.
It does not have advanced intranet features, such as targeted information and content management.
It has no record management.
It cannot display InfoPath forms in Web Browser.
It cannot display MS Excel spreadsheet as Web Part.
It comes with less than 10 Web parts.
It cannot Read and Write to External Database.
So to achieve all above task which WSS does not have, MOSS came into action.
MOSS 2007
Use global search functionality to find any type of information regardless of type and location.
Target information to one or more User Group.
Use Advanced Content Management.
Import User Data from Active Directory.
Use RSS web part to list information fetched from RSS feeds.
Give each SharePoint user a Personal Web Site.
Search, display content from external Database.
Comparison of Built in Feature of SharePoint
 Features       WSS    MOSS
Alerts            Yes     Yes
RSS              Yes     Yes
File and Document Management     Yes     Yes
Project Management Yes     Yes
Managing Meeting     Yes     NO
Update          NO      Yes
Finding Information   NO      Yes
Indexing        NO      Yes
External Data access NO      Yes
SSP is nothing but collection of configured service to work with MOSS.
Q) What are Site Pages?   how are they different from application pages?
Site pages are customized pages and are saved in to content database. So when you use the SharePoint designer to make custom changes it saves the changes in to content database. If you want to make generic pages in a site collection which will be used by every one, like for instance the ‘Settings.aspx’ page then you need to use application pages.
In other words Site pages are nothing but customized pages stored in content, while application pages are generic pages which will be used by all the sites in a site collection
Q) What are site columns?
Site columns allows you to create a lookup columns in one location and share the column with any custom lists that would need it.
 Q) What is a Site Definition? How can you create a new Site Definition?
A site definition is a collection of files that defines the structure & layout of site templates. Confused? Well, don't be. A site definition comprised of a webtemp.xml file which  in turn defined the order of various site templates available in that site definition. Site definition file also include a separate directory structure that includes all the other core files required. The webtemp.xml file is stored in %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML location and directory that contains all the core files is %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions \12\TEMPLATE\SiteTemplates.
Steps for creating a custom Site Definition
Step 1.Create a copy of existing site Definition structure by navigating to %COMMONPROGRAMFILES%\\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates. Rename the file as NewLOB (short form for New line of business).
Step 2. Navigate to %COMMONPROGRAMFILES%\\Microsoft Shared\web server extensions\12\TEMPLATE\1033 and copy the STS directory and paste it in the same strucutre and rename it as NewLOB.
Step 3. Create webTemp.xml file to register the site definition created in step 1&2.
Step 4. Reset IIS.
Thats it. Now, new site definition is available for use for the new line of business group.
Q) Explain the concept of ghosting/unghosting?
First of all, with the release of WSS 3.0, Microsoft has renamed the concept of ghosting/unghosting as uncustomized/customized pages .
In SharePoint most of the site pages derive from templates. The custom pages only store the difference between them. The template is loaded in memory and applied to the custom pages on fly. In other words the template is stored in a cache. This definitely brings in performance and flexibility. Flexibility is in terms that when we change the template page it’s applied to all custom pages. These pages are loaded from the file system. So pages which are loaded from the file system are termed as ghosted pages.
If the page data is loaded from the content database it’s termed as unghosted pages.
Q) Content types in SharePoint
A content type is a flexible and reusable WSS type definition that defines the columns and behavior for an item in a list or a document in a document library.
E.g : you can create a content type for a customer presentation document with a unique set of columns, an event handler, and its own document template.
Content type can be created by the following
• from the rootweb of a site collection, go to Site Action > Site Settings > Galleries > Site content types
• using a feature
Q)What is the difference between Syncronous & Asyncronous events?
Syncronous calls ending with 'ing' E.g. ItemDeleting Event Handler code execute BEFORE action is committed WSS waits for code to return Option to cancel and return error code
Asyncronous calls ending with 'ed' E.g. ItemDeleted Event Handler code executes AFTER action is committed WSS does not wait for code to return Executed in its own Worker thread.
Q)How to query from multiple lists ?
Use SPSiteDataQuery to fetch data from multiple lists.
Q)What are the various kinds of roles the users can have?
A user can be assigned one of the following roles
    Reader  : Has read-only access to the Web site.
    Contributor :  Can add content to existing document libraries and lists.
    Web Designer :  Can create lists and document libraries and customize pages in the Web site.
    Administrator : Has full control of the Web site.
Q)What is CAML, and why would you use it?
CAML stands for Collaborative Application Markup Language.
CAML is an XML based language which provides data constructs that build up the SharePoint fields, view, and is used for table definition during site provisioning.
CAML is responsible for rending data and the resulting HTML that is output to the user in SharePoint. CAML can be used for a variety of circumstances, overall is used to query, build and customize SharePoint based sites. A general use would be building a CAML query in a SharePoint WebPart in order to retrieve values from a SharePoint list.
Q)What is a SharePoint Feature? What files are used to define a feature?
A SharePoint Feature is a functional component that can be activated and deactivate at various scopes throughout a SharePoint instances, such as at the farm, site collection, web, etc. Features have their own receiver architecture, which allow you to trap events such as when a feature is installing, uninstalling, activated, or deactivated. They are helpful because they allow ease of upgrades and versioning.
The two files that are used to define a feature are the feature.xml and manifest file. The feature XML file defines the actual feature and will make SharePoint aware of the installed feature. The manifest file contains details about the feature such as functionality.
A SharePoint Feature is a functional component that can be activated and deactivate at various scopes throughout a SharePoint instances.
Scopes include
        Farm
        WebApplication
        Site (site collection)
        Web (site)
Features have their own receiver architecture, which allow you to trap events such as when a feature is
        installing
        uninstalling
        activated
        deactivated
The element types that can be defined by a feature include
        menu commands
        link commands
        page templates
        page instances
        list definitions
        list instances
        event handlers
        workflows
The two files that are used to define a feature are
          feature.xml
          manifest file(elements.xml)
The feature XML file defines the actual feature and will make SharePoint aware of the installed feature. The manifest file contains details about the feature such as functionality.
Common stsadm commands associated with feature are
        stsadm -o installfeature
        stsadm -o uninstallfeature
        stsadm -o activatefeature
        stsadm -o deactivatefeature
  ------------------
  Q)What types of SharePoint assets can be deployed with a SharePoint feature?
With Features we can do a lot. For example, you could deploy as follows
    * Simple site customizations
    * Custom site navigation
    * WebParts
    * pages
    * list types
    * list instances
    * event handlers
    * workflows
    * custom actions
Q)What are event receivers?
Event receivers are classes that inherit from the SpItemEventReciever or SPListEventReciever base class (both of which derive out of the abstract base class SPEventRecieverBase), and provide the option of responding to events as they occur within SharePoint, such as adding an item or deleting an item .
SPListEventReceiver, SPItemEventReciever, and SPWebEventReceiver inherit from the abstract base class SPEventReceiverBase.
SPWorkflowLibraryEventReceiver inherits from SPItemEventReceiver.
SPEmailEventReceiver inherits directly from System.Object
Q) What are the built in ways to backup a SharePoint install?

Through the central administration and the stsadm command
Q) What are the differences between the two base classes ?
The difference is the Microsoft.SharePoint.WebPartPages.WebPart base class is meant for backward compatibility with previous versions of SharePoint. The benefit of using the SharePoint WebPart base class is it supported:
    * Cross page connections
    * Connections between Web Parts that are outside of a Web Part zone
    * Client-side connections (Web Part Page Services Component)
    * Data caching infrastructure

Q) how can debugging share point application  ?
   1. build application place .dll into gac and reset iis
   2. On the Debug menu, select Attach to Process
   3. select the Show processes from all users check box.
   4. select W3Wp.exe can attach
   5. refresh sharepoint site point break point

Q) Difference SPSite and SPWeb object
The SPSite object represents a collection of sites (site collection [a top level sites and all its subsites]).
The SPWeb object represents an instance SharePoint Web, and SPWeb object contains things like the actual content.
A SPSite object contains the various subsites and the information regarding them.
      SPSite rootSite = new SPSite("http://jaganinfo-pc:1234/");
       SPWeb objWeb = rootSite.OpenWeb();

Q) How do you connect to a SharePoint list and insert a new List Item?
using(SPSite rootSite = new SPSite("http://jaganinfo-pc:1234/"))
{
          using(SPWeb objWeb = mySite.OpenWeb())
          {
                   SPList interviewList = myWeb.Lists["listtoinsert"];
                   SPListItem newItem = interviewList.Items.Add();
                   newItem["interview"] = "interview";
                   newItem.Update();
          }
}
Q) How would you loop using SPList through all SharePont List items, assuming you know the name (in a string value) of the list you want to iterate through, and already have all the site code written?
          SPList interviewList = rootWeb.Lists["listtoiterate"];
          foreach (SPListItem interview  in interviewList)
          {
                   // Append the code as per your requirement
          }

Q) How could you append a string to the title of a site when it is provisioned?
In the OnActivated event:
          SPWeb objWeb = siteCollection.RootWeb;
          objWeb.Title += "JaganInfo.com";
          objWeb.Update();

Q) What is the difference between SPListItem.SystemUpdate and SPListItem.Update Method
SPListItem.SystemUpdate:
Updates the database(Sharepoint list) with changes that are made to the list item, without effecting changes in the Modified Time or Modified By fields.
SPListItem.SystemUpdate Overloaded Method:
SPListItem.SystemUpdate():
Updates the database with changes made to the list item, without effecting changes in the Modified or Modified By fields.
SPListItem.SystemUpdate(Boolean):
Updates the database with changes that are made to the list item, without effecting changes in the Modified Time or Modified By fields, or optionally, the item version.
SPListItem.Update():
Updates the database(Sharepoint list) with changes that are made to the list item/new version of item, and changes in the Modified Time or Modified By fields.
//Take the reference of that item
          SPListItem listItem = listItemCOll[icount];
          listItem["FIRST_NAME"] = “Jagan”;
          listItem["LAST_NAME"] = “Mohan”;
          listItem["EMAIL_ADDR"] = “jaganinfoway[at]gmail.com”;
          //Update the Item
          listItem.SystemUpdate(false);
//The argument false informs the SP object Model not increment versions.
          listItem.Update();


Wipro Sharepoint Interview Questions

Wipro Infotech Sharepoint Interview Questions (MOSS)
1) What is the use of master page? Can you tell me , I want to put the Dropdown control in master page,and this dropdown control should populate the data from database?
3) How can you create and deploy the workflows by using Visualstudio 2005, tell me the stepwise
4) Can you tell me how to create the HRLeaveapproval workflow by using SPDesinger?
5) What is the use of infopath forms? 
I have the List called ”Employees”,in that there is a Field called ” Department”, 
I want to Fill the Department names in the infopathform control 
( eg: Take the Dropdown control , i want to fill this Department names in Dropdowncontrol)
6) 10 users entering the data in infopath forms and submit the data, 
now i want to generate the reports for those 10 users, how can you do this?
7) What is the use of BDC ?
8) How can you Configure the Enterprise Search?
9) What are the Base class methods you used in developing custom webparts?
10)How many ways you can deploy the custom webparts ? with out install in GAC, is there any other way to deploy ?
11) About Execl Services,
12) Feature event receivers Classes?
13) What is the use of “Run with elevated Previliages”?


Sharepoint interview questions for Accenture

SharePoint Important Definations
Q. What Do you know about SharePoint Object Model?

Ans.
 In Sharepoint Object model there are two Important namespaces, Microsoft.Office.Server and Microsoft.SharePoint . The Microsoft.Office.Server namespace is the root namespace of all Office Server objects and Microsoft.SharePoint is the root namespace for all WSS objects. Read More Here.

Q.How Does SharePoint work?

Ans.
 The browser sends a DAV packet to IIS asking to perform a document check in. PKMDASL.DLL, an ISAPI DLL, parses the packet and sees that it has the proprietary INVOKE command. Because of the existence of this command, the packet is passed off to msdmserv.exe, who in turn processes the packet and uses EXOLEDB to access the WSS, perform the operation and send the results back to the user in the form of XML.


Q What is CAML?

Ans: 
CAML stands for Collaborative Application Markup Language and is an XML-based languagethat is used in MicrosoftWindows SharePoint Services to define sites and lists, including, for Eg, fields, views, or forms, but CAML is also used to define tables in the Windows SharePoint Servies database during site provisioning.

Q. What are Application Pages in SharePoint?

Ans : Unlike site pages (for example, default.aspx), a custom application page is deployed once per Web server and cannot be customized on a site-by-site basis. Application pages are based in the virtual _layouts directory. In addition, they are compiled into a single assembly DLL.

A good example of an Application Page is the default Site Settings page: every site has one, and it's not customizable on a per site basis (although the contents can be different for sites).

With application pages, you can also add inline code. With site pages, you cannot add inline code.
Typically, you link custom application pages to application.master, the master page file that is used by the default application pages in Windows SharePoint Services. You should also write application pages to inherit from a base class defined inside the Microsoft.SharePoint assembly named LayoutsPageBase.

Q. What does RunWithElevatedPrivileges do?

Ans.
 There are certain object model calls model that require site-administration privileges. To bypass access-denied error, we use RunWithElevatedPrivileges property when request is initiated by a nonprivileged user. We can successfully make calls into the object model by calling the RunWithElevatedPrivileges method provided by the SPSecurity class.

Q. While creating a Web part, which is the ideal location to Initialize my new controls?

Ans.
 Override the CreateChildControls method to include your new controls. You can control the exact rendering of your controls by calling the .Render method in the web parts Render method.

Accenture Sharepoint Interview Questions

1) Tell me about your sharepoint experiences ?
2) Did you ever worked in Web Services ? How you called Webmethods ?
3) What type of Webparts you are developed in your current project ?
4) How many ways we can deploy the webpart ?    Which is the best method to deploy the Webpart ?
5) What are new features in MOSS 2007 ?
6) What are the permission levels in Sharepoint ?
7) What is Sharepoint Object Model ?
8) What are basic building blocks for Sharepoint ?
9) How many types of Event Handlers in Sharepoint ? where did you use these event handlers in your project ?
10) What are the Security levels in Sharepoint ?
11) What is the default authentication level in Sharepoint ?
12) Can we impliment Forms Authentication in Sharepoint or is there any custom Authentication ?
13) What is meant by SignIn ?
14) What is meant by MetaData Cache ?
15) How can you impliment Data Fragment cache ? What is VaryByParam ?
16) When configuring Enterprise Search , what are the instances that you are created ?

An Interview with Accenture based on Microsoft SharePoint

Q. What is SharePoint?
A. SharePoint is a software product developed by Microsoft for developing Portals, Collaboration Sites, Publishing sites, content management sites, etc.
Q. Which Site Template you have used for your Project?
A. We have used Publishing Site Template.
Q. Why Publishing, why not Collaboration Site?
A. Publishing because there is usually a small group of people communicating to a much larger group of people. When we’re Collaborating, we share information with others in our group, and those people have an equal opportunity to share information as well.
CollaborationPublishing
Figure: Collaboration                                                       Figure: Publishing
Source: MSDN
Q. How you create a custom Site Definition?
A. We copy the STS folder under Template Folder in 12 and rename it to our Custom Site name. To register our custom site definition we create a WebTemp<Site-Name>.xml file under /12/Templates/1033/XML Folder. And thereafter make necessary changes in your ONET.xml file under the Custom Site Name Folder.
PS: This is an overview. You will have to dive into individual files to explore the details.
Q. How you create Custom list definitions?
A. in VS 2005, if you have WSS extensions installed. When you create a new project, in the left navigation you should click SharePoint, you will get the option to create a list definition, as you will select it. A drop down populated with category of List definition you are willing to create will be shown. I select Custom List and then I open the Schema.xml file and include the columns under <FieldRefs> tag and set the guid and other flags for that column. All the details for the field will go under the <fields> tag. And thereafter we can deploy it by right clicking on the project and click deploy.
Q. Which is the file we use in BDC to map with the Data Source?
A. Application Definition File (ADF). Please go through the structure of ADF.
Q. Explain few frequently used classes under WSS Object Model?
A. I explained little about each of these classes and there main purpose. SPWebApplication, SPSite, SPWeb, SPList etc.
Q. What is CAML Query, explain few tags used under it?
A. CAML queries are used to query the SharePoint lists and fetch List items based on the query.
Q. How you will create custom error pages?
A. we can create a class library and inherit the IHTTPMODULE interface and override the methods meant for displaying Access denied and Errors. Thereafter we can put the dll in the GAC and register our call our dll in <HTTPModules> section in web.config file under our application virtual directory.
Q. Which all event receivers are available in MOSS 2007?
A. There are four namely SPWebEventReceiver , SPListEventReceiver , SPItemEventReceiver, SPEmailEventReceiver .
Q. What is the difference between Synchronous and Asynchronous Event?
A.synchronous event handler are called before the event is completed while Asynchronous will be called after the event is completed.Events name ending with –ing like itemadding,itemupdating are synchronous while events ending with –ed like itemadded, itemupdated are Asynchronous.
Q. What is Feature? Explain the Structure of Feature Folder.
Q. How we can fetch Search results programmatically?
A. We can use methods Query () and QueryEx() under  Web Service present at “http ://< Site>/_vti_bin/Search.asmx” or search object model. Under search object model we have KeywordQuery class underAssembly:Microsoft.Office.Server.Search andNamespace: Microsoft.Office.Server.Search.Query which will fetch you results based on keyword search and under same assembly and namespace we have fulltextsearchquery class which will fetch you results based on some specific managed property.