Friday, January 7, 2011

SharePoint Interview Questions

1. What are the ways to initiate the workflow?

Automatic (on item added or item deleted)
Manual (standard WSS UI interface)
Manual (Custom UI Interface)

Programmatically through custom code


2. What are the types of input forms that can be created for a workflow?


You can create four different types of input forms including an association form, an initiation form, a modification form, and a task edit form. Note that these forms are optional when you create a workflow template.

3. What are ways to create input forms for workflow?


Two different approaches can be used to develop custom input forms for a WSS workflow template.
You can create your forms by using custom application pages, which are standard .aspx pages deployed to run out of the _layouts directory. ( disadv: lot of code required when compared to Infopath approach)
using Microsoft Office InfoPath 2007 (disadv: picks up a dependenct on MOSS, i.e. it cannot run in a standalone WSS environment)


4. What is the difference between method activity and event activity in WF?

A method activity is one that performs an action, such as creating or updating a task. An event activity is one that runs in response to an action occurring.

5. What does SPWeb.EnsureUser method do?

Checks whether the specified login name belongs to a valid user of the Web site, and if the login name does not already exist, adds it to the Web site. e.g SPUser usr = myWeb.EnsureUser("mmangaldas");

6. While creating a Webpart, which is the ideal location to initialize my new controls?

Override the CreateChildControls method to include your new controls. To make sure that the new controls are initialized.. call 'EnsureChildControls' in the webparts Render method. You can control the exact Rendering of your controls by calling the .Render method in the webparts Render method.

7. How to query from multiple lists?

Use SPSiteDataQuery to fetch data from multiple lists.

8. How Does SharePoint work?

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.

9. What is the difference between Syncronous & Asyncronous events?

Syncronous calls ending with 'ing' E.g. ItemDeleting Event Handler code execute BEFORE action is committed WSS waits for code to return Option to cancel and return error codeAsyncronous calls ending with 'ed' E.g. ItemDeleted Event Handler code executes AFTER action is committed WSS does not wait for code to return Executed in its own Worker thread.

10. What is ServerUpdate() ?

Any changes in the list, i.e. new addition or modification of an item. The operation is complete by calling the Update method. But if a List is set to maintain versions. And you are editing an item, but don't want to save it as a new version, then use the SystemUpdate method instead and pass in 'false' as the parameter.

11. What is query.ViewAttributes OR How can you force SPQuery to return results from all the folders of the list?

If you use SPQuery on any SPlist. it will bring back results from the current folder only. If you want to get results from all the folders in the list. Then you need to specify the scope of the query by the use of ViewAttributes..e.g. query.ViewAttributes = "Scope=\"Recursive\"";