Friday, January 7, 2011

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.

No comments: