SharePoint interview questions [closed] - sharepoint

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
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?

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: 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]

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

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

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:
SPListEventReceiver, SPItemEventReciever, and SPWebEventReceiver inherit from the abstract base class SPEventReceiverBase.
SPWorkflowLibraryEventReceiver inherits from SPItemEventReceiver.
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.

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?

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

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

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

Q: What is a way of elevating SharePoint privileges without using RunWithElevatedPrivileges?
A: Pass the System Account User Token from the SPContext to the SPSite constructor.
A majority of times a developer can accomplish what they need using this method without needlessly elevating network credentials.

I would rather ask some open ended questions like
Tell me something which you consider as an error that Microsoft has made in SharePoint?
Possible answers are...
For lookup columns you need to know the lookup field GUID in advance and you can’t easily provision a lookup field as a feature.
MOSS does not have site level events such as an event for creating of lists.
SharePoint designer is a crap and add unwanted stuff which increases the page size.
Lack of user group based trimming control as only permission based trimming is available by deafult (of cause you can create a custom security trimmer that does this)

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

How to create new security groups in Labware software?

Please help me to understand how security groups are created that can be assigned to users in Labware LIMS software and where it is stored in database?
There is a record in the LIST table called GROUP which is an out of the box record. This record contains all the security groups that the system uses. If you add an entry to this record that should do the trick.
Also, this is very standard functionality to LabWare LIMS since at least V5. You can find more information in the LabWare Technical Manual for your version.
That being said, the comment on your question is correct. We have a mailing list that is available to our customers for questions exactly like this!
HTH

Filtering SharePoint List by Another SharePoint List

I posted this question on Stack Exchange here: (https://sharepoint.stackexchange.com/questions/249418/filtering-sharepoint-list-by-another-sharepoint-list), but just realized I should have posted it to Stack Overflow instead. Hope it's not bad form to cross-post (I'll add a link to this post in the other post).
I've been searching the forums and doing research online with no luck- apologies if this has been answered before.
I have a list with several thousand items in it. I often receive bulk update requests where I need to update several hundred of these items at a time (let's say for this example that we're using a field called "Case ID").
Here's what I've tried:
Searching cases individually, or up to three at a time in datasheet view; this is not time effective
Exporting the list and manually manipulating the data in Excel, then pasting in (and writing over) the data in the column that needs to be updated; this approach is not user friendly, is not necessarily time effective, and has potential side effects (causing errors for users currently modifying items that I am changing in bulk)
Lastly- I know I can create custom views that isolate this data; the problem is that the lists of cases I need to modify generally do not have enough commonalities to isolate them using the view filter logic
So- my guess is that I need two lists, likely connected with a web part. The first list would exist solely for the purpose of querying the second list. I would enter the Case IDs I wanted to filter by in the first list, and the second list would filter to show only the Case IDs in the first list. All items would be deleted from the first list between queries.
I'm not married to this approach- it's just my best guess. I'm open to creative and alternative approached, but the final process needs to be user friendly (business partners will be using it).
Does anyone know how I can accomplish this? I've tried to get something implemented several times over the past few years and have never been successful; posting here is my last resort before I throw in the towel.
I have SP 2013, and have SharePoint Designer; please let me know if I need to add any other information.
Thanks in advance for the support,
Chad
I'd suggest to create a JSOM application that will do all updates. It can query only items for update and do item-by-item update.

Can I load an XPage from another Db using the Include Page control?

Looking at xp:include control; we have the following syntax:
<
xp:include pageName="/main.xsp" id="include1">
Is there any way to compute the pageName property so it makes reference to another Db?
Designer Help
"Can you?" Yes, but it's quite complicated and I wouldn't recommend attempting it. You would have to write an extended version of the Include control that could point to a different NSF and could include that NSF as a ModuleClassLoader for your current application. While this is theoretically possible, it requires a great deal of knowledge of the internal Java workings of XPages and a willingness to test extensively.
There may be other ways to solve your problem, such as using Design inheritance to include your target page in the local application. Otherwise, you're asking a question about what's possible with a sequence of ones and zeros, so of course the answer is "yes, but..." And in this case, unless you have a desire to research the inner workings of the XSP server, or want to recruit someone who already has such knowledge, the answer to "Can I" is no.
As Nathan says - the reality is that no you can't do that. BUT you should think of WHY you're trying to do this?
Keep in mind that by not having your XPage source in the same place you won't have any kind of shared application or sessionScope available. Because of that it really is just like including a foreign web page and has nothing to do with XPages.
You'll probably be better off just using an iFrame if you want to run a foreign page inside another xpages application.

What parts of a CRM solution are cumulative, and what parts are not?

Most solution changes are cumulative in CRM (adding an entity, adding a field to an entity, adding a form, etc) but some are not (site map is currently the only one that I know). Does anyone have a list of the solution changes that are cumulative (safe to allow an auto-merge) and which changes are not?
The SDK includes following two articles regarding your question:
Understand How Managed Solutions Are Merged
Introduction to Solutions - Conflict Resolution
I'm currently not aware of a better description.

Sharepoint Item Level Access & performance

i have created a workflow activity that do give the item creater of a specific list full control on the item and set everyone else to read only access (permission)
someone told me that doing it this way (if i have a lot of users) the performance will go down dramatically
is that correct ?!!
if yes what is the best solution to create a list where any one can create new items but after the item is created only the creater can edit it and the rest of the users can read it only
The accepted answer is not actually answering the question correctly...
You should not use a workflow to do this, if you want people to be able to edit items they create and only read ones they did not, use "List->Settings->Advanced Settings->Item-level Permissions", and this is available for document libraries (since they inherit from SPLIST) it just does not show up in their "Advanced Settings" in the UI. You can set the ReadSecurity property to 1 and the WriteSecurity property to 2 on the Document Library.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.writesecurity.aspx
Performance degradation will happen when you use large ACLs for each list item. Just make sure that item-level permissions basically have the minimum entries. For example:
The user that has permissions to edit that item
A single security group that contains all the users with only Reader permissions.
So, can Sharepoint offer these default permissions OOB? Not that I'm aware of. The only option that I can think of is using workflows that set these permissions dinamycally when the document is uploaded.
If you want to avoid performance degradation just make sure that you never display (or iterate using the object model) more than 2000 of those items in a Fine Grained Permissions list. THAT would definitely cause major performance issues.
Yes, you might solve this with workflows but that might be a bit clumsy and it might slow your server.
The better option is to use List Settings > Advanced Settings > Item-level Permissions.
This feature is not available for Document and Form Libraries.
It is true that a list that contains a large number of items with custom permissions applied, will slown down your server. This is document in the official Microsoft paper Plan for software boundaries.
The recommended/magic number is 2000. Going further won't break anything, but it could be that you will run into performance issues.

Resources