SharePoint Developer Interview Questions

29.What deployment mechanism can you use to instigate Code Access Security attributes for your WebParts?
SharePoint solution files can add in order to handle code access security deployment issues. This is done in the element in the SharePoint solution manifest.XML, which makes it easier to get assemblies the appropriate permissions in order to operate in the bin directory of the web application.
30.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.
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 site definitions, since the ONET.XML file has been vastly truncated since it has several feature stapled on it.
31.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
  • just to name a few
32.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.
33.When would you use an event receiver?
Since event receivers respond to events, you could use a receiver for something as simple as canceling an action, such as deleting a document library by using the Cancel property. This would essentially prevent users from deleting any documents if you wanted to maintain retention of stored data.
34.What base class do event receivers inherit from?
Event receivers either inherit from the SPListEventReciever base class or the SPItemEventReciever base class, both which derive from the abstract base class SPEventReceiverBase.
35.If I wanted to not allow people to delete documents from a document library, how would I go about it?
You would on the ItemDeleting event set: properties.Cancel= true.
36.What is the difference between an asynchronous and synchronous event receivers?
An asynchronous event occurs after an action has taken place, and a synchronous event occurs before an action has take place. For example, an asynchronous event is ItemAdded, and its sister synchronous event is ItemAdding.
37.How could you append a string to the title of a site when it is provisioned?
In the OnActivated event:
C#
< view plain text >
SPWeb site = siteCollection.RootWeb;
  1. site.Title+="interview";
  2. site.Update();
38.Can an event receiver be deployed through a SharePoint feature?
Yes.
39.What is a content type?
  • A content type is an information blueprint basically that can be re-used throughout a SharePoint environment 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 instance regardless of where the instantiation occurs, ergo has location independence.
  • Multiple content types can exist in one document library assuming that the appropriate document library settings are enabled. The content type will contain things like the metadata, listform pages, workflows, templates (if a document content type), and associated custom written functionality.
40.Can a content type have receivers associated with it?
Yes, a content type can have an event receiver associated with it, either inheriting from the SPListEventReciever base class for list level events, or inheriting from the SPItemEventReciever base class. Whenever the content type is instantiated, it will be subject to the event receivers that are associated with it.
41.What two files are typically (this is kept generally) included when developing a content type, 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 the fields 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 main content type file.
42.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 (0×0101). The ancestral type will define the metadata fields that are included with the custom content type.
43.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 the list definition in the element.
44.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.
45.What is a Field Control?
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.
46.What base class do custom Field Controls inherit from?
This varies. Generally, custom field controls inherit from the Microsoft.SharePoint.WebControls.BaseFieldControl namespace, but you can inherit from the default field controls.
47.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 built from, building from the SiteTemplates directory in the SharePoint 12 hive.
  • Site definitions allow several sites to inherit from a core set of files on the file system, although appear to have unique pages, thereby increasing performance and allowing changes that happen to a site propagate to all 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 means that the site has been edited with an external editor, and therefore the customizations are instead stored in the database, breaking the inheritance of those files from the file system.
48.What does CMDUI.XML contain?
The definitions for the out-of-the-box ribbon elements are split across several files in the SharePoint root, with TEMPLATE\GLOBAL\XML\CMDUI.XML being the main one.
49.Why would you use LINQ over CAML for data retrieval?
Unlike CAML, with LINQ to SharePoint provider, you are working with strongly typed list item objects. For example, an item in the Announcements list is an object of type Announcement and an item on a Tasks list is an object of type Task. You can then enumerate the objects and get the properties for your use. Also, you can use LINQ syntax and the LINQ keywords built into C# and VB for LINQ queries.
50.What is difference between Load() and LoadQuery() methods ?
  • Load method populates the client object directly with what it gets data from the server i.e. a collection object like ListItemCollection etc. but LoadQuery returns the data as a completely new collection in IEnumerable format.
  • Other major difference is that the Collections that you load using the Load() method are eligible for garbage collection only when the client context variable itself goes out of scope where as, in these collections go out of scope at the end of IEnumerable list
51.How do you access ECMAScript object model API’s ?
  • The ECMAScript library is available in a number of JS files in the LAYOUTS folder. The main file among number of .js files is SP.js. When you include this file in the APSX page using a ScriptLink control, all other required JS files are loaded automatically.
  • By linking SP.js to your page, the SP namespace gets registered. SP is the SharePoint namespace that contains all objects. For debugging purposes every js file also has a ‘debug’ equivalent in the same folder.
52.What is the purpose of calling clientContext.ExecuteQuery() ?
ExecuteQuery gives you the option to minimize the number of roundtrips to the server from your client code. All the components loaded into the clientcontext are executed in one go.
53.Can you deploy .wsp Solutions from SharePoint 2010 in SharePoint 2013?
Yes. SharePoint 2013 provides Support for both 14 Hive and 15 Hive. Solutions from SharePoint 2010 can be deployed in SharePoint 2013 either in 14 Hive,15 Hive or both. This can be done using the new “CompatabilityLevel” parameter of Install-SPSolution cmdlet with which you can now Deploy your wsp Solutions to 14 hive, 15 hive or both. For more Info see DEPLOY SHAREPOINT 2010 SOLUTIONS IN SHAREPOINT 2013
54.Can you Create & Deploy Sandbox Solutions in SharePoint 2013?
Sandbox Solutions are depreciated in SharePoint 2013.You can still Create them and deploy them but they are not supported by Microsoft (not 100% sure about this though).
FabGreenTechnologies-Madiwala
FabGreenTech.com

No comments:

Post a Comment