Thursday, June 16, 2011

Sharepoint interview questions

 

Q. What are WebParts?
Ans. Web Parts are self-contained packages of user interface that can be dropped onto a SharePoint Web Part page to provide discrete set of functionality to the users. They can simply be described as re-usable Code units.
Q. What are Features?
Ans. Features represent a set of functionality (code) that can be activated and de-activated at various levels in SharePoint. Using Features, you can do everything from adding a link to the Site Settings page to creating a complete fully functioning Project suite that can be added to any SharePoint site. Developers can scope feature to the following level -

. Web
. Site
. WebApplication
. Farm


Q. What are Solutions?
Ans. Solutions are the container packages for Features. Solution basically, is a cabinet (.cab) file with extension .wsp which contains various components needed to be deployed(features, webparts, custom forms etc) along with files that describe some important metadata about those Components. Once a Solution is installed on a server in the farm, you can deploy it to any webapplication from your Solution Management.
Q. What is a .ddf file and what does it have to do with SharePoint Solution creation?
Ans.
A .ddf file is a data directive file which describes the files need to be deployed and their destination (in SharePoint). .ddf is used when building the SharePoint solution. This file is a parameter to makecab.exe which outputs the wsp file.
Q. What is the difference between a site and a web in SharePoint?
Ans. A site in sharePoint is a site collection. It is an object of SPsite class in sharepoint. A Web however, is simply a blank site within that site collection. Web is a Part of SPweb class, thus represents a site within a site collection.
Q. What is CAML?
Ans. CAML stands for Collaborative Application Markup Language and is an XML-based language that is used in Microsoft Windows SharePoint Services to define sites and lists for E.g. fields, views, or forms etc. Developers mostly use CAML to write Queries to retrieve data from Lists\libraries.
Q. What is Custom action?
Ans. Represents a link, toolbar button, menu item, or any control that can be added to a toolbar or menu that appears in the UI. For e.g. "New Folder" button in your document library is a custom action or "View All Site Content" in your Site Settings is a custom action.
Q. What are Master pages in SharePoint?
Ans. These are the pages that provide a consistent layout and appearance (look and feel) for SharePoint sites. A master Page consist of a Site logo, Top navigation, left navigation(some cases) and a footer. In SharePoint Master Pages are stored in _catalogs folder or Master Page Gallery from UI.
Q. What are Layout Pages in SharePoint?
Ans. A Layout page defines the Layouts(structure including Webpart zones) of a content page in SharePoint. Layout pages are not same as Master Page. A Layout Page is contained inside the content area surrounded by mater Page.
Q. What is a SharePoint Theme?
Ans. A Theme is a group of files (CSS, images) that allow you to define the appearance (look and feel) of content pages in SharePoint. A Theme defines the design of various components for e.g. Content Page background-color,button color,webpart title color etc to give a different look and feel to your site.
Q. What is a web part zone?
Ans.
Web part zones are what your web parts reside in. Each webpart zone can contain number of webparts and can be positioned in a specific way to create a webpart Layout Page.
Q. What is Business Data Catalog or BDC ?
Ans. It is a shared service that enables Office SharePoint Server 2007 to display business data from various back-end servers into a SharePoint page. Business Data Catalog or BDC provides built-in support for displaying data with various webparts and list\list columns that can help in easy creation of dashboards with data from your SQL, web services, SAP, Siebel, or any other line-of-business (LOB) applications.
Q What is a Site definition?
Ans. A Site definition is a collection of Files such as ONET.XML which defines the Site template for e.g. Team Sites used to create a Site in SharePoit. All the out-of-box site Templates like Blog,Wiki,Team Site etc can be found in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\
Q What is a Site Template?
Ans.
Any Site along with the content can be saved as a template. If a site is saved as a Template it is stored in Site templates folder as a .stp file. This template is then re-used to create a new site which will have the pre-saved settings.
Q. What are content types?
Ans.
A content type is a flexible and reusable template of type list item or document that defines the columns and behavior for an item in a list or a document in a document library. For example, you can create a content type for a Requirement document with a columns such LOE,Version,Approver,Date Created,Date Revised etc and this can be re-used in various document libraries.
Q. what is Central administration?
Ans. This is a site used by admins to mange and configure settings for SharePoint web applications or the whole farm.


Q. What are event receivers or event Handlers in SharePoint?
Ans. Event Receivers or Event handlers are created to handle the basic actions or events against an item,list\library, a web or a site. There are two kinds of events in sharepoint.
Synchronous Events: Like Itemadding (not added yet), Uploading (document not uploaded yet) etc.
Asynchronous Events: ItemAdded (after item is added), Uploaded(after a document is uploaded)
Events receivers can be written to override an event for e.g. ItemAdded event to change the name of an Item once it is added.
Q. What is stsadm?
Ans.
It is a Command-line tool used for administration of Office SharePoint 2007 (or MOSS 2007) servers and sites. Basic operations like adding a solution or installing activating and feature is usually done by stsadm.
Q. What permissions are required to perform stsadm operations?
Ans. You need to be a member of WSS_ADMIN_WPG group to perform deployments for sharepoint server. Also, you need to be added into administrators group on a computer on which SharePoint Server or WSS 3.0 is installed. In addition to this you definitely need access to the required sharepoint databases so that you should not get errors while deploying sharepoint solutions.
Q. Where is it located?
Ans. You will normally, find it under C:\Program Files\Common Files\ shared\web server extensions\12\bin.


Q What is a DWP?
Ans.
Its a webpart file extension.
Q What is the GAC?
Ans. Global Assembly Cache folder (or assembly) stores the strongly typed signed assemblies for webparts or other sharepoint components(which require full trust) for services to share them.

Q. What are Application Pages, Site Pages and Content Pages?
Ans.
Application Pages - An application page is deployed once per Web server and cannot be customized on a site-by-site basis. They stay in 12 hive folder structure, mostly under layouts folder.
Site Pages - These are pages that make up the site interface and are specific to one site or site collection.They mostly get stored in the content database of the site collection.
Content Pages - Site Page which contains webpart or other custom components. This Page is stored in database. They mostly get stored in the content database of the site collection.
Q.What are the Permission levels in SharePoint?
Ans. Permission levels in SharePoint are -
* Limited Access - They can view Application Pages, Browse User Information, Use Remote Interfaces, Use Client Integration Features etc.
* Reader - Limited Access permissions plus: View Items, Open Items, View Versions, Create Alerts, Use Self-Service Site Creation, View Pages.
* Contributor - Read permissions plus: Add Items, Edit Items, Delete Items, Delete Versions, Browse Directories, Edit Personal User Information, Manage Personal Views, Add/Remove Personal Web Parts, Update Personal Web Parts.
* Design - Contribute permissions plus: Manage Lists, Override Check Out, Approve Items, Add and Customize Pages, Apply Themes and Borders, Apply Style Sheets.
* Administrator - Has full control of the Web site.
* Full Control - All permissions.
Q. What are Site Columns?
Ans.
Site columns are pre-defined data columns(along with default values) which are re-used in various content types. A Content type is usually a collection of site columns. For e.g. you can create a site column "Category" with a choice datatype along with the pre-defined values "It","Hr". This column then can be added to any content type in your list or library.
Q. What does each individual Site collection offers?
Ans. An Individual Site collection offers following :
For the Users:
Dedicated Recycle bins
Dedicated usage Reports
Distributed administration (site collection administrators)
Dedicated search scopes, keywords, and best-bets
Custom feature deployments
Dedicated language translation maintenance
Dedicated galleries for web parts, master pages, content types, site columns, site templates, and list templates
Dedicated shared libraries, such as site collection images and site collection styles
Dedicated real estate (Self Containment)
For the IT Administrators:
Site quota templates
Distributed administration
Site locking
Database maintenance options
Backup / Restore abilities
Content Deployments
InfoPath forms services global template targeting
Q. When would you use a Different Site Collection for you new site?.
Ans. We would prefer to make our new site in a seprate site collection for the following are the reasons:
1. Site quotas is one of the reasons. The issue is the recycle bin is based on site collections and the quota for a site collection. If everyone shares a site collection, then they share the recycle bins storage size.
2. Delegated Security and distributed administration is the next big thing. For eg, you have a IT department that doesn't know who should be able to see what content, besides how it should be organized. This is the job of the content owners and users. SharePoint site collections offers IT the ability to create a site collection for a project, team, department, document, or whatever the needs are, then assign an owner and hand it off to them.
3. In addition to these two if you need to separate the content between databases because of space issue.


Q. What is a Field Control?
Ans. Field controls are server controls that provide the basic field functionality of SharePoint. For example a Inputbox (single line text) to enter the title of the item. You can create your own FieldControl by inheriting classes from BaseFieldControl namespace.
Q. How do you develop webparts in SharePoint?
Ans. You can either develop a simple asp.net webpart with C# class library project or can use various tools available in the market. VSeWSS is an extension provided by Microsoft that consist of a webpart template for easy webpart creation and deployment. Other tools are wspbuilder, stsdev etc.
Q. Explain webpart life cycle.
Ans. protected override void OnInit(EventArgs e)
protected override void OnLoad(EventArgs e)
protected override void CreateChildControls()
protected override void LoadViewState(object savedState) //Only at Postback
protected override void OnPreRender(EventArgs e)
protected override void Render(System.Web.UI.HtmlTextWriter writer)
protected override void OnUnload(EventArgs e)
public override void Dispose()
Q. While creating a Web part, which is the ideal location to Initialize my new controls?
Ans. CreateChildControls is the method where we initialize all the child controls.
Q. Do we always need to override Is Render() method.
Ans. We override render only in case if we need to define the rendering of our controls in the webpart.
Q. What is the WebPartManager sealed class?
Ans. The WebPartManager sealed class is responsible for managing everything occurring on a WebPart page, such as the WebParts (controls), events, and misc. functionality that will occur in WebPartZones. Each Page will have only one WebPartManager reference on the page.
Q. What are WebPart Properties?
Ans.
WebPart Properties are properties defined from the right toolpane of the webpart. These are settings or values set by the end user and are used within your webpart. For e.g. WebPart title, Description etc. Some of the attributes which you can define for your custom property are WebDescription, WebDisplayName, Category, Personalizable, and WebBrowsable.

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 Services–specific 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 SharePoint site are stored in a Microsoft SQL Server database.
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.
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. What is Authentication and Authorization.
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. What are Security methods(Authentication methods) available in sharepoint
Ans. "Out of the box", SharePoint 2007 supports nine authentication methods. But NTLM (Windows authentication) and Kerberos (Windows "standard" authentication) are offered during installation.
Q. Workflow can be applied to what all elements of SharePoint ?
Ans. Workflow associations can be created directly on lists\libraries and content types.
Q. What are the types of input forms that can be created for a workflow ?
Ans. You can create four different types of input forms including
1. An association form
2. An initiation form
3. A modification form
4. A task edit form
Q. What is the difference between method activity and event activity in WorkFlow ?
Ans. 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.
Q. What does SPWeb.EnsureUser() do?
Ans. This method Checks whether the specified login name is a valid user of the SharePoint web.
Q. What does AllowUnsafeUpdates do ?
Ans.
If you need to modify some data in you SharePoint site for e.g. update a list item or list properties you may need to allow unsafe updates on the Web site. you can set it to we.AllowUnsafeUpdates = false once your done.
Q. What is the webservice used to retrieve or add list items in sharepoint?
Ans. List.asmx is a Out-of-box webservice provided to add\update\delete and retrieve list items. It can be accessed from "http://SPSite/_vti_bin/lists.asmx" path.

Q. What Do you know about SharePoint Object Model?
Ans. In Sharepoint Object model there are two Important namespaces.
The Microsoft.Office.Server namespace is the root namespace of all Office Server objects and Microsoft.SharePoint is the root namespace for all WSS objects.
Read More at SharePoint 2007 Object Model
Q. Can you develop webparts and other SharePoint solutions at your local machine?
Ans. In order to run and debug sharePoint solutions, the project must reside on the server which has Windows sharePoint services installed. However, you can reference the Microsoft.SharePoint dll in your project at your local, but you won’t be able to run it.
Q. How do you debug SharePoint Webparts?
Ans. To debug SharePoint webpart (or any solution) you can simply drag and drop your complied .dll in GAC and recycle the app pool. You can also run upgrade solution command from stsadm.

Q. How would you retrieve large number of Items form the list ?
Ans. To retrieve large number of items with a better performance we can either use SPQuery or PortalSiteMapProvider Class. Read More with Examples
Retrieving large number of Items from sharepoint list
Q. How Do you implement Impersonation in ShrePoint.
Ans. By Using RunWithElevatedPrivileges method provided by SPSecurity class.
See e.g Impersonation in Sharepoint
Q: What is the performance impact of RunWithElevatedPrivileges?
Ans. RunWithElevatedPrivileges creates a new thread with the App Pool's credentials, blocking your current thread until it finishes.

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 receivers Deactivate method to remove a webpart from webpart gallery.
Q. Where do you deploy the additional files used in your webpart, like css or javascript files, and how do you use them in your WebPart?
Ans. You can deploy the css or javascript files in _layouts folder in SharePoint's 12 hive. To use them in your webpart, you need to first register them to your webpart page and then specify a virtual path for the file for e.g. _layouts\MyCSS.css See Code examples at Using External Javascript, CSS or Image File in a WebPart.
Q: When should you dispose SPWeb and SPSite objects?
Ans. According to the best Practices you should always dispose them if you have created them in your code. You can dispose them in Finally block or you can use the "Using" clause, so that they gets disposed when not required. If you are using SPContext then you need not dispose the spsite or spweb objects.
Q. What are the best practices for SharePoint development.
Ans. Some of the best practices are:
1. You should always dispose SPsite and SPWeb objects, once you refer them in your code. Using the "Using" clause is recommended.
2. Use RunwithelevatePrivilages to avoid errors for end users.
3. Try writing your errors to SharePoint error logs (ULS Logs). Since it’s a bad idea to fill-up event log for your production environment.
4. Use SPQuery instead of foreach loop while retrieving Items from the list.
5. Deploy additional files used in your webpart to 12 hive. Use your solution package to drop the files in 12 hive. Also, make sure that all the references (for e.g. Css or .js files) get removed when the solution is retracted.
Also See : Best Practices to Improve Site Performance
Q.What is the main difference between using SPListItem.Update() and SPListItem.SystemUpdate()?
Ans. Using SystemUpdate() will not create a new version and will also retain timestamps.

Q. When do you use SPSiteDataQuery ?
Ans. You can use SPSiteDataQuery when you need to extract data from more than one list\library in your site colletcion. The data is extracted on the basis of the query you write and is
returened as a Datatable. You can also specify the GUID for the lists\libraries you want to query against.
Q. How do you create a Custom action for an item in a list ?
Ans. This can be done by adding a new feature into SharePoint. You would need to use customaction tag in your elements.xml file and will have to set various properties like imageurl or UrlAction for your customaction. You can later add this feature into sharepoint using stsadm install feature command.
Q. How would you bind this CustomAction to a specific list ?
Ans. To do this you can either create a new list type(again a feature) and use the listtype number for the new list in your RegistrationType property of the Customaction. The CustomAction will then show up only for the items of this list type. or You can create a new content type and then use that content type's id in your cutsomaction to bind the custom action to items of just that content type. Add the new content type to the list where you need this customaction.
Q. How will you deploy an existing asp.net webapplication or website in SharePoint?
Ans. You would need to wrap the web application in a solution package in order to deploy it in 12 hive or say ShraePoint. It is recommended to create a feature first, and then wrap everything in a Solution package. See example Depoly a Custom aspx Page in SharePoint
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.
Q. Can you name some of the tools used for SharePoint Administration?
Ans. Tools Used for SharePoint Administration

Q. What are Application Pages in SharePoint?
Ans. Unlike site pages (for example, default.aspx), a custom application page is deployed once per Web server and cannot be customized on a site-by-site basis. Application pages are based in the virtual _layouts directory. In addition, they are compiled into a single assembly DLL.
A good example of an Application Page is the default Site Settings page: every site has one, and it's not customizable on a per site basis (although the contents can be different for sites).
With application pages, you can also add inline code. With site pages, you cannot add inline code.
Q. What is Authentication and Authorization?
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. How do you deploy a User Control in SharePoint ?
Ans.
You deploy your User Control either by a Custom webpart, which will simply load the control on the page or can use tools like SmartPart, which is again a webpart to load user control on the page. User Control can be deployed using a custom solution package for the webapplication or you can also the control in the webpart solution package so that it gets deployed in _controlstemplate folder.
Q. Which is faster a WebPart or a User Control?
Ans. A WebPart renders faster than a User Control. A User Control in SharePoint is usually loaded by a webpart which adds an overhead. User Controls however, gives you an Interface to add controls and styles.
Q. What SharePoint Databases are Created during the standard Install?
Ans. During standard install, the following databases are created :
SharePoint_AdminContent
SharePoint_Config
WWS_Search_SERVERNAME%_%GUID_3%
SharedServicesContent_%GUID_4%
SharedServices1_DB_%GUID_5%
SharedServices1_Search_DB_%
GUID_6%WSS_Content_%GUID_7%



Q. What are content types?
Ans. A content type is a flexible and reusable WSS type definition (or we can a template) that defines the columns and behavior for an item in a list or a document in a document library. For example, you can create a content type for a leave approval document with a unique set of columns, an event handler, and its own document template and attach it with a document library/libraries.
Q. Can a content type have receivers associated with it?
Ans. Yes, a content type can have an event receiver associated with it, either inheriting from the SPListEventReciever base class for list level events, or inheriting from the SPItemEventReciever base class. Whenever the content type is instantiated, it will be subject to the event receivers that are associated with it.
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. 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.
Q. What are Customized and Uncustomized Files in SharePoint ?
Ans. There are two types of Pages in SharePoint; site pages (also known as content pages) and application pages.
Uncustomized :
When you create a new SharePoint site in a site collection, Windows SharePoint Services provisions instances of files into the content database that resides on the file system. That means if you create a new Site "xyz" of type Team Site(or Team sIte Definition), an instance of the Team Site Definition( Which resides on the File System), i.e. "xyz" gets created in the Content database. So, When ASP.NET receives a request for the file, it first finds the file in the content database. This entry in the content database tells ASP.NET that the file is actually based on a file on the file system and therefore, ASP.NET retrieves the source of the file on the file system when it constructs the page.
Customized :
A customized file is one in which the source of the file lives exclusively in the site collection's content database. This happens When you modify the file in any way through the SharePoint API, or by SharePoint Designer 2007,which uses the SharePoint API via RPC and Web service calls to change files in sites. So, When the file is requested, ASP.NET first finds the file in the content database. The entry in the database tells ASP.NET whether the file is customized or uncustomized. If it is customized, it contains the source of the file, which is used by ASP.NET in the page contraction phase.
Q. What are event receivers?
Ans.
Event receivers are classes that inherit from the SpItemEventReciever or SPListEventReciever base class (both of which derive out of the abstract base class SPEventRecieverBase), and provide the option of responding to events as they occur within SharePoint, such as adding an item or deleting an item.


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 You’re 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 Services–specific 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 SharePoint site are stored in a Microsoft SQL Server database.

Q. How would you pass user credentials while using SharePoint WebService from your Web Part or application.
Ans. The web service needs credentials to be set before making calls.
Examples:
listService.UseDefaultCredentials = true; // use currently logged on user
listService.Credentials = new System.Net.NetworkCredential("user", "pass", "domain"); // use specified user
Q. How would you remove a webapart from the WebPart gallery? Does it get removed with Webpart retraction?
Ans. No, Webpart does not get removed from the WebPart gallery on retraction. You can write a feature receiver on Featuredeactivating method to remove the empty webpart from the gallery.
Q. What is a SharePoint Feature? Features are installed at what scope
Ans. A SharePoint Feature is a functional component that can be activated and deactivate at various scopes throughout a SharePoint instances, scope of which are defined as
1. Farm level 2. Web Application level 3. Site level 4. Web level
Features have their own receiver architecture, which allow you to trap events such as when a feature is Installing, Uninstalling, Activated, or Deactivated.
Q. What type of components can be created or deployed as a feature?
Ans. We can create menu commands, Custom Actions,page templates, page instances, list definitions, list instances,event handlers,webparts and workflows as feature.
Q. How Do you bind a Drop-Down Listbox with a Column in SharePoint List ?
Ans.
Method 1 : You can get a datatable for all items in the list and add that table to a data set. Finally, specify the dataset table as datasource for dropdown listbox.
Method 2 : You can also use SPDatasource in your aspx or design page.
See Code example Binding Drop-Down with Sharepoint List data
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. What is CAML?
Ans. CAML stands for Collaborative Application Markup Language and is an XML-based languagethat is used in Microsoft Windows SharePoint Services to define sites and lists, including, for Eg, fields, views, or forms, but CAML is also used to define tables in the Windows SharePoint Servies database during site provisioning. Developers mostly use CAML Queries to retrieve data from Lists\libraries.
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. See Code Example at Display aspx Page in SharePoint context

In Sharepoint Object model there are two Important namespaces.

The Microsoft.Office.Server namespace is the root namespace of all Office Server objects and Microsoft.SharePoint is the root namespace for all WSS objects.
The Chart Below illustrates some of the key classes contained in each of these namespaces, as well as to which functional area they belong.
Document Libraries (Microsoft.SharePoint)
SPDocumentLibrary , SPPictureLibrary
Business Data Catalog (Microsoft.Office.Server.ApplicationRegistry.Administration)
EntityCollection , ApplicationRegistry
Features (Microsoft.SharePoint)
SPFeatureDefinition, SPFeatureScope, SPElementDefinition, SPFeature, SPFeatureProperty

Sites (Microsoft.SharePoint)
SPSite, SPSiteAdministration, SPSiteCollection, SPWeb
Meetings (Microsoft.SharePoint.Meetings)
SPMeeting, MtgUtility
User Profiles (Microsoft.Office.Server.UserProfiles)
UserProfile, UserProfileManager
Solutions (Microsoft.SharePoint.Administration)
SPsolution, SPFeatureReceiver, SPSolutionCollection
Lists (Microsoft.SharePoint)
SPList, SPListItem, SPListItemCollection
Notes:
* To use the SharePoint API, your code must reside on one of the machines in a SharePoint application server farm. Your code can still work with other sites in the farm from any other site in the farm, but you cannot, for example, work with the SharePoint API from a machine on which MOSS or WSS is not installed.
* The only practical way to consume SharePoint data and functionality from a remote client is to use the SharePoint web services.
* The object model is not designed to support Remoting.
* To add a reference to a Sharepoint API, Right-click the project(in VS) and select Add Reference. Click the Browse tab and select the
following directory:
C:\program files\common files\microsoft shared\web server extensions\12\isapi

1 comment:

Darren said...

Hi

Tks very much for post:

I like it and hope that you continue posting.

Let me show other source that may be good for community.

Source: Project management interview questions

Best rgs
David