Share Point 2010 Interview Questions

Embed Size (px)

Citation preview

  • 8/8/2019 Share Point 2010 Interview Questions

    1/17

    Sharepoint 2010 Interview Questions (may also apply for MOSS 2007)

    Q: How can I check to see if a slow loading SharePoint page has closed webparts?

    A. The way to check for closed webparts is ?contents=1 at the end of the url

    Example: http://www.sharepointjoel.com/default.aspx?contents=1

    Brings up the webpart maintenance page and I can see the categories and a content editorwebpart that are closed. These are affecting the performance of the page negatively andproviding little value. Now if I at some point want to re-add the categories web part, I should notdelete it. As well, a content editor web part will need to be recreated. There is no recycle bin forrestoring deleted content in a content editor web part.

    Q. why should you not use Render()? [ only use RenderContents() or use the more OOapproach and implement CreateChildControls() ]

    A. Basically the WPSC provides developers with a SharePoint specific client-side DOM thatallows developers to listen for events, interact with Web Parts and even set properties... allthrough script on the client. The WPSC is implemented using a bunch of client-side code. Youcan see a snippet of it if you look at the source of a SharePoint page.When SharePoint renders the page, it adds a unique ID to the HTML as well as aunique ID to the ... developers can use these ID's to get to the Web Part via client-sidecode.When you use RenderContents() or CreateChildControls(), the rendered markup produced bythose methods is put inside the . If you override Render(), you are replacing the entire! Thus, by replacing the entire table, you are breaking the WPSC... the wholeSharePoint specific DOM.

    http://www.andrewconnell.com/blog/archive/2008/02/18/Understanding-how-Web-Parts-are-rendered-why-to-never-use.aspx

    - What are the types of authentication available for Sharepoint 2010 ?

    Claims

    Windows

    Forms-based authentication

    Ref : http://technet.microsoft.com/en-us/library/cc262350(office.14).aspx- What is claims based authentication ?

    Claims is a new authentication method that SharePoint 2010 can utilize. This allows a singleauthentication store for multiple types of authentication (Windows NTLM, SQL FBA, LDAP, etc)which allows all of these types of authentication to access SharePoint under a single URL.

    Claims creates a SAML token based on the sign-in, that contains the users identity.

    Ref: http://blogs.technet.com/ritaylor/archive/2009/06/03/claims-based-authentication-an-overview.aspx- How do we use the claims identity outside of SharePoint?

    LOB systems

    External partner services

    Separate SharePoint farms

    http://technet.microsoft.com/en-us/library/cc262350(office.14).aspxhttp://blogs.technet.com/ritaylor/archive/2009/06/03/claims-based-authentication-an-overview.aspxhttp://blogs.technet.com/ritaylor/archive/2009/06/03/claims-based-authentication-an-overview.aspxhttp://technet.microsoft.com/en-us/library/cc262350(office.14).aspxhttp://blogs.technet.com/ritaylor/archive/2009/06/03/claims-based-authentication-an-overview.aspxhttp://blogs.technet.com/ritaylor/archive/2009/06/03/claims-based-authentication-an-overview.aspx
  • 8/8/2019 Share Point 2010 Interview Questions

    2/17

    - What is LINQ to Sharepoint ?

    LINQ is a feature of the programming languages C# 3.0 and Visual Basic .NET

    LINQ adds, to each of the languages, a SQL-like syntax and vocabulary for querying datasources.

    LINQ to Sharepoint allows developers to use SQL-like syntax to query Lists and Librariesin Sharepoint.

    LINQ to Sharepoint internally converts the LINQ query to a CAML query to fetch records

    Advantage : Strongly typed access to the entities of the list.

    Disadvantage : If the new columns are added or its datatype changed, the datacontextclass used by LINQ is no longer valid and may break the code

    - Name the tool used to create DataContent classes for use in LINQ queries?SPMetal.exe- What are the advantages and disadvantages of LINQ to Sharepoint ?Advantages:

    Intellisense

    Strongly typed access to the entities of the list

    Faster development

    Simplify complex queriesDisadvantages:

    If the new columns are added or its datatype changed, the datacontext class used byLINQ is no longer valid and may break the code

    Extra layer to the actual CAML queryIn Sharepoint 2010, at what levels can a workflow be activated ? ( Alt Q: What is the additionalscope a workflow be activated in Sharepoint 2010 ) ?Can a workflow created in Sharepoint Designer be edited in Visual Studio ?- Can MS Visio be used to create a Sharepoint workflow ?MS Visio cannot be used to create the Sharepoint workflow itself, but can be used for workflowvisualization. What this means is that, the flow diagram designed in Visio can be imported inSharepoint Designer where all the functionality can be added and deployed to Sharepoint.Note:To use Visio 2010 for workflow visualization, you must be running the Enterprise version ofSharePoint Server 2010 and Visio 2010 Premium.

    - Whats new in Shared Service Provider (SSP ) in Sharepoint 2010 ? ( Alt Q: What is"Service Application" ? )

    Service Application or Service App is a concept in Sharepoint 2010, where SSP Services aresplit out into separate services.What is replaced :

    Profiles, Audiences = People Service App

    Search = Search Service App

    Excel = Excel Service AppWhats new :

    Project Server = Project Server App

    Visio Services = Visio Service AppAdvantages :

    Web applications can be configured to only use a subset of the deployed services.

    You can deploy multiple instances of the same service in a farm by giving the newservice instances unique names.

    You can share services across multiple web applications in a farm.Ref :http://blogs.msdn.com/uksharepoint/archive/2009/10/21/sharepoint-2010-new-shared-services.aspx

    http://blogs.msdn.com/uksharepoint/archive/2009/10/21/sharepoint-2010-new-shared-services.aspxhttp://blogs.msdn.com/uksharepoint/archive/2009/10/21/sharepoint-2010-new-shared-services.aspxhttp://blogs.msdn.com/uksharepoint/archive/2009/10/21/sharepoint-2010-new-shared-services.aspxhttp://blogs.msdn.com/uksharepoint/archive/2009/10/21/sharepoint-2010-new-shared-services.aspx
  • 8/8/2019 Share Point 2010 Interview Questions

    3/17

    http://aknauer.blogspot.com/2009/11/sharepoint-2010-advantages-of-service.htmlhttp://www.andrewconnell.com/blog/archive/2009/10/19/the-new-service-application-architecture-in-sharepoint-server-2010.aspxhttp://www.andrewmilsark.com/blog/post/2009/10/20/SharePoint-2010-Service-Applications-(Shared-Services)-Overview.aspx

    What are the two base classes a WebPart you are going to use within SharePoint 2007 caninherit from?

    There are two base classes that a WebPart which is going to be consumed by SharePoint caninherit from, either the SharePoint WebPart Base class or the ASP.NET 2.0 WebPart base class.When inheriting from the SharePoint WebPart Base class your derived WebPart class will inheritfrom Microsoft.SharePoint.WebPartPages.WebPart. When inheriting from the ASP.NET 2.0WebPart base class your derived WebPart class will inherit fromSystem.Web.UI.WebControls.WebParts.WebPart. It is considered good practice to use theASP.NET WebPart base class since the old base class is meant for backwards compatibility withprevious version of SharePoint, however there are four exception when it is better to leveragefunctionality from the SharePoint WebPart base class:

    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

    What are the differences between the two base classes and what are the inherit benefits ofusing one over another?

    - The difference is the Microsoft.SharePoint.WebPartPages.WebPart base class ismeant 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 infrastructureASP.NET 2.0 WebParts are generally considered better to use because SharePoint is builtupon the ASP.NET 2.0 web architecture. Inheriting from the ASP.NET 2.0 base class offersyou features that inherit to ASP.NET 2.0, such as embedding resources as opposed to useClassResources for deployment of said types.

    - What is the GAC?

    The GAC stands for the global assembly cache. It is the machine wide code cache which will givecustom binaries place into the full trust code group for SharePoint. Certain SharePoint assets,such as Feature Receivers need full trust to run correctly, and therefore are put into the GAC.You should always try to avoid deployment to the GAC as much as possible since it will possiblyallow development code to do more than it was intended to do.

    - What is strong naming (signing) a WebPart assembly file mean?

    Signing an assembly with a strong name (a.k.a strong naming) uses a cryptographic key pair thatgives a unique identity to a component that is being built. This identity can then be referredthroughout the rest of the environment. In order to install assemblies into the GAC, they must bestrongly named. After signing, the binary will have a public key token identifier which can be useto register the component in various other places on the server.

    http://aknauer.blogspot.com/2009/11/sharepoint-2010-advantages-of-service.htmlhttp://www.andrewconnell.com/blog/archive/2009/10/19/the-new-service-application-architecture-in-sharepoint-server-2010.aspxhttp://www.andrewconnell.com/blog/archive/2009/10/19/the-new-service-application-architecture-in-sharepoint-server-2010.aspxhttp://www.andrewmilsark.com/blog/post/2009/10/20/SharePoint-2010-Service-Applications-(Shared-Services)-Overview.aspxhttp://www.andrewmilsark.com/blog/post/2009/10/20/SharePoint-2010-Service-Applications-(Shared-Services)-Overview.aspxhttp://aknauer.blogspot.com/2009/11/sharepoint-2010-advantages-of-service.htmlhttp://www.andrewconnell.com/blog/archive/2009/10/19/the-new-service-application-architecture-in-sharepoint-server-2010.aspxhttp://www.andrewconnell.com/blog/archive/2009/10/19/the-new-service-application-architecture-in-sharepoint-server-2010.aspxhttp://www.andrewmilsark.com/blog/post/2009/10/20/SharePoint-2010-Service-Applications-(Shared-Services)-Overview.aspxhttp://www.andrewmilsark.com/blog/post/2009/10/20/SharePoint-2010-Service-Applications-(Shared-Services)-Overview.aspx
  • 8/8/2019 Share Point 2010 Interview Questions

    4/17

    What are safe controls, and what type of information, is placed in that element in aSharePoint web.config file?

    When you deploy a WebPart to SharePoint, you must first make it as a safe control to use within

    SharePoint in the web.config file. Entries made in the safe controls element of SharePoint areencountered by the SharePointHandler object and will be loaded in the SharePoint environmentproperly, those not will not be loaded and will throw an error.In the generic safe control entry (this is general, there could be more), there is generally theAssembly name, the namespace, the public key token numeric, the typename, and the safedeclaration (whether it is safe or not). There are other optional elements.

    What is the CreateChildControls() method? How can you use it to do something simplelike displaying a Label control?

    The CreateChildControls method in WebParts is used to notify the WebPart that there arechildren controls that should be output for rendering. Basically, it will add any child ASP.NETcontrols that are called instantiating each control with its relevant properties set, wire any relevant

    event handlers to the control, etc. Then the add method of the control class will add the control tothe controls collection. In the relevant WebPart render method, the EnsureChildControls methodcan be called (or set to false if no child controls should be called) to ensure that theCreateChildControls method is run. When using CreateChildControls it implies that your WebPartcontains a composition of child controls.In order to create something like a label control in Create, you would create a new label controlusing the new keyword, set the various properties of the control like Visible=True and ForeColor =Color.Red, and then use Controls.Add(myLabelControl) to add the control to the controlscollection. Then you can declare EnsureChildControls in the Render method of the WebPart.

    What does the RenderContents method do in an ASP.NET 2.0 WebPart?

    The render contents method will render the WebPart content to the writer, usually anHtmlTextWriter since WebParts will output to an HTML stream. RenderContents is used to tellhow the controls that are going to be displayed in the WebPart should be rendered on the page.*** Side Question: I got asked what the difference between CreateChildControls and theRenderContents method. The CreateChildControls method is used to add controls to theWebPart, and the RenderContents method is used to tell the page framework how to render thecontrol into HTML to display on a page.

    - What is the WebPartManager sealed class? What is its purpose?The WebPartManager sealed class is responsible for managing everything occurring on aWebPart page, such as the WebParts (controls), events, and misc. functionality that will occur inWebPartZones. For example, the WebPartManager is responsible for the functionality that isprovided when you are working with moving a WebPart from WebPartZone to WebPartZone. It isknown as the the central class of the Web Part Control Set.*** Side Question: I got asked how many WebPartManager controls should be on a page. In

    order to have WebParts on a page there has to be just one WebPartManager control to manageall the WebParts on the page.

    - What is a SPSite and SPWeb object, and what is the difference between each of theobjects?The SPSite object represents a collection of sites (site collection [a top level sites and all itssubsites]). The SPWeb object represents an instance SharePoint Web, and SPWeb objectcontains things like the actual content. A SPSite object contains the various subsites and theinformation regarding them.

  • 8/8/2019 Share Point 2010 Interview Questions

    5/17

    - What does a SPWebApplication object represent?The SPWebApplication objects represents a SharePoint Web Application, which essentially is anIIS virtual server. Using the class you can instigate high level operations, such as getting all thefeatures of an entire Web Application instance, or doing high level creation operations likecreating new Web Applications through code.

    - Would you use SPWebApplication to get information like the SMTP address of theSharePoint site?Yes, since this is a Web Application level setting. You would iterate through eachSPWebApplication in the SPWebApplication collection, and then use the appropriate propertycalls (OutboundMailServiceInstance) in order to return settings regarding the mail service such asthe SMTP address.

    Side Question: I got asked if there are other ways to send emails from SharePoint. The answer isyes, there is. You can use the SendMail method from the SPutility class to send simple emails,however it is not as robust as using the System.Net.Mail functionality since it doesnt allow thingslike setting priorities on the email.

    - How do you connect (reference) to a SharePoint list, and how do you insert a new ListItem?12345678910

    1112

    C#:using(SPSite mySite = new SPSite("yourserver")){using(SPWeb myWeb = mySite.OpenWeb()){SPList interviewList = myWeb.Lists["listtoinsert"];SPListItem newItem = interviewList.Items.Add();

    newItem["interview"] = "interview";newItem.Update();

    }}

    - How would you loop using SPList through all SharePont List items, assuming you knowthe name (in a string value) of the list you want to iterate through, and already have all thesite code written?

    123456

    C#:SPList interviewList =myWeb.Lists["listtoiterate"];foreach (SPListItem interview in interviewList){// Do Something}

    - How do you return SharePoint List items using SharePoint web services?In order to retrieve list items from a SharePoint list through Web Services, you should use thelists.asmx web service by establishing a web reference in Visual Studio. The lists.asmx exposesthe GetListItems method, which will allow the return of the full content of the list in an XML node.It will take parameters like the GUID of the name of the list you are querying against, the GUID ofthe view you are going to query, etc.Side Question: I got asked how I built queries with the lists.asmx web service. In order to buildqueries with this service, one of the parameters that the GetListItems method exposes is the

  • 8/8/2019 Share Point 2010 Interview Questions

    6/17

    option to build a CAML query. There are other ways to do this as well, but that was how Ianswered it.

    What is the difference between an Internet and an intranet site?

    An internet site is a normal site that anyone on the internet can access (e.g., www.msn.com,www.microsoft.com, etc.). You can set up a site for your company that can be accessed byanyone without any user name and password.An intranet (or internal network), though hosted on the Web, can only be accessed by people whoare members of the network. They need to have a login and password that was assigned to themwhen they were added to the site by the site administrator

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

    - How customizable is the user-to-user access?User permissions apply to an entire Web, not to documents themselves. However, you can haveadditional sub webs that can optionally have their own permissions. Each user can be given anyof four default roles. Additional roles can be defined by the administrator.Can each user have access to their own calendar?Yes there are two ways to do this,

    by creating a calendar for each user, or

    by creating a calendar with a view for each user

    - Can SharePoint be linked to a SQL database?

    This is possible via a custom application, but it not natively supported by SharePoint or SQLServer.

    - What does partial trust mean the Web Part developer?If an assembly is installed into the BIN directory, the code must be ensured that provides errorhandling in the event that required permissions are not available. Otherwise, unhandled securityexceptions may cause the Web Part to fail and may affect page rendering on the page where theWeb Part appears

    How would you go about getting a reference to a site?-

    How can I raise the trust level for assemblies installed in the BIN directory?

    Windows SharePoint Services can use any of the following three options from ASP.NET and theCLR to provide assemblies installed in the BIN directory with sufficient permissions. The followingtable outlines the implications and requirements for each option.

    12

    34

    C#:oSPSite = new SPSite("http:/server");

    oSPWeb = oSPSite.OpenWeb();

  • 8/8/2019 Share Point 2010 Interview Questions

    7/17

    Option Pros Cons

    Increase the trust levelfor the entire virtualserver. For moreinformation, see"Setting the trust levelfor a virtual server"

    Easy to implement.In a development environment,increasing the trust level allows youto test an assembly with increasedpermissions while allowing you torecompile assemblies directly intothe BIN directory without resettingIIS.

    This option is least secure.This option affects all assemblies used bythe virtual server.

    There is no guarantee the destinationserver has the required trust level.Therefore, Web Parts may not work onceinstalled on the destination server.

    Create a custom policyfile for yourassemblies. For moreinformation, see "Howdo I create a custompolicy file?"

    Recommended approach.This option is most secure.

    An assembly can operate with aunique policy that meets theminimum permission requirementsfor the assembly.

    By creating a custom securitypolicy, you can ensure thedestination server can run yourWeb Parts.

    Requires the most configuration of allthree options.

  • 8/8/2019 Share Point 2010 Interview Questions

    8/17

    Install your assembliesin the GAC

    Easy to implement.This grants Full trust to yourassembly without affecting the trustlevel of assemblies installed in theBIN directory.

    This option is less secure.Assemblies installed in the GAC areavailable to all virtual servers and

    applications on a server running WindowsSharePoint Services. This could representa potential security risk as it potentiallygrants a higher level of permission to yourassembly across a larger scope thannecessary

    In a development environment, you mustreset IIS every time you recompileassemblies.

    Licensing issues may arise due to theglobal availability of your assembly.

    - When retrieving List items using SharePoint Web Services, how do you specify explicitcredentials to be passed to access the list items?In order to specify explicit credentials with a Web Service, you generally instantiate the webservice, and then using the credentials properties of the Web Service object you use theSystem.Net.NetworkCredential class to specify the username, password, and domain that youwish to pass when making the web service call and operations.

    *** Side Question: I got asked when you should state the credentials in code. You must state thecredentials you are going to pass to the web service before you call any of the methods of the

    web service, otherwise the call will fail.- What is CAML, and why would you use it?CAML stands for Collaborative Application Markup Language. CAML is an XML based languagewhich provides data constructs that build up the SharePoint fields, view, and is used for tabledefinition during site provisioning. CAML is responsible for rending data and the resulting HTMLthat is output to the user in SharePoint. CAML can be used for a variety of circumstances, overallis used to query, build and customize SharePoint based sites. A general use would be building aCAML query in a SharePoint WebPart in order to retrieve values from a SharePoint list.

    - What is impersonation, and when would you use impersonation?

    Impersonation can basically provide the functionality of executing something in the context of adifferent identity, for example assigning an account to users with anonymous access. You woulduse impersonation in order to access resources on behalf of the user with a different account, thatnormally, that wouldnt be able to access or execute something.

    - What is the IDesignTimeHtmlProvider interface, and when can you use it in WebParts?The IDesignTimeHtmlProvider interface uses the function GetDesignTimeHtml() which cancontain your relevant render methods. It was helpful to use in 2003 since it allowed your WebPartto have a preview while a page was edited in FrontPage with the Webpart on it, because theGetDesignTimeHtml() method contains the HTML for the designer to render.

  • 8/8/2019 Share Point 2010 Interview Questions

    9/17

    - What are WebPart properties, and what are some of the attributes you see whendeclaring WebPart properties in code?WebPart properties are just like ASP.NET control properties, they are used to interact with andspecify attributes that should be applied to a WebPart by a user. Some of the attributes you seewith ASP.NET 2.0 properties are WebDescription, WebDisplayName, Category, Personalizable,and WebBrowsable. Although most of these properties come from theSystem.Web.UI.WebControls.WebParts class, ones like Category come out ofSystem.ComponentModel namespace.

    - Why are properties important in WebPart development, and how have you exploited themin past development projects? What must each custom property have?

    Properties are important because WebParts allow levels of personalization for each user.WebPart properties make it possible for a user to interact, adjust, and increase overall experiencevalue with the programmatic assets that you develop without having the need to use an externaleditor or right any code. A very simple example of exploiting a property would be something likeallowing the user to change the text on the WebPart design interface so that they can displaywhatever string of text they desire.Each custom property that you have must have the appropriate get and set accessor methods.

    What are ClassResources? How do you reference and deploy resources with an ASP.NET2.0 WebPart?ClassResources are used when inheriting from the SharePoint.WebPart.WebPartPages.WebPartbase class, and are defined in the SharePoint solution file as things that should be stored in thewpresources directory on the server. It is a helpful directory to use in order to deploy customimages. In ASP.NET 2.0, typically things such as images are referenced by embedding them asresources within an assembly. The good part about ClassResources is they can help to eliminaterecompiles to change small interface adjustments or alterations to external JavaScript files.

    What is a SharePoint Solution File? How does it differ from WebPart .cab files in legacydevelopment? What does it contain?

    A SharePoint solution file is essentially a .cabinet file with all a developers ustom componetssuffixed with a .wsp extension that aids in deployment. The big difference with SharePointsolution files is is that a solution:allows deployment to all WFEs in a farmis highly manageable from the interface allowing deployment, retraction, and versioningCan package all types of assets like site definitions, feature definitions (and associatedcomponents), Webparts, etc.Can provide Code Access Security provisioning to avoid GAC deploymentsJust to name a few things

    - What is a .ddf file and what does it have to do with SharePoint Solution creation?

    A .ddf file is a data directive file and is used when building the SharePoint solution bundlespecifying the source files and their destination locations. The important thing for someone tounderstand is that the .ddf file will be passed as a parameter to the MAKECAB utility toorchestrate construction of the SharePoint solution file.

    - What file does a SharePoint solution package use to orchestrate (describe) its packagedcontents?The solution Manifest.XML file.

  • 8/8/2019 Share Point 2010 Interview Questions

    10/17

    What deployment mechanism can you use to instigate Code Access Security attributes foryour WebParts?

    SharePoint solution files can add in order to handle code access security deployment issues. Thisis done in the element in the SharePoint solution manifest.XML, which makes it easier to getassemblies the appropriate permissions in order to operate in the bin directory of the webapplication.

    - 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 variousscopes throughout a SharePoint instances, such as at the farm, site collection, web, etc. Featureshave their own receiver architecture, which allow you to trap events such as when a feature isinstalling, uninstalling, activated, or deactivated. They are helpful because they allow ease ofupgrades and versioning.The two files that are used to define a feature are the feature.xml and manifest file. The featureXML file defines the actual feature and will make SharePoint aware of the installed feature. Themanifest file contains details about the feature such as functionality.Side Question: I got asked how the introduction of features has changed the concept of site

    definitions. SharePoint features are important when understanding the architecture of sitedefinitions, since the ONET.XML file has been vastly truncated since it has several featurestapled on it.

    - What types of SharePoint assets can be deployed with a SharePoint feature?Features can do a lot. For example, you could deploy

    Simple site customizations

    Custom site navigation

    WebParts

    pages

    list types

    list instances

    event handlers

    workflows

    custom actions

    - What are event receivers?Event receivers are classes that inherit from the SpItemEventReciever or SPListEventRecieverbase class (both of which derive out of the abstract base class SPEventRecieverBase), andprovide the option of responding to events as they occur within SharePoint, such as adding anitem or deleting an item.- When would you use an event receiver?Since event receivers respond to events, you could use a receiver for something as simple ascanceling an action, such as deleting a document library by using the Cancel property. This wouldessentially prevent users from deleting any documents if you wanted to maintain retention ofstored data.

    - What base class do event receivers inherit from?Event receivers either inherit from the SPListEventReciever base class or theSPItemEventReciever base class, both which derive from the abstract base classSPEventReceiverBase.

    - If I wanted to not allow people to delete documents from a document library, how would Igo about it?

  • 8/8/2019 Share Point 2010 Interview Questions

    11/17

    You would on the ItemDeleting event set: properties.Cancel= true.

    33) What is the difference between an asynchronous and synchronous event receivers?

    An asynchronous event occurs after an action has taken place, and a synchronous eventoccurs before an action has take place. For example, an asynchronous event is

    ItemAdded, and its sister synchronous event is ItemAdding.

    - How could you append a string to the title of a site when it is provisioned?In the OnActivated event:123

    SPWeb site = siteCollection.RootWeb;site.Title += "interview";site.Update();

    - Can an event receiver be deployed through a SharePoint feature? Yes.

    - What is a content type?

    A content type is an information blueprint basically that can be re-used throughout a SharePointenvironment for defining things like metadata and associated behaviors. It is basically an

    extension of a SharePoint list, however makes it portable for use throughout an instanceregardless of where the instantiation occurs, ergo has location independence. Multiple contenttypes can exist in one document library assuming that the appropriate document library settingsare enabled. The content type will contain things like the metadata, listform pages, workflows,templates (if a document content type), and associated custom written functionality.

    - Can a content type have receivers associated with it?

    Yes, a content type can have an event receiver associated with it, either inheriting from theSPListEventReciever base class for list level events, or inheriting from the SPItemEventRecieverbase class. Whenever the content type is instantiated, it will be subject to the event receivers thatare associated with it.

    - What two files are typically (this is kept generally) included when developing a contenttype, and what is the purpose of each?

    There is generally the main content type file that holds things like the content type ID, name,group, description, and version. There is also the ContentType.Fields file which contains thefields to include in the content type that has the ID, Type, Name, DisplayName, StaticName,Hidden, Required, and Sealed elements. They are related by the FieldRefs element in the maincontent type file.

    - What is an ancestral type and what does it have to do with content types?

    An ancestral type is the base type that the content type is deriving from, such as Document(0x0101). The ancestral type will define the metadata fields that are included with the custom

    content type.- Can a list definition be derived from a custom content type?

    Yes, a list definition can derive from a content type which can be seen in the schema.XML of thelist definition in the element.- When creating a list definition, how can you create an instance of the list?

    You can create a new instance of a list by creating an instance.XML file.- What is a Field Control?

  • 8/8/2019 Share Point 2010 Interview Questions

    12/17

    Field controls are simple ASP.NET 2.0 server controls that provide the basic field

    functionality of SharePoint. They provide basic general functionality such as displaying

    or editing list data as it appears on SharePoint list pages.

    - What base class do custom Field Controls inherit from?

    This varies. Generally, custom field controls inherit from theMicrosoft.SharePoint.WebControls.BaseFieldControl namespace, but you can inherit from thedefault field controls.

    - What is a SharePoint site definition? What is ghosted (uncustomized) and unghosted(customized)?

    SharePoint site definitions are the core set of functionality from which SharePoint site are builtfrom, building from the SiteTemplates directory in the SharePoint 12 hive. Site definitions allowseveral sites to inherit from a core set of files on the file system, although appear to have uniquepages, thereby increasing performance and allowing changes that happen to a site propagate toall sites that inherit from a site definition. Ghosted means that when SharePoint creates a new

    site it will reference the files in the related site definition upon site provisioning. Unghosted meansthat the site has been edited with an external editor, and therefore the customizations are insteadstored in the database, breaking the inheritance of those files from the file system.

    - How does one deploy new SharePoint site definitions so that they are made aware to theSharePoint system?

    The best way to deploy site definitions in the SharePoint 2007 framework is to use a SharePointsolution file, so that the new site definition is automatically populated to all WFEs in theSharePoint farm.

    - What is an ancestral type and what does it have to do with content types?

    An ancestral type is the base type that the content type is deriving from, such as Document(0x0101). The ancestral type will define the metadata fields that are included with the customcontent type.

    - Can a list definition be derived from a custom content type?

    Yes, a list definition can derive from a content type which can be seen in the schema.XML of thelist definition in the element.

    - When creating a list definition, how can you create an instance of the list?

    You can create a new instance of a list by creating an instance.XML file

    - What is a Field Control?

    Field controls are simple ASP.NET 2.0 server controls that provide the basic field functionality ofSharePoint. They provide basic general functionality such as displaying or editing list data as itappears on SharePoint list pages.

    - What base class do custom Field Controls inherit from?

  • 8/8/2019 Share Point 2010 Interview Questions

    13/17

    This varies. Generally, custom field controls inherit from theMicrosoft.SharePoint.WebControls.BaseFieldControl namespace, but you can inherit from thedefault field controls.

    - Can multiple SharePoint installs point to the same DB?

    Multiple SharePoint installs can use the same database server. Not literally the same databaseon that server. That server must be SQL Server 2000 or SQL Server 2005. It cannot be Oracle oranother vendor.

    - How to create links to the mapped network drives?

    Creating links to mapped drives in WSS v3 or MOSS 2007 can be done via the new content typefor .lnk files.

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

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

    - What is the WebPartManager sealed class? What is its purpose?

    The WebPartManager sealed class is responsible for managing everything occurring on aWebPart page, such as the WebParts (controls), events, and misc. functionality that will occur inWebPartZones. For example, the WebPartManager is responsible for the functionality that isprovided when you are working with moving a WebPart from WebPartZone to WebPartZone. It isknown as the the central class of the Web Part Control Set.

    - What is a SPSite and SPWeb object, and what is the difference between each of the

    objects?

    The SPSite object represents a collection of sites (site collection [a top level site and all itssubsites]). The SPWeb object represents an instance SharePoint Web, and SPWeb objectcontains things like the actual content. A SPSite object contains the various subsites and theinformation regarding them.

    - What does a SPWebApplication object represent?

    The SPWebApplication objects represents a SharePoint Web Application, which essentially is anIIS virtual server. Using the class you can instigate high level operations, such as getting all thefeatures of an entire Web Application instance, or doing high level creation operations like

    creating new Web Applications through code.

    - Would you use SPWebApplication to get information like the SMTP address of theSharePoint site?

    Yes, since this is a Web Application level setting. You would iterate through eachSPWebApplication in the SPWebApplication collection, and then use the appropriate propertycalls (OutboundMailServiceInstance) in order to return settings regarding the mail service such asthe SMTP address.

  • 8/8/2019 Share Point 2010 Interview Questions

    14/17

    - How do you return SharePoint List items using SharePoint web services?

    In order to retrieve list items from a SharePoint list through Web Services, you should use thelists.asmx web service by establishing a web reference in Visual Studio. The lists.asmx exposesthe GetListItems method, which will allow the return of the full content of the list in an XML node.It will take parameters like the GUID of the name of the list you are querying against, the GUID of

    the view you are going to query, etc.Side Question: I got asked how I built queries with the lists.asmx web service. In order to buildqueries with this service, one of the parameters that the GetListItems method exposes is theoption to build a CAML query. There are other ways to do this as well, but that was how Ianswered it.

    - When retrieving List items using SharePoint Web Services, how do you specify explicitcredentials to be passed to access the list items?

    In order to specify explicit credentials with a Web Service, you generally instantiate the webservice, and then using the credentials properties of the Web Service object you use theSystem.Net.NetworkCredential class to specify the username, password, and domain that youwish to pass when making the web service call and operations.

    - What is CAML, and why would you use it?CAML stands for Collaborative Application Markup Language. CAML is an XML based languagewhich provides data constructs that build up the SharePoint fields, view, and is used for tabledefinition during site provisioning. CAML is responsible for rending data and the resulting HTMLthat is output to the user in SharePoint. CAML can be used for a variety of circumstances, overallis used to query, build and customize SharePoint based sites. A general use would be building aCAML query in a SharePoint WebPart in order to retrieve values from a SharePoint list.

    - What is impersonation, and when would you use impersonation?Impersonation can basically provide the functionality of executing something in the context of a

    different identity, for example assigning an account to users with anonymous access. You woulduse impersonation in order to access resources on behalf of the user with a different account, thatnormally, that wouldnt be able to access or execute something.

    - What are WebPart properties, and what are some of the attributes you see whendeclaring WebPart properties in code?WebPart properties are just like ASP.NET control properties, they are used to interact with andspecify attributes that should be applied to a WebPart by a user. Some of the attributes you seewith ASP.NET 2.0 properties are WebDescription, WebDisplayName, Category, Personalizable,and WebBrowsable. Although most of these properties come from theSystem.Web.UI.WebControls.WebParts class, ones like Category come out ofSystem.ComponentModel namespace.

    - Why are properties important in WebPart development, and how have you exploited themin past development projects? What must each custom property have?Properties are important because WebParts allow levels of personalization for each user.WebPart properties make it possible for a user to interact, adjust, and increase overall experiencevalue with the programmatic assets that you develop without having the need to use an externaleditor or right any code. A very simple example of exploiting a property would be something likeallowing the user to change the text on the WebPart design interface so that they can displaywhatever string of text they desire.Each custom property that you have must have the appropriate get and set accessor methods.

  • 8/8/2019 Share Point 2010 Interview Questions

    15/17

    - What are ClassResources? How do you reference and deploy resources with an ASP.NET2.0 WebPart?ClassResources are used when inheriting from the SharePoint.WebPart.WebPartPages.WebPartbase class, and are defined in the SharePoint solution file as things that should be stored in thewpresources directory on the server. It is a helpful directory to use in order to deploy customimages. In ASP.NET 2.0, typically things such as images are referenced by embedding them asresources within an assembly. The good part about ClassResources is they can help to eliminaterecompiles to change small interface adjustments or alterations to external JavaScript files.

    - What is a SharePoint Solution File? How does it differ from WebPart .cab files in legacydevelopment? What does it contain?A SharePoint solution file is essentially a .cabinet file with all a developers ustom componetssuffixed with a .wsp extension that aids in deployment. The big difference with SharePointsolution files is is that a solution:allows deployment to all WFEs in a farmis highly manageable from the interface allowing deployment, retraction, and versioningCan package all types of assets like site definitions, feature definitions (and associatedcomponents), Webparts, etc.Can provide Code Access Security provisioning to avoid GAC deploymentsAnd much more..

    - What is a .ddf file and what does it have to do with SharePoint Solution creation?.ddf file is a data directive file and is used when building the SharePoint solution bundlespecifying the source files and their destination locations. The important thing for someone tounderstand is that the .ddf file will be passed as a parameter to the MAKECAB utility toorchestrate construction of the SharePoint solution file.

    - What file does a SharePoint solution package use to orchestrate (describe) its packagedcontents? The solution Manifest.XML file.

    - What deployment mechanism can you use to instigate Code Access Security attributesfor your WebParts?SharePoint solution files can add in order to handle code access security deployment issues. Thisis done in the element in the SharePoint solution manifest.XML, which makes it easier to getassemblies the appropriate permissions in order to operate in the bin directory of the webapplication.- When would you use an event receiver?Since event receivers respond to events, you could use a receiver for something as simple ascanceling an action, such as deleting a document library by using the Cancel property. This wouldessentially prevent users from deleting any documents if you wanted to maintain retention ofstored data.- What base class do event receivers inherit from?Event receivers either inherit from the SPListEventReciever base class or theSPItemEventReciever base class, both which derive from the abstract base classSPEventReceiverBase.- If I wanted to not allow people to delete documents from a document library, how would Igo about it?You would on the ItemDeleting event set: properties.Cancel= true.

    - When running with SPSecurity.RunWithElevatedPrivileges (web context) whatcredentials are being used?

  • 8/8/2019 Share Point 2010 Interview Questions

    16/17

    In a web context, this is the application pool identity. In a timer job and workflow, this will be the'Windows SharePoint Timer Services' identity.- When should you dispose SPWeb and SPSite objects? And even more important, whennot?You should always dispose them if you created them yourself, but not otherwise. You shouldnever dispose SPContext.Current.Web/Site and you should normally not dispose SPWeb ifIsRootWeb is true. More tricky constructs are things along the line of SPList.ParentWeb.Also dispose each web when iterating over SPWeb.WebsAlso dispose SPLimitedWebPartManager's SPWeb property (.web)

    - What bugs have you found in SharePoint? And what did you do to work around them?- What base classes do event receivers inherit from?SPListEventReceiver, SPItemEventReciever, and SPWebEventReceiver inherit from the abstractbase class SPEventReceiverBase.SPWorkflowLibraryEventReceiver inherits from SPItemEventReceiver.SPEmailEventReceiver inherits directly from System.Object.

    - (more advanced) You've created and deployed a Web Part, when you deploy to the serveryou get a page saying your Web Part couldn't be loaded, click here to go to the Web Partmaintenance page, etc. to disable the web part. What step(s) should you take to get astack dump from your web part instead of that error page?Go to the web.config file for your website and find the CallStack Attribute in the SafeControlselement and set the value to true

    - How would you programmatically retrieve a list item?SPQuery and SPSiteDataQuery. Bonus points for knowledge of CrossListQueryCache,PortalSiteMapProvider. Negative points for use of foreach.

    - What are the data types which are supported as Lookup column in SharePoint.Only Single Line of Text and Calculated columns are supported as lookup columns.

    - how can debugging share point application and timer jobs ? with steps?1. build application place .dll into gac and reset iis2. On the Debug menu, select Attach to Process3. select the Show processes from all users check box.4. select W3W.exe and OSWTIMER.exe can attach5. refresh sharepoint site point break point6.

    - what is web part?Web Parts are the fundamental building blocks for Share Point user interface, and with them wecan build and integrate many different types of applications.In share point also be create customweb part using .oscx control

    steps create custom web part1. create web part project copied .oscx control and build application.place .dll file in GAC

    .reset IIS.2. go 12 hive _layout folder create folder past your .oscx control3. go inetpub ->wwwroot->wss->open Your site ->web con fig->create safe control write

    assembly information of web part application4. open sharepoint site ->site action-site editing->Galleries ->web part->new Add your web

    part.

  • 8/8/2019 Share Point 2010 Interview Questions

    17/17

    follow few web part in WSS 3.0Content Editor Web PartData View Web PartList View Web PartImage Web PartMembers Web Part .Page Viewer Web Part

    - What are the advantages of SharePoint Portal Services (SPS) over SharePoint TeamServices (STS)?harePoint Portal Services (SPS) has MUCH better document management. It has check-in,check-out, versioning, approval, publishing, subscriptions, categories, etc. STS does not havethese features, or they are very scaled back. SharePoint Portal Services (SPS) has a bettersearch engine, and can crawl multiple content sources. STS cannot. STS is easier to manageand much better for a team environment where there is not much Document Management goingon. SPS is better for an organization, or where Document Management is crucial.

    What are the built in ways to backup a SharePoint install?A: Through the central administration and the stsadm command