Friday, January 7, 2011

SharePoint Interview Questions -5

What does AllowUnsafeUpdates do ?

If your code modifies Windows SharePoint Services data in some way, you may need to allow unsafe updates on the Web site, without requiring a security validation. You can do by setting theAllowUnsafeUpdates property. C#:
1
2
3
4
5
6
7
8
9
10
using(SPSite mySite = new SPSite("yourserver"))
{ using(SPWeb myWeb = mySite.OpenWeb())
{
myWeb.AllowUnsafeUpdates = true;
SPList interviewList = myWeb.Lists["listtoinsert"];
SPListItem newItem = interviewList.Items.Add();
newItem["interview"] = "interview";
newItem.Update();
}
}


- What does RunWithElevatedPrivileges do?

Assume that you have a Web Part in which you want to display information obtained through the Windows SharePoint Services object model, such as the name of the current site collection owner, usage statistics, or auditing information. These are examples of calls into the object model that require site-administration privileges. Your Web Part experiences an access-denied error if it attempts to obtain this information when the current user is not a site administrator. The request is initiated by a nonprivileged user. you can still successfully make these calls into the object model by calling the RunWithElevatedPrivileges method provided by the SPSecurity class. C#:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
SPSite siteColl = SPContext.Current.Site;
SPWeb site = SPContext.Current.Web;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite ElevatedsiteColl = new SPSite(siteColl.ID))
{
using (SPWeb ElevatedSite = ElevatedsiteColl.OpenWeb(site.ID))
{
string SiteCollectionOwner = ElevatedsiteColl.Owner.Name;
string Visits = ElevatedsiteColl.Usage.Visits.ToString();
string RootAuditEntries = ElevatedSite.RootFolder.Audit.GetEntries().Count.ToString();
}
}
});


- What is a SharePoint Feature? What files are used to define a feature?

A SharePoint Feature is a functional component that can be activated and deactivate at various scopes throughout a SharePoint instances.
Scopes include
  • Farm
  • WebApplication
  • Site (site collection)
  • Web (site)
Features have their own receiver architecture, which allow you to trap events such as when a feature is
  • installing
  • uninstalling
  • activated
  • deactivated
The element types that can be defined by a feature include
  • menu commands
  • link commands
  • page templates
  • page instances
  • list definitions
  • list instances
  • event handlers
  • workflows
The two files that are used to define a feature are
  • feature.xml
  • manifest file(elements.xml)
The feature XML file defines the actual feature and will make SharePoint aware of the installed feature. The manifest file contains details about the feature such as functionality.
Common stsadm commands associated with feature are
  • stsadm -o installfeature
  • stsadm -o uninstallfeature
  • stsadm -o activatefeature
  • stsadm -o deactivatefeature


- What are content types ?

A content type is a flexible and reusable WSS type definition 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 customer presentation document with a unique set of columns, an event handler, and its own document template.
-You can create a second content type for a customer proposal document with a different set of columns, a workflow, and a different document template.
Then you can attach both the contenttypes to a document library, which allows you to capture metadata based on the contenttype selected during creation of the document.

Content type can be created by the following
  • from the rootweb of a site collection, go to Site Action > Site Settings > Galleries > Site content types
  • using a feature


5. Workflow can be applied to what all elements of SharePoint ?

While workflow associations are often created directly on lists and document libraries, a workflow association can also be created on a content type that exists within the Content Type Gallery for the current site or content types defined within a list.
In short, it can be applied ...
  • At the level of a list (or document library)
  • At the level of a content type defined at site scope
  • At the level of a site ( Sharepoint 2010 )


- What are the ways to initiate the workflow ?

  • Automatic (on item added or item deleted)
  • Manual (standard WSS UI interface)
  • Manual (Custom UI Interface)
  • Programatically through custom code


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


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


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


10. 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");


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


12. How to query from multiple lists ?

Use SPSiteDataQuery to fetch data from multiple lists.


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


14. 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 code
Asyncronous 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.


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


16. 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\"";

SharePoint Interview Questions -4

Que 6: How would you define configurable properties in a webpart?
Ans 6: Here is a simple example of creating a property that can be configured by the users. Notice how each attribute is separated by commas (,).

[code:c#]
[Browsable(false),Category("Miscellaneous"),
DefaultValue(defaultText),
WebPartStorage(Storage.Personal),
FriendlyName("Text"),Description("Text Property")]
public string Text
{
get
{
return text;
}

set
{
text = value;
}
}
[/code]

Que 7: What is a feature scope and where is it defined?
Ans 7: A feature scope restricts the use of feature to different heiarchy available in SharePoint object model. The scope is defined in the feature.xml file. Here are the different levels of scope available.

a) Web: This restrict the use of feature to the scope of a site e.g HR site feature cannot be used in Accounting Site.
b) Site: This restricts the use of feature to a specific Site Collection.
c) WebApplication: This restrict the use of feature to the scope of web application.
d) Farm: This is the highest level available. A feature defined with the scope of Farm is available to all the web application, site collections and websites defined in the Farm.

Que 8: What is a Site Definition? How can you create a new Site Definition?
Ans 8: A site definition is a collection of files that defines the structure & layout of site templates. Confused? Well, don't be. A site definition comprised of a webtemp.xml file which in turn defined the order of various site templates available in that site definition. Site definition file also include a separate directory structure that includes all the other core files required. The webtemp.xml file is stored in%COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML location and directory that contains all the core files is %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions \12\TEMPLATE\SiteTemplates.

Steps for creating a custom Site Definition.

Step 1.Create a copy of existing site Definition structure by navigating to %COMMONPROGRAMFILES%\\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates. Rename the file as NewLOB (short form for New line of business).

Step 2. Navigate to %COMMONPROGRAMFILES%\\Microsoft Shared\web server extensions\12\TEMPLATE\1033and copy the STS directory and paste it in the same strucutre and rename it as NewLOB.

Step 3. Create webTemp.xml file to register the site definition created in step 1&2.

Step 4. Reset IIS.

Thats it. Now, new site definition is available for use for the new line of business group.

Que 9: Explain the concept of feature Stapling?
Ans 9: In order to follow the best practices set forth by Microsoft, we should not modify the out-of-box site definiton file. So how would you achieve the customized needs of the business without having to create a brand new Site Definition files and structure? The answer is Feature Stapling. Feature stapling is a feature developed to staple (or read attach) another feature to one or more out-of-box site definition (technically speaking, it can include your custom site definition also). Here is an example of feature stapling that staples feature to different STS's.

[code:xml]
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<FeatureSiteTemplateAssociation Id="00BFE171-1B17-4F72-28CB-1171C0140130"TemplateName="STS#0" />
<FeatureSiteTemplateAssociation Id="00BFE171-1B17-4F72-28CB-1171C0140130"TemplateName="STS#1" />
<FeatureSiteTemplateAssociation Id="00BFE171-1B17-4F72-28CB-1171C0140130"TemplateName="STS#2" />
Elements>
[/code]

Que 10: What is the role of IFilter in SharePoint?
Ans 10: IFilter is a component installed on the server (Indexing and WFEs) to index documents that with file format associated with IFilter. Out-of-box WSS supports IFilter for Word, Excel, Text, HTML, PPT, OneNote & xps. If a company stores a lot of pdf documents, the a custom IFilter install is required to enable indexing and search to support pdf formats. PDF's IFilter is freely available and can be downloaded from Adobe's website. However for tiff files, there are no free IFilter available (atleast not to my knowledge).

SharePoint Interview Questions -3

Que:1 Explain the concept of ghosting/unghosting?
Ans:1 First of all, with the release of WSS 3.0, Microsoft has renamed the concept of ghosting/unghosting as uncustomized/customized pages, but since it kind a makes look interviewer cool asking scary question, lot of people still use old term i.e. ghosting/unghosting. Anyway, In order to answer this question, we should dive into inner workings of SharePoint and how it renders site pages. For e.g. there is only 1 default.aspx page that is on the file server. But if you browse through SharePoint designer you would see multiple instances of the same file (each residing in the root of every site). Thats actually an illusion :-). If default.master is left uncustomized, then there is only 1 copy of that file which is served to all the sites in a site collection. If we chose to customize the default.master page to the needs of a particular department (eg. HR needs to have a different Navigation menu with different layout), the file is now stored in content database and served straight with the parser. This file now is only specific to the HR department sites. Now the real question is why is customizing site pages bad? Well, you can imagine if a file is ghosted (uncustomized), then the same file gets rendered to meet the needs of several hundreds of sites. But if you cutomize it and if all the deparment start to customize their site pages, then you ar e bound to have performance issues because now instead of leveraging caching etc now each request goes to the database and pages are served using the database content which adds another layer and in-turn some latency.
Here is an image on how a page looks like in SharePoint designer if it is customized. Notice, that now the tooltip also says that "Page is customized" instead of Unghosted (or whatever).


Que:2 Explain the heirarchy of SharePoint Object Model?
Ans:2 A farm is the highest entity in SharePoint object model which typically consists of a database server, an Application server (if running MOSS), and atleast 2 web front end servers. A web application is the highest level in SharePoint which is nothing but a web site in IIS 6.0. A web application can have multiple site collection and each site collection can have 1 to n web sites. Here is a picture that sums up the hiearchy of SharePoint object model.


Que:3 What are different ways in which a SharePoint workflows can be kicked off (out of box)?
Ans:3 A SharePoint workflow can be started a) manually b) automatically when a new item is inserted c) automatically when an existing item is changed.


Que:4 What are Site Pages? And how are they different from application pages?
Ans:4 Yet another commonly misunderstood phenomenon. Sites Pages are typically the pages that supports user customization. For e.g default.aspx is a site page which a developer can modify using SharePoint designer. What this also means is that now the page is customized state which will force the application to grab the file from content db and this will negatively impact performance if not administered correctly. On the other hand, an application page actually serves several website. Even-though there is just one version of the file in the physical file location, through creative use of URL re-writing (a product of .net 2.0 framework), the url appends _layout folder to each site, making it seem like copies of the same file. You can also have custom application pages and store them on physicaly drive but I will caution you to read the best practices before you venture into this.

Que:5 What are site columns? How are they beneficial?
Ans:5 Site columns allows you to create a lookup columns in one location and share the column with any custom lists that would need it. A good example where you would like to create a site column is company locations. Now every list that you create under a site collection, it will have access to this site column, which will allow to re-use the same colum site wide. In future, if your company opens new offices, then you only need to add the new location in the site column which will automatically update the all the list using that site column.

Que:6 Describe the process of adding custom web-part available to SharePoint?
Ans:6 This question is important to understand the developer's grasp on the steps required to make this happen because it really is not as easy as copying .dwp file to the file server and you are done. Nonetheless, here are the steps to make your webpart avaiable to SharePoint. a) Strongly name the assembly and sign it with snk file. Create a key/pair file using sn.exe utility. b) In the assemblyInfo.cs file add the line [assembly: AssemblyKeyFile("..\\..\\.snk")]. c) If you want the webpart to be available to all the web applcation on a server, then you will have to put the .dll file into GAC. If the need is just to enable for a certain website, then you can only copy the .dll file into the bin directly of that particular site. d) Copy the .dwp file into the wpcatalog folder and update the SafeControls section of the web.config file to include the new webpart location. Alternatively, you can also install webpart by creating a webpart package and manifest.xml & MakeCab utility. Once the cab file is created, simply run the following line.

SharePoint Interview Questions -2

What are the responsibilities of a SharePoint Architect?

What base class do custom Field Controls inherit from?

What is session and cookies?

What is the difference between session & cookies?

What is impersonation and when would you use impersonation?

What are Class Resources? How do you reference and deploy resources with an ASP.NET 2.0 WebPart?

What are content types?

What is a SharePoint Feature? What files are used to define a feature?

How to create links to the mapped network drives?

Can SharePoint compare two document versions?

Explain a basic back-up Startegy for a Portal?

What is the difference between method activity and event activity in WorkFlow?

What is the concept of virtual path provider?

What does RunWithElevatedPrivileges do?

What is the relationship between Microsoft SharePoint Portal Server and Microsoft Windows Services?

What is Windows SharePoint Services?

What is a SharePoint site definition?

What does a SPWebApplication object represent?

What is the use of SQL Server in share point?

What is the concept of safemodeparser in ASP.NET?

What is the main advantage of using site collections?

What is a Field Control?

What are the various Sharepoint 2003 and Exchange integration points?

What is the WebPartManager sealed class? What is its purpose?

What is an ancestral type and what does it have to do with content types?

How does WSS actually work?

What is the concept of Site pages and Application pages?

What is the Main difference between Windows SharePoint Services and MOSS?

SharePoint Interview Questions -1

What is the relationship between Microsoft SharePoint Portal Server and Microsoft Windows Services?
Microsoft SharePoint Products and Technologies (including SharePoint Portal Server and Windows SharePoint Services) deliver highly scalable collaboration solutions with flexible deployment and management tools. Windows SharePoint Services provides sites for team collaboration, while Share Point Portal Server connects these sites, people, and business processes-facilitating knowledge sharing and smart organizations. SharePoint Portal Server also extends the capabilities of Windows SharePoint Services by providing organizational and management tools for SharePoint sites, and by enabling teams to publish information to the entire organization.

What is a SharePoint Feature? What files are used to define a feature?
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.

The element types that can be defined by a feature include
menu commands, link commands, page templates, page instances, list definitions, list instances,
event handlers, and workflows.

The two files that are used to define a feature are the feature.xml and manifest file(elements.xml). The feature XML file defines the actual feature and will make SharePoint aware of the installed feature. The manifest file contains details about the feature such as functionality.


Workflow can be applied to what all elements of SharePoint ?
Workflow associations are often created directly on lists and libraries, a workflow association can also be created on a content type that exists within the Content Type Gallery for the current site or content types defined within a list. In short, it can be applied ...
At the level of a list/library
At the level of a content type defined at site scope
At the level of a content type defined at list scope

What are the types of input forms that can be created for a workflow ?
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.

Note that these forms are optional when you create a workflow template.

What are ways to create input forms for workflow ?
Two
1. 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)
2. Using Microsoft Office InfoPath 2007 (disadv: picks up a dependenct on MOSS, i.e. it cannot run in a standalone WSS environment)

What is the difference between method activity and event activity in WorkFlow ?
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.

What are content types?
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.
Can a content type have receivers associated with it?
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.

What two files are typically (this is kept generally) included when developing a content type, and what is the purpose of each?
There is generally the main content type file that holds things like the content type ID, name, group, description, and version. There is also the ContentType.Fields file which contains the fields to include in the content type that has the ID, Type, Name, DisplayName, StaticName, Hidden, Required, and Sealed elements. They are related by the FieldRefs element in the main content type file.

What is an ancestral type and what does it have to do with content types?
An ancestral type is the base type that the content type is deriving from, such as Document (0x0101). The ancestral type will define the metadata fields that are included with the custom content type.

Can a list definition be derived from a custom content type?
Yes, a list definition can derive from a content type which can be seen in the schema.XML of the list definition in the element.

When creating a list definition, how can you create an instance of the list?
You can create a new instance of a list by creating an instance.XML file

What is a Field Control?
Field controls are simple ASP.NET 2.0 server controls that provide the basic field functionality of SharePoint. They provide basic general functionality such as displaying or editing list data as it appears on SharePoint list pages.

What base class do custom Field Controls inherit from?
This varies. Generally, custom field controls inherit from the Microsoft.SharePoint.WebControls.BaseFieldControl namespace, but you can inherit from the default field controls.

Can multiple SharePoint installs point to the same DB?
Multiple SharePoint installs can use the same database server. Not literally the same database on that server. That server must be SQL Server 2000 or SQL Server 2005. It cannot be Oracle or another vendor.

How to create links to the mapped network drives?
Creating links to mapped drives in WSS v3 or MOSS 2007 can be done via
the new content type for .lnk files.

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.

What are the two base classes a WebPart you are going to use within SharePoint 2007 can inherit from?
There are two base classes that a WebPart which is going to be consumed by SharePoint can inherit from, either the
SharePoint WebPart Base class
or the
ASP.NET 2.0 WebPart base class.
When inheriting from the SharePoint WebPart Base class your derived WebPart class will inherit from Microsoft.SharePoint.WebPartPages.WebPart. When inheriting from the ASP.NET 2.0 WebPart base class your derived WebPart class will inherit from System.Web.UI.WebControls.WebParts.WebPart. It is considered good practice to use the ASP.NET WebPart base class since the old base class is meant for backwards compatibility with previous version of SharePoint, however there are four exception when it is better to leverage functionality from the SharePoint WebPart base class:
Cross page connections
Connections between Web Parts that are outside of a Web Part zone
Client-side connections (Web Part Page Services Component)
Data caching infrastructure

What are the differences between the two base classes and what are the inherit benefits of using one over another?
The difference is the Microsoft.SharePoint.WebPartPages.WebPart base class is meant for backward compatibility with previous versions of SharePoint. The benefit of using the SharePoint WebPart base class is it supported:
Cross page connections
Connections between Web Parts that are outside of a Web Part zone
Client-side connections (Web Part Page Services Component)
Data caching infrastructure
ASP.NET 2.0 WebParts are generally considered better to use because SharePoint is built upon the ASP.NET 2.0 web architecture. Inheriting from the ASP.NET 2.0 base class offers you features that inherit to ASP.NET 2.0, such as embedding resources as opposed to use ClassResources for deployment of said types.

What is the WebPartManager sealed class? What is its purpose?
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. For example, the WebPartManager is responsible for the functionality that is provided when you are working with moving a WebPart from WebPartZone to WebPartZone. It is known as the “the central class of the Web Part Control Set.”

What does AllowUnsafeUpdates do ?
If your code modifies Windows SharePoint Services data in some way, you may need to allow unsafe updates on the Web site, without requiring a security validation. You can do by setting the AllowUnsafeUpdates property.

What does RunWithElevatedPrivileges do?
There are certain object model calls model that require site-administration privileges. To bypass access-denied error, we use RunWithElevatedPrivileges property when request is initiated by a nonprivileged user. We can successfully make calls into the object model by calling the RunWithElevatedPrivileges method provided by the SPSecurity class.
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("hitenders");

What is a SPSite and SPWeb object, and what is the difference between each of the objects?
The SPSite object represents a collection of sites (site collection [a top level site and all its subsites]). The SPWeb object represents an instance SharePoint Web, and SPWeb object contains things like the actual content. A SPSite object contains the various subsites and the information regarding them.

What does a SPWebApplication object represent?
The SPWebApplication objects represents a SharePoint Web Application, which essentially is an IIS virtual server. Using the class you can instigate high level operations, such as getting all the features of an entire Web Application instance, or doing high level creation operations like creating new Web Applications through code.

Would you use SPWebApplication to get information like the SMTP address of the SharePoint site?
Yes, since this is a Web Application level setting. You would iterate through each SPWebApplication in the SPWebApplication collection, and then use the appropriate property calls (OutboundMailServiceInstance) in order to return settings regarding the mail service such as the SMTP address.

How do you return SharePoint List items using SharePoint web services?
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.
Side Question: I got asked how I built queries with the lists.asmx web service. In order to build queries with this service, one of the parameters that the GetListItems method exposes is the option to build a CAML query. There are other ways to do this as well, but that was how I answered it.

When retrieving List items using SharePoint Web Services, how do you specify explicit credentials to be passed to access the list items?
In order to specify explicit credentials with a Web Service, you generally instantiate the web service, and then using the credentials properties of the Web Service object you use the System.Net.NetworkCredential class to specify the username, password, and domain that you wish to pass when making the web service call and operations.

What is CAML, and why would you use it?
CAML stands for Collaborative Application Markup Language. CAML is an XML based language which provides data constructs that build up the SharePoint fields, view, and is used for table definition during site provisioning. CAML is responsible for rending data and the resulting HTML that is output to the user in SharePoint. CAML can be used for a variety of circumstances, overall is used to query, build and customize SharePoint based sites. A general use would be building a CAML query in a SharePoint WebPart in order to retrieve values from a SharePoint list.

What is impersonation, and when would you use impersonation?
Impersonation can basically provide the functionality of executing something in the context of a different identity, for example assigning an account to users with anonymous access. You would use impersonation in order to access resources on behalf of the user with a different account, that normally, that wouldn’t be able to access or execute something.

What are WebPart properties, and what are some of the attributes you see when declaring WebPart properties in code?
WebPart properties are just like ASP.NET control properties, they are used to interact with and specify attributes that should be applied to a WebPart by a user. Some of the attributes you see with ASP.NET 2.0 properties are WebDescription, WebDisplayName, Category, Personalizable, and WebBrowsable. Although most of these properties come from the System.Web.UI.WebControls.WebParts class, ones like Category come out of System.ComponentModel namespace.

Why are properties important in WebPart development, and how have you exploited them in past development projects? What must each custom property have?
Properties are important because WebParts allow levels of personalization for each user. WebPart properties make it possible for a user to interact, adjust, and increase overall experience value with the programmatic assets that you develop without having the need to use an external editor or right any code. A very simple example of exploiting a property would be something like allowing the user to change the text on the WebPart design interface so that they can display whatever string of text they desire.
Each custom property that you have must have the appropriate get and set accessor methods.

What are ClassResources? How do you reference and deploy resources with an ASP.NET 2.0 WebPart?
ClassResources are used when inheriting from the SharePoint.WebPart.WebPartPages.WebPart base class, and are defined in the SharePoint solution file as things that should be stored in the wpresources directory on the server. It is a helpful directory to use in order to deploy custom images. In ASP.NET 2.0, typically things such as images are referenced by embedding them as resources within an assembly. The good part about ClassResources is they can help to eliminate recompiles to change small interface adjustments or alterations to external JavaScript files.

What is a SharePoint Solution File? How does it differ from WebPart .cab files in legacy development? What does it contain?
A SharePoint solution file is essentially a .cabinet file with all a developers ustom componets suffixed with a .wsp extension that aids in deployment. The big difference with SharePoint solution files is is that a solution:
allows deployment to all WFE’s in a farm
is highly manageable from the interface allowing deployment, retraction, and versioning
Can package all types of assets like site definitions, feature definitions (and associated components), Webparts, etc.
Can provide Code Access Security provisioning to avoid GAC deployments
And much more..

What is a .ddf file and what does it have to do with SharePoint Solution creation?
A .ddf file is a data directive file and is used when building the SharePoint solution bundle specifying the source files and their destination locations. The important thing for someone to understand is that the .ddf file will be passed as a parameter to the MAKECAB utility to orchestrate construction of the SharePoint solution file.

What file does a SharePoint solution package use to orchestrate (describe) its packaged contents?
The solution Manifest.XML file.

What deployment mechanism can you use to instigate Code Access Security attributes for your WebParts?
SharePoint solution files can add in order to handle code access security deployment issues. This is done in the element in the SharePoint solution manifest.XML, which makes it easier to get assemblies the appropriate permissions in order to operate in the bin directory of the web application.

What are event receivers?
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.

When would you use an event receiver?
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.

What base class do event receivers inherit from?
Event receivers either inherit from the SPListEventReciever base class or the SPItemEventReciever base class, both which derive from the abstract base class SPEventReceiverBase.

If I wanted to not allow people to delete documents from a document library, how would I go about it?
You would on the ItemDeleting event set: properties.Cancel= true.

What is the difference between an asynchronous and synchronous event receivers?
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