Showing posts with label Interview Questions. Show all posts
Showing posts with label Interview Questions. Show all posts

Interview Questions and Answers of SharePoint for Developers - Part IIII

Part 1 Part 2 Part 3 Part 4


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

Part 1 Part 2 Part 3 Part 4

Interview Questions and Answers of SharePoint for Developers - Part III

Part 1 Part 2 Part 3 Part
4


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.


Part 1 Part 2 Part 3 Part
4

Interview Questions and Answers of SharePoint for Developers - Part II

Part 1 Part 2 Part
3
Part
4


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 Create and Deploy Custom aspx Page as Feature and Solution Package of SharePoint 2007


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.
What Tools Are 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.

Part 1 Part 2 Part
3
Part
4

Questions and Answers of SharePoint Interview for Developers - Part 1

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

See :
Part 1 Part
2
Part
3
Part
4


Related Posts :

The Tutorial of Sharepoint 2007 for beginners

Interview Questions and Answers of SharePoint 2007 for Administrator

Interview Questions and Answers of SharePoint 2007 for Administrator

Q. Can you personalize Shared Services for a single Web
application?

Ans
. You
cannot assign or un-assign few services to a web application. If the web
application is using a perticular SSP, it has to bear the burden of all the
services configured in that SSP.


Q.
How will you move or separate a Site Collection which stays in a shared
WebApplication content database, into its own
separate database.

Ans.
You can create a
new Content database in the target webapplication (which
will contain the new site collection). Then adjust the maximum number of sites
allowed for the content database currently being used. Then use stsadm command
to backup and restore the site colletcion. For Details see How to Create or Move Site Collections into Separate Databases of SharePoint



Q. What are Security
methods(Authentication methods) available in sharepoint 2007.

Ans :
Out of the box", SharePoint 2007 supports nine authentication
methods. NTLM (short for NT Lan Manager, which is simply the Windows
authentication that everyone is familiar with) and Kerberos (also a Windows
"standard" authentication) are offered during installation.



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
the difference between a site and a web?

Ans:
A site in
sharePoint is a site collection. It is an object of SPsite class in sharepoint.
While a Web 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. How will you
backup and restore entire farm ?

Ans.
There are various
methods to backup and restore SharePoint entire farm in SharePoint. Two main
methods that you can use to back up and restore are:

* Using SharePoint
Central Administration Web site - This tool enables you to perform
backups and restorations from the user interface. When you use this method, you
can back up the server farm, Web applications, and any or all of the content
databases in your server farm. You can use the Stsadm command-line
tool to view backup and recovery
history and to view backup and recovery job status.

* Stsadm command-line
tool - Stsadm command-line
tool offers a faster and more
flexible command-line-based approach to farm backup and recovery. This method
for backing up and restoring data does not require SQL Server 2000 tools or SQL
Server 2005 tools. However, to perform this method of backup and recovery, you
must be a member of the administrators group on a computer on which SharePoint
Server or WSS 3.0 is installed.

Other methods to Backup are :

*
Backup Farm by using SQL server Tools - You can perform Full,
Differential and Transaction baclups from SQL server
studio.


* Third Party Tools - You can also use
other Backup and Restore tools such as DocAve for taking daily
backups.



Q. When to use
Diffrent Site Collections?

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

SharePoint Interview Questions:Important Definations

Definitions :

Web Parts are componentized,
self-contained packages of user interface that can be dropped into place on
SharePoint Web Part pages to provide discrete sets of functionality to
users.
It can be incredibly easy to get confused between sites, webs, web
applications, and site collections. The farm is the topmost level in the
hierarchy. Below the farm, you have web applications represented by the
SPWebApplication class, which typically correspond to an IIS application pool.
Below that, you have a collection of site collections contained in the
SPSiteCollection class. Finally, you have site collections represented by the
SPSite class and individual websites represented by the SPWeb
class.

Features allow reusable pieces of functionality
to be created and deployed to other sites,without modifying site templates.It is
always better to deploy a feature in new site instead ofdirectly embedding
mountains of complex XML.Using Features, you can do everything from adding a
link to the Site Settings page to creating a complete, fully functioning Project
Management suite that can be added to any SharePoint site.Features are organized
in folders under the Features directory located under 12 hives; Where SharePoint
Server 2007 puts all of its system files, at the following path:
%SystemDrive%\Program Files\Common Files\Microsoft Shared\web server
extensions\12. The two files that are used to define a feature are the
feature.xml and Elements.xml .The feature XML file defines the actual feature
and will make SharePoint aware of the installed feature. It usually identifies
the Feature itself and its element manifest file and sets the Feature scope to
Web site.
Elements.xml file identifies the assembly, class, and method to
implement in feature.

You can directly deploy a feature in sharepoint
site with

stsadm -o installfeature -filename
XYZEventHandler\Feature.xml

stsadm -o activatefeature -filename
DeletingEventHandler\Feature.xml -url
href="http://server/Site/Subsite">http://Server/Site/Subsite

iisreset

OR
To Deploy it as solution package you need a solution manifest
(manifest.xml).


Solutions allow you to package
Features in a cabinet (.cab) file and define important metadata about those
Features. After a Solution is installed on a server in the farm, you can then
use SharePoint's Solution management features to automate the deployment of that
Solution to other sites within the farm.

The solution manifest (always
called manifest.xml) is stored at the root of a solution file. This file defines
the list of features, site definitions, resource files, Web Part files, and
assemblies to process. It does not define the file structure—if files are
included in a solution but not listed in the manifest XML file, they are not
processed in any way.

Because the solution file is essentially a .cab
file, use the makecab.exe tool to create the solution package. The makecab.exe
tool takes a pointer to a .ddf file, which describes the structure of the .cab
file. The format of a .ddf file is, declare a standard header and then
enumerate, one file per line, the set of files by where they live on disk,
separated by where they should live in the .cab
file.


Features & Solutions:
The Feature
Framework has been extended to allow developers to create custom Features.
Features can be deployed by using SharePoint Portal Server 2007 new form of
deployment, namely Solution Deployment. Solutions as you know, are custom
packages (e.g. WSP file) or redistributable CAB files, created by developers and
deployed by SharePoint Administrators. Administrator can deploy Features to the
individual site or to all Web front End Servers.

Features are a method
for developers to package customisations and deploy them to the SharePoint
portal. They can then be activated and deactivated at the Site Collection level.
Solutions are a way to bundle features together for
deployment.


Custom action :
Represents a link, toolbar button, menu item, or any control that can be added
to a toolbar or menu that appears in the UI. You define custom actions by using
a custom action element within a feature definition file. You can bind custom
actions to a list type, content type, file type, or programmatic identifier
(ProgID). For more information, see Custom Action
Definitions.


Event receiver: Evaluator of an event
and definer of the behavior of an application. Windows SharePoint Services 3.0
allows you to define event handlers within libraries, lists, and sites. Event
receivers can be defined by using a receiver element within a feature definition
file. For more information, see Event
Registrations.


Master page:
Pages
that provide a consistent layout and appearance (look and feel) for SharePoint
sites. They allow you to factor out layout, structure, and interface elements
such as headers, footers, navigation bars, and content placeholders. Master
pages in ASP.NET 2.0 and master pages in Windows SharePoint Services work in the
same way. For more information, see Building Simple Master Pages for Windows
SharePoint Services 3.0.


Module :
A file or
collection of file instances that define the location where the files are
installed during site creation. Modules are frequently used to implement a Web
Part Page in the site. You can define modules by using a module element within a
feature definition file. For more information, see
Modules.


SharePoint site:
A Web site hosted in a
virtual URL. A SharePoint site is a place for collaboration, communication, or
content storage. Depending on your business needs, you can create sites such as
team sites, blog sites, wiki sites, and others. You can customize a site's
appearance, users, user permissions, galleries, and site administration by using
the Site Settings administration pages.


SharePoint site
collection:
A collection of SharePoint sites that share common
administration pages and site settings. Site collections allow you to share
content types, site columns, templates, and Web Parts within a group of
SharePoint sites.


SharePoint Web farm:
A group of
Office SharePoint 2007 servers that share the same configuration database. All
site content and all configuration data is shared for all front-end Web servers
in a server farm.


Site definition.:
A set of files
that includes a master XML configuration file that is stored on all front-end
Web servers. A site definition provides the basic blueprint for how sites look,
what lists they include, their default navigational structures, and so on. For
more information, see Working with Site Templates and
Definitions.


Theme:
A group of files (CSS, images)
that allow you to define the appearance (look and feel) of Web pages. Themes in
ASP.NET 2.0 and themes in SharePoint Products and Technologies work in the same
way. Themes are used to help organizations to brand their portals and team
sites. Office SharePoint Server 2007 includes a set of predefined themes.
However, as a developer, you can create custom themes for your company. For more
information, see How to: Customize Themes.







 

Interview Questions and Answers of SharePoint 2010 Workflow

These are the basic level questions which can be asked in a interview. I will write a separate Post for high-level workflow interview questions.

Q. What is a workflow?

Ans. Workflows are the way an organization functions, a series of actions that correspond to a work process, such as the process for purchase orders.SharePoint 2010 helps you automate these workflows, thereby increasing the efficiency and productivity of the organization.

Q. What are the types of workflow that you can design in SharePoint 2010.

Ans. you can design List Workflows, Reusable List Workflows and Site workflows using SharePoint designer 2010.

Q. What  Reusable List Workflows and  Site workflows ?

Ans.

Reusable List Workflows -

You can create a reusable list workflow (reusable workflow) in the top-level site in the site collection, and that workflow can be made globally reusable — meaning that the workflow can be associated to any list, library, or content type in the site collection. You can also create a reusable workflow in any subsite in the site collection; this workflow is available for reuse in that particular subsite.

Site workflows - A site workflow is associated to a site — not to a list, library, or content type. So unlike most workflows, a site workflow is not running on a specific list item. Because of this, many of the actions that are available for items not available for site workflows.

Q. Can you modify the Out-of-Box workflows in SharePoint 2010 ?

Ans. In SharePoint 2010, you have an option to customize the Out-of-Box workflows. The four most popular workflows in SharePoint Server 2007 — the Approval, Collect Feedback, Collect Signatures, Publishing Approval workflows — have been completely rebuilt as declarative reusable workflows, meaning that they are now fully customizable in SharePoint Designer 2010.

Q. What are events, actions, conditions and steps?

Ans. Lets look at this one by one.

Events - An event is what starts or initiates a workflow. Events can also be used to manage the timing of actions within a workflow, such as waiting for the status of an item to change. There are three events that can start a workflow:

* An item is created.
* An item is changed.
* A workflow participant clicks a start button on the SharePoint site.

Actions –
An action is the most basic unit of work in a workflow. SharePoint Designer 2010 provides a set of ready-made, reusable actions for you to incorporate into your workflow.

For example, your workflow can:

* Create, copy, change, or delete list items (including documents).
* Check items in or out.
* Send an e-mail message.

Conditions - When you design a workflow, you can use the workflow editor to create rules that apply conditional logic to SharePoint sites, lists, items and content types. A rule establishes a condition where the workflow performs the associated action only if that condition is true. For example, you can create a rule where the workflow sends a reviewer an e-mail message only if an item is created by a specific person.

Q. What are Parallel and Serial actions ?

Ans. When you have more than one action associated with a condition, the actions can be set up to run at the same time (parallel) or one after another (serial), the default.

Q. What are the Types of forms associated with the workflow ?

Ans. With SharePoint Designer 2010, you can create three types of workflow forms:

Initiation form  – An initiation form gathers information from the workflow participant when they start the workflow. It is automatically generated when you create the workflow in SharePoint Designer 2010. Initiation forms are displayed to users when they manually start a workflow on a given SharePoint item. With an initiation form, users can specify additional parameters or information about the workflow as it applies to the given SharePoint item.

Task form –
A custom task form allows workflow participants to interact with tasks in the Tasks list specified for the workflow. With the Custom Task Wizard, you can easily create custom form fields and add them to a custom task form. When you finish designing the workflow, SharePoint Designer 2010 automatically generates the InfoPath or ASP.NET forms for your custom tasks.

Reusable workflow – association form – A reusable workflow, by default, only provides the fields common to all items, such as Created and Modified by. This is because a reusable workflow isn't by default associated with a list, library, or content type. An association form enables you to associate fields with a reusable workflow so that the fields will be available when you design and run the workflow.

Q. When are these forms get created ? And how do you customize it ?

Ans. SharePoint Designer 2010 automatically generates the forms, but you can customize them by going to the settings page for the workflow, in the Forms section, click the form you want to customize. Workflow forms are either InfoPath or ASP.NET pages. They are stored on the SharePoint site with the workflow source files.

interview questions and answers of SharePoint 2010 developer Part – II

Q. Why would you use LINQ over CAML for data retrieval?

Ans. Unlike CAML, with LINQ to SharePoint provider, you are working with strongly typed list item objects. For example, an item in the Announcements list is an object of type Announcement and an item on a Tasks list is an object of type Task. You can then enumerate the objects and get the properties for your use. Also, you can use LINQ syntax and the LINQ keywords built into C# and VB for LINQ queries.

Q. Can we use our custom master page with the application pages in SharePoint 2010 ?

Ans. With 2010, you can now set whether the pages under _Layouts use the same Master Page as the rest of your site. You can enable or disable this functionality through the web application settings in Central Administration. This however, is not applicable to your custom application pages.  If you want your custom applictaion page to inherit the site master page you must derive it from Microsoft.SharePoint.WebControls.LayoutsPageBase class.

Q. What are WebTemplates and Site Definitions ?

Ans. Site definitions consist primarily of multiple XML and ASPX files stored on a front-end Web server in folders under the %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\SiteTemplates directory.
Custom Web templates on the other hand, are stored in the database, and are created using an existing site, with or without its specific content, as a model. This provides a means for reusing sites that you have customized.In some ways, Web templates continue to depend, throughout their lifecycle, on the site definition that is their ultimate foundation.

Q. How do you write to SharePoint ULS logs in 2010 ?

Ans. In SharePoint Foundation, ULS exposes configurable settings in two ways, through the – Object model and Windows PowerShell cmdlets. For writing to SharePoint ULS logs developers can can use Diagnostics Service, which will make the customized categories viewable in the administrative UI for our errors.
or they can use the number of cmdlets available for accessing ULS logs using powershell. Some of the cmdlets are Get-SPDiagnosticConfig ,Get-SPLogEvent etc.

Q. What does CMDUI.XML contain?

Ans. The definitions for the out-of-the-box ribbon elements are split across several files in the SharePoint root, with TEMPLATE\GLOBAL\XML\CMDUI.XML being the main one.

interview questions and answers of SharePoint 2010 developer Part – I

Q. How does Client object model works ?

Ans. When we use SharePoint client API's to perform a specific task, the SharePoint Foundation 2010 managed client object model bundles up these uses of the API into XML and sends it to the server that runs SharePoint Foundation. The server receives this request, and makes appropriate calls into the object model on the server, collects the responses, forms them into JavaScript Object Notation (JSON), and sends that JSON back to the SharePoint Foundation 2010 managed client object model. The client object model parses the JSON and presents the results to the application as .NET Framework objects (or ECMAScript objects for ECMAScript).

Q. How many types of Client Object model extension are available in 2010 and when would you use one or the other.

Ans. To develop rich client side solutions, three set of client-side APIs has been introduced in the Microsoft.SharePoint.Client namespace. The three APIs are targeted for three different types of clients.
1. .net Managed applications – These are used when we have to create console applications or window applications, web applications which are not running inside SharePoint Contex.
2. For Silverlight applications
3. ECMAScript – It is a client object model extension for using with JavaScript or JScript. This is used for creating applications which are hosted inside SharePoint. For example, web part deployed in SharePoint site can use this JavaScript API for accessing SharePoint from browser using JavaScript.

Q. What is difference between Load() and LoadQuery() methods ?

Ans. Load method populates the client object directly with what it gets data from the server i.e. a collection object like ListItemCollection etc. but LoadQuery returns the data as a completely new collection in  IEnumerable format. Other major difference is that the Collections that you load using the Load() method are eligible for garbage collection only when the client context variable itself goes out of scope where as, in  these collections go out of scope at the end of  IEnumerable<List> list.

Q. How can you write efficient and better performing client object applications ?

Ans. You can always use Lambda expressions in your queries to return only specific properties that will be used in your block. You can also use LoadQuery() method and specify multiple levels of properties to load for e.g. while returning specific properties of the lists using LoadQuery(), you can also specify the fields to return from each list to optimize the data access.

Q. What are the Authentication methods for your client object model application ?

Ans. Basically there are three (3) authentication options you can use when you're working with the Client Object Model in SharePoint 2010:

* Anonymous
* Default
* FormsAuthentication

You can specify clientContext.Authentication  =  Anonymous\Default\FormsAuthentication, If you do not choose an authentication method in your code, the application will default to using the client's Windows Credentials (DefaultCredentials).

Q. How do you access ECMAScript object model API's ?

Ans. The ECMAScript library is available in a number of JS files in the LAYOUTS folder. The main file among number of .js files is SP.js. When you include this file in the APSX page using a ScriptLink control, all other required JS files are loaded automatically. By linking SP.js to your page, the SP namespace gets registered. SP is the SharePoint namespace that contains all objects. For debugging purposes every js file also has a 'debug' equivalent in the same folder.

Q. What is the purpose of calling clientContext.ExecuteQuery() ?

Ans. ExecuteQuery gives you the option to minimize the number of roundtrips to the server from your client code. All the components loaded into the clientcontext are executed in one go.

Interview Questions Of SharePoint 2007 Object Model

Q. What are the main namespaces in SharePoint 2007 ?

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.

Q. How Do you create custom column in Sharepoint object model ?

Ans. To create custom filed types you need to follow the below steps :
1. Create a Field Type Definition
2. Create a Field Class
3. Create a Rendering Control Class
4. Create One or More Rendering Templates
5. Create a Field Value Type
6. Create an Editing Control

Q. How do I use and deploy code behind files with my custom pages in SharePoint ?

Ans. You do not deploy code behind files in along with your custom aspx or layouts page Instead, you can just have the aspx page inherit from the compiled .dll of the project containing that code file.

Q. How can you get the filtered items from a  SharePoint list programatically?

Ans. You can either use SPQuery with the where condition or you can set a up a filtered view in the list itself and then access the view in your solution using SPView class.

Q. What will you do for fast and efficient retrieval of items from sharepoint lists ?

Ans. You can use either SPquery object from SPquery class or you can use PortalSiteMapProvider class. PortalSiteMapProvider class includes a method called GetCachedListItemsByQuery that retrieves data from a list based on an SPQuery object that is provided as a parameter to the method call. The method then looks in its cache to see if the items already exist. If they do, the method returns the cached results, and if not, it queries the list, stores the results in cache and returns them from the method call.

Q. What are Activation Dependencies in SharePoint fetaures ?

Ans.

A Feature activation dependency expresses a requirement in the relationship between two Features. You generally use activation dependencies for two purposes:
1. To specify that your feature should not be activated unless another feature gets activated. It means your feature activation is dependent of the activation of some other feature. To implement this all you need to do is add a <ActivationDependencies> tag in your feature.xml file and add a ActivationDependency under it. ActivationDependency however needs FeatureId i.e. the guid of the parent feature  on whom your feature is dependent.
2. For Feature grouping concepts. That means when one Feature is activated, other Features can also be activated.

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 collection. The data is extracted on the basis of the query you write and is returned as a Datatable.

Q. Can you specify a particular list for SPSiteDataQuery ?

Ans. You can also specify the GUID for the lists\libraries you want to query against in  lists tag.

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.

Q. How should I deploy a webpart, a master page and a layouts page in one solution package ?

Ans.Create different features file for each component  and add Modules for them in their elements file. all features can be added in one solution package.

Interview questions Of Sharepoint 2010

Q. What has Changed in SharePoint 2010 Object model?

Ans. Microsoft has replaced the "12 hive" structure that we had in SharePoint 2007 with "14 Hive" structure in 2010.

It has apparently added four new folders to its hive.

The Folders are :
* Policy
* UserCode
* WebClients
* WebServices

 

Q. How would you deploy WebPart Using Windows PowerShell?

Ans. At the Windows PowerShell command prompt (PS C:\>), type the below command :

Install -SPWebPartPack -LiteralPath "FullPathofCabFile" -Name "Nameof WebPart"

Q. How would you re-deploy the old custom solutions in SharePoint 2010.What Changes are needed to the old Solution files.

Ans. SharePoint 2010 object model contains many changes and enhancements, but our custom code will still compile and, will run as expected. You should however, rewrite and recompile any code that refers to files and resources in "12 hive".
For Details See :
SharePoint Object Model – Backward Compatibility

Q. How would you add a link in the Ribbon?

Ans. You can add any link or Custom Action under any of the existing tabs of the ribbon or can create a new a new tab and place your links under it.

Q. What does CMDUI.XML contain?

Ans. The definitions for the out-of-the-box ribbon elements are split across several files in the SharePoint root, with TEMPLATE\GLOBAL\XML\CMDUI.XML being the main one.

Q. What are the Disadvantages of Using LINQ in your Code?

Ans. LINQ translates the LINQ queries into Collaborative Application Markup Language (CAML) queries thus adding an extra step for retrieving the items.

Q. What is different with SharePoint 2010 workflows ?

Ans. Some of the additions in workflow model are :

1. SharePoint 2010 workflows are build upon the the workflow engine provide .Net Framework 3.5.

2. In addition to the SharePoint lists we can now create workflows for SharePoint sites as well.

3. SharePoint Designer 2010 also has a new graphical workflow designer for designing workflows and deploying them directly to SharePoint.

4. Another Improvement in SharePoint Designer 2010 is that it now allows you to edit the out-of-the-box workflows that come with SharePoint.

Interview Questions Of SharePoint Programming

These are the Interview question related to SharePoint object model and its Webservices. Some of the questions also apply to SharePoint 2010 object model.

Q. Where are the files deployed in SharePoint 2007 ?

Ans. Developers generally deploy various files in the in the 12 hive folders that make SharePoint Interface. For e.g. if a Custom Css file needs to be deployed it will go under
"C:\Program Files\Common Files\Microsoft Shared\Web Server Extenstions\12\Templates\Layouts\1033\Styles" path. This path is well mapped with Out-of-box SharePoint components and is suppose to contain Custom and Out-of-Box Css files.

Q. How are these files deployed?

Ans. Solution packages or wsp are used to deploy or drop these files in various 12 hive folders.  The manifest.xml (solution package file ) contains various tags such as  or  to drop in these files in the 12 hive. Tags in manifest.xml file are well mapped with the 12 hive folders, so all you need is to provide a virtual location for a folder under Templates to drop your file in Files.

Q. How can you add an existing user control on a SharePoint Page ? Do you need to make any modifications to the control ?

Ans. You can either use a Custom webpart or a smartPart webpat to load your usercontrol in the page.  You can also add a user control to a master page if that's your requirement. You must drop the signed assembly for the UserControl in GAC and add the usercontrol in _ControlTemplates folder under 12 hive.

Q.  If you create a event receiver feature how can you bind it with one specific list.

Ans. We can create a FeatureReceiver and write some code in  FeatureActivating method of the FeatureReceiver to assign the specific list to the event receiver feature itself.

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. What is the difference between SPQuery and SPSiteDataquery ?

Ans. SPQuery is a CAML query used to retrieves items fromone perticular list . SPSiteDataquery on the other hand retrieves items from multiple lists and libraries in the same site collection. you can however, specify the Guid of the Lists for the SPsiteDataQuery to run on.

Q. How can you display data from a Parent site in a Subsite or Cross sites ?

Ans. Even though, its difficult to do this Out-of-box we have sevral options :
1. Using sharepoint designer – We can use DataviewWebPart and choose to connect to a different site and after creatign a connection, you will be listed with all list and libraries of the parent site or the cross site or site collection.

2. Use Site Lookup column – We can also create a column in the parent site as a Site column of type Lookup and then can add this column in subsites list\library.

3. Can export a listView webpart from a parent site (ofcourse displaying parent site list data) and import it into any subsite page.

Q. How do you display an infopath form on any SharePoint page.

Ans. You need to use xmlformviewer webpart to display the admin uploaded infopath form.

Interview Questions SharePoint 2010

Q. How does Ribbon works ?

Ans. A file called CMDUI.XML stays at the web front end which contains the Out-of-Box site wide Ribbon implementation i.e. all the Ribbon UI for the entire site. In addition to this you have a CustomAction for each ribbon component. These CustomActions have CommandUIExtentions block which has CommandUIDefinitions and CommandUIHandlers which make up the activity of the ribbon component. So, when the ribbon is loaded the CommandUIDefinition merges with Out-of-Box definition in the CMDUI.XML

Q. How will you use WebParts or other solutions Created in SharePoint 2007 in SharePoint 2010 ?

Ans. In SharePoint 2010 the 12 hive is now replaced by 14 hive, So we will rewrite and recompile any code that refers to files and resources in “12″ hive. In addition to we must recompile custom code written for Windows SharePoint Services 3.0 and Office SharePoint Server 2007 that does not run on IIS.

Q. What is the advantage in using Windows PowerShell over stsadm in SharePoint 2010 ?

Ans. Unlike stsadm, which accept and return text, Windows PowerShell is built on the Microsoft .NET Framework and accepts and returns .NET Framework objects.Windows PowerShell also gives you access to the file system on the computer and enables you to access other data stores, such as the registry and the digital signature certificate stores etc..

Q. What is REST ? How is it used in SharePoint 2010 ?

Ans. REST (Representational State transfer) is a protocol (powered by ADO.NET services) which is used for getting data out of sharepoint via Url. It is mostly used to access data from sharepoint even when you are not in the sharepoint context.

Q. What datatype is retured by REST ?

Ans. REST does not return an object of type SharePoint Site\List. Instead, it returns an XML output.