SharePoint interview questions

Viewed 72943

Let's have a list of some good interview questions for SharePoint developers. Please provide one question per entry, and if possible, the answers.

Also, please feel free to suggest corrections if the provided answers are wrong.

I will go first:

Q: How does SharePoint store pages?

A: How-to-locate-sharepoint-document-library-source-page-on-the-server?

25 Answers

Q. When running with SPSecurity.RunWithElevatedPrivileges (web context) what credentials are being used?

A. The App Pool Identity for the web application running SharePoint.

Q. When modifying a list item, what is the "main" difference between using SPListItem.Update() and SPListItem.SystemUpdate()?

A. Using SystemUpdate() will not create a new version and will also retain timestamps.

Q: When should you dispose SPWeb and SPSite objects? And even more important, when not?

A: You should always dispose them if you created them yourself, but not otherwise. You should never dispose SPContext.Current.Web/Site and you should normally not dispose SPWeb if IsRootWeb is true. More tricky constructs are things along the line of SPList.ParentWeb.

Bonus Points if the candidate knows Roger Lambs Blog Post.

Q: What is the difference between System.Web.UI.WebControls.WebParts.WebPart and Microsoft.SharePoint.WebPartPages.WebPart?

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

sometimes I like to ask more open ended questions to get the prospect talking.

If I want to find out technical depth

Q: What bugs have you found in SharePoint? then Q: And what did you do to work around them?

Q. If you have an ItemUpdated or ItemUpdating event receiver and it causes an update to the item, how do you prevent another ItemUpdated and ItemUpdating event from being fired during your update?

A. Before performing your update, call DisableEventFiring(). After update, call EnableEventFiring().

Q. What is a site collection, why would you create a new site collection as opposed to a site?

A. Bit of a long answer, but they should know about site collection administration, quotas, seperation of assets, security model etc.

Dave Wollerman has a good article on some of the whys and wherefores.

Q: Describe the difference between a list and a library.

A: Lists are collections of metadata or columns, that can have attached documents. Libraries are collections of documents (Excel, InfoPath, Word, etc.) plus optional metadata.

Edited per ktrauberman's feedback.

Q: (i) Describe the purpose of a content type and; (ii) give an example of where they might be used.

A: (i) A content type groups a set of list columns together so that they can be reused in the same way across sites. (ii) They could be used as a set of metadata columns that need to be applied to every document in a site collection.

Q: Explain how SharePoint render its content. A: Beyond scope here, but you can find some good information here: http://g-m-a-c.blogspot.com/2008/04/how-sharepoint-2007-renders-its-content.html

The applicant should at least get around the SharePoint's template rendering mechanism, and what's in the 12/TEMPLATE/CONTROLTEMPLATES/ and what it's used for with emphasis on DefaultTemplates.ascx. This is absolutely essential knowledge if you wish to do any kind of SharePoint customization.

Q: Name at least two shared services available in MOSS 2007

A: Shared Services Providers in MOSS 2007 can provide the following shared services:

  • User Profiles
  • Audiences
  • Personal Sites
  • Search
  • Excel Services
  • Forms Services
  • Business Data Catalog (Requires Enterprise Edition)

Q. What is the difference between MOSS & WSS

A. MOSS uses the Shared Service Provider for search, profile import, etc... (see the answers posted by Lars Fastrup for a more complete list)

Q: Why would you use a custom column?

A: It allows you to re-use the column in multiple libraries. Particularly useful if you use a Choice type to restrict the user input to a predefined set of answers, and when that list of answers will likely change.

Q. What base classes do event receivers inherit from?

A:

  1. SPListEventReceiver, SPItemEventReciever, and SPWebEventReceiver inherit from the abstract base class SPEventReceiverBase.
  2. SPWorkflowLibraryEventReceiver inherits from SPItemEventReceiver.
  3. SPEmailEventReceiver inherits directly from System.Object.

Also see a collection of SharePoint Questions on: http://qmoss.blogspot.com/

Q: What are the built in ways to backup a SharePoint install?

A: Through the central administration and the stsadm command

Q: (more advanced) You've created and deployed a Web Part, when you deploy to the server you get a page saying your Web Part couldn't be loaded, click here to go to the Web Part maintenance page, etc. to disable the web part. What step(s) should you take to get a stack dump from your web part instead of that error page?

A: Go to the web.config file for your website and find the CallStack Attribute in the SafeControls element and set the value to true.

Q. How would you create a Master/Detail page?

A. Creating a Content type inheriting from Folder Content Type for the master, and another Content type inheriting from Item and using them both on a List

Q. What are the data types which are supported as Lookup column in SharePoint.

A. Only Single Line of Text and Calculated columns are supported as lookup columns.

Also I have consolidated some more questions on: http://qmoss.blogspot.com/

Related