views:

21782

answers:

30

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?

+9  A: 

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.

Kyle Trauberman
A few more things that I would like to add:It is recommended to use ASP.NET webparts unless you need the following features:Connections between web parts a Web Part zoneCross page connectionsdata caching infrastructure that allows caching to the content database Client-side connections
ashwnacharya
Can you point to some documentation that says this?
Rex M
http://www.pointsharepoint.com/2008/03/sharepoint-interview-questions.html
Kyle Trauberman
+12  A: 

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

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

AdamBT
A: The identity of the current process. In a web context, this is the application pool identity. In a timer job, console application, etc. it will likely not be the app pool identity. Plan database permissions accordingly.
dahlbyk
@dahlbyk - Thanks; I will clarify. I never considered it being used in any other context.
AdamBT
Isn't this a bit too specific? I like more open-ended questions that allow candidates to speak a bit more, such as the original author's question: How does SharePoint store pages?
Peter Walke
+3  A: 

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.

Jason Z
Surely that is a 'site column' a custom column would actually restrict you from doing exactly what you have said here.
Charlie
Yes, what type of "custom column" is meant here? A custom field? Or a site column?
bzlm
+4  A: 

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.

Jason Z
You can attach documents to a list item in a standard list, rather than a library. The difference is that in a library, the file is the item, wheras in a list the file is just an extra "attachment". You can also have multiple attachments to a list item.
Kyle Trauberman
I hate when I don't know the answer to my own question!! :)
Jason Z
+7  A: 

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.

AdamBT
Also, it will List "System Account" as the Editor instead of the User Account, which has some other side-effects if you work with the SPListItem["Editor"] field.
Michael Stum
I did not know that. I thought it did more of a transparent update.
AdamBT
Bonus if the applicant knows about the "Page has been modified" error when updating a list item from, say, a web part (because of the new version being created).
bzlm
SystemUpdate: also alerts is not sent, and modified by is not changed to system account.Oh and versions are *not* preserved with the default method, you have to use the SystemUpdate(false) to do that (check UpdateInternal() method that SystemUpdate() calls)
Anders Rask
+8  A: 

Q: What are "Features" and why should you know about them?
A: Anything from The concept of a "Feature" in SharePoint demonstrates an understanding.

cciotti
link is broken.. can you fix?
Nathan DeWitt
No, Microsoft broke it, let them fix it.
cciotti
lol... this should be the working link http://sharepoint2007.microsoft.com/blogs/mike/Lists/Posts/Post.aspx?ID=7
murki
+5  A: 

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

AdamBT
+3  A: 

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.

Alex Angas
+9  A: 

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.

Michael Stum
Also dispose each web when iterating over SPWeb.Webs
Rex M
Also dispose SPLimitedWebPartManager's SPWeb property (.web)
Anders Rask
+7  A: 

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?

Nat
Yeah outstanding question, anyone who knows MOSS, knows its held together with nuts and bolts, I guess another good interview question for MOSS is, do you have a strong stomach?
JL
Agreed, a very good question as it'll allow a candidate to speak from experience or not as the case may be
Naeem Sarfraz
+4  A: 

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.

mortenbpost
A: 

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/

+3  A: 

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)
Lars Fastrup
And soon, PerformancePoint
dahlbyk
Nice - looking forward to trying it out
Lars Fastrup
Hi Lars. I thought Forms Services was just a farm feature, but have read in http://www.mosstest.net/Blog/SharePoint/DocLib/MOSS2007_MSW%EC%99%80%20MS%20Intranet%20%EC%86%8C%EA%B0%9C.pptx where MS InfoPath uses "the session state component of the SSP" (whatever that means). Thoughts?
Kirk Liemohn
Hey Kirk, yes it is indeed confusing - I am also not 100% sure myself. But MS lists it as a SSP here http://technet.microsoft.com/en-us/library/cc262914.aspx. But it is administered from Central Admin -> Application Management rather than from the SSP admin site.
Lars Fastrup
+2  A: 

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/

Or SPWebEventReceiver
dahlbyk
Manish, stop advertising your blog in every answer.
bzlm
What about SPFeatureReceiver which is used when you activate or de-activate your feature
runxc1 Bret Ferrier
+5  A: 

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.

ahin4114
+4  A: 

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)

Jason
MOSS costs money, WSS is free with Windows Server.
Nathan DeWitt
Can you edit your post with a link to the Lars Fastrum answers? (Or someone with editing privliges)
Peter Walke
+1  A: 

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.

tekiegreg
"Please provide one question per entry" probably wasn't a joke.
bzlm
+2  A: 

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

Nicolas Irisarri
+2  A: 

Describe your experiences in applying custom branding to SharePoint 2007. What are some pitfalls to avoid? How do you deploy your custom branding to the farm?

rwmnau
+1  A: 

Describe the Business Data Catalog (BDC), and provide at least one of a tangible application for it.

rwmnau
+1  A: 

When/why should you/shouldn't you make direct changes or additions to the files in the 12 hive?

rwmnau
+4  A: 

Q: What is the performance impact of RunWithElevatedPrivileges?

A: RunWithElevatedPrivileges creates a new thread with the App Pool's credentials, blocking your current thread until it finishes.

[via rexm]

Chris Ballance
+2  A: 

Q: How would you programmatically retrieve a list item?

A: SPQuery and SPSiteDataQuery. Bonus points for knowledge of CrossListQueryCache, PortalSiteMapProvider. Negative points for use of foreach.

Alex Angas
A: 

very usefull quesions ...

abc
A: 

Update urself - Check Out sharePoint 2010 Interview Questions

http://mysharepointwork.blogspot.com/2010/01/sharepoint-2010-interview-questions_20.html

attlee
+3  A: 

Good ones. here are some really useful ones. http://megasolutions.net/qs/Sharepoint_Portal_Interview_Questions.aspx

Sarah Nasir
+1  A: 

Here is a site dedicated for Microsoft Sharepoint Interview Questions for Developers

A: 

I run across http://www.technical-interview.com which has some nice collection of questions

Foo