Sharepoint Developer Interview Questions
Sharepoint Developer Interview Questions
me
http://www.rajeshg.me/2013/05/sharepoint-developer-2010-interview.html
Q. How will you add Code behind to a Custom Applictaion Page or a Layout Page in SharePoint?
Ans. You do not deploy a code behind file with your custom Layouts page. Instead, you can have the page inherit
from the complied dll of the solution to access the code behind.
Q. What is the difference between a Site Definition and a Site Template?
Ans. Site Definitions are stored on the hard drive of the SharePoint front end servers. They are used by the
SharePoint application to generate the sites users can create. Site Templates are created by users as a copy of a
site they have configured and modified so that they do not have to recreate lists, libraries, views and columns
every time they need a new instance of a site.
Q. Why do you use Feature Receivers ?
Ans. Feature Receivers are used to execute any code on Activation\Deactivation of a Feature. You can use it for
various purposes.
Q. Can you give a example where feature receivers are used.
Ans. You can use it to assign an event receiver feature to a specific type of list or can write a code in a feature
ShraePoint. It is recommended to create a feature first, and then wrap everything in a Solution package.
Q. How will you cancel a deployment from central admin -> solution managment, if its stuck at deploying or
Error.
Ans. You can either try to force execute timer jobs using execadmsvcjobs command or can cancel the dpeloyment
using stsadm command stsadm o cancaldeployment id {GUID} command. The Id here would be GUID of the
timer or deployment job. You can get the Id from stsadm enumdeployment command. This will display all the
deployments which are process or are stuck with Error.
Q. How do make an existing non-publishing site Publishing?
Ans. You can simply activate the SharePoint Publishing Feature for the Site, you want to make publishing.
Whenever the content type is instantiated, it will be subject to the event receivers that are associated with it.
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. How do you return SharePoint List items using SharePoint web services?
Ans.In order to retrieve list items from a SharePoint list through Web Services, you should use the lists.asmx web
service by establishing a web reference in Visual Studio. The lists.asmx exposes the 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.
Q. How Do you deploy Files in 12 hive when using wspbuilder or vsewss?
Ans. Typically, you can add these files in the 12 hive folder structure in your project. In Vsewss however, you will
have to create this structure manually.
Q. What files gets created on a file system, when a Site collection is created ?
Ans. Windows SharePoint Services does not create any files or folders on the file system when the site collection
or sites are created; everything is created in the content database. The Pages for the site collection are created
as instances in the content database. These instances refer to the actual file on the file system.
Ans . An authentication system is how you identify yourself to the computer. The goal behind an authentication
system is to verify that the user is actually who they say they are.
Once the system knows who the user is through authentication, authorization is how the system decides what the
user can do.
Q. Can you display\add a Custom aspx or WebApplication Page in SharePoint Context ?
Ans. You need to make some modification in the aspx file to display it in SharePoint Context. Firstly, add the
references for various sharepoint assemblies on the Page. Then wrap the Code in PlaceHolderMain
contentPlaceholder, so that it gets displayed as a content page. Lastly, add a reference to SharePoint Master
Page in aspx file and swicth it in Code behind if needed.
Q. Can you add a Cutsom Http Handler in SharePoint ?
Ans. Yes, a Custom httphandler can be deployed in _layouts folder in SharePoint. Also, we need to be register the
handler in the webapp's webconfig file.
Q. 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 exact rendering of your controls by
calling the .Render method in the web parts Render method.
Q. When would you use an event receiver?
Ans. 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.
Q. If I wanted to restrict the deletion of the documents from a document library, how would I go about it?
Ans. You would create a event receiver for that list/library and implement the ItemDeleting method. Simply, set:
properties.Cancel= true and display a friendly message using Properties.Message("How can u delete this... Its
not your stuff!");
Q. What is the difference between an asynchronous and synchronous event receivers?
Ans. 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
Q. How do you Increase trust level for a single WebPart in the WebConfig file.
Ans. To list a Web Part with Full Permissions within your Web Application while still retaining a WSS_Minimal
permission set for all other Web Parts, You need to create a Custom policy file. This file will be then referenced in
SharePoint Web.config file and will allow your specific webpart to be of Full trust.
Steps :
1. Make a copy of the WSS_Minimal.Config file from the 12\Config folder and paste it into the same folder
renaming it to Custom_WSS_Minimal.Config. Now, edit the Custom_WSS_Minimal.Config file using NotePad.
Obtain the Public Key Token for the Web Part assembly that you want to deploy, using the following command: sn
Tp filename.dll. Create a new entry in your Custom_WSS_Minimal.Config file for your WebPart. Save the File.
Finally, Create a new TrustLevel element for your config file in the Web.Config called Custom_WSS_Minimal that
points to your custom file in the 12\config folder. Recycle the Application Pool and Youre Done.
Q. How does Windows SharePoint Services help render the Webapplictaion in ShrePoint?
Ans. When a new web applictaion is created via Central Admin, Windows SharePoint Services creates a new
Web application in IIS. Then the WSS, loads the custom HTTP application and replaces all installed HTTP
handlers and modules with Windows SharePoint Servicesspecific ones. These handlers and modules
essentially tell IIS to route all file requests through the ASP.NET 2.0 pipeline. This is because most files in a