Category: Uncategorized

Interview Questions

1        .NET Specific

1.1       .NET 1-5 Rating Questions

What are Properties in C#, what are its advantages? Explain the 3 types of properties in C#? http://venkatcsharpinterview.blogspot.com/2009/03/c-interview-questions-on-properties.html
What is a virtual property. Give an example? http://venkatcsharpinterview.blogspot.com/2009/03/c-interview-questions-on-properties.html
What is an abstract property. Give an example? http://venkatcsharpinterview.blogspot.com/2009/03/c-interview-questions-on-properties.html
What is diff between const and read only?
What are the differences between value types and reference types? http://venkatcsharpinterview.blogspot.com/2009/01/c-interview-questions-on-value-types.html
What is Boxing and Unboxing? http://venkatcsharpinterview.blogspot.com/2009/01/c-interview-questions-on-boxing-and.html
What is the difference between string keyword and System.String class? http://venkatcsharpinterview.blogspot.com/2009/01/basic-c-interview-questions-on-strings.html
Are string objects mutable or immutable? Why is it immutable ? http://venkatcsharpinterview.blogspot.com/2009/01/basic-c-interview-questions-on-strings.html
Difference between string and StringBuilder in c#
Collection and Generics
What are Advantages and disadvantages of using generics? http://venkatcsharpinterview.blogspot.com/2009/01/c-interview-questions.html
What is Collection?

·        What collection to use when you need a sequential list where the element is typically discarded after its value is retrieved?

·        If need random access to Items?

·        If Need access to elements by Key?

what is jagged array in C#?
What’s the difference between IEnumerable and List ? http://venkatcsharpinterview.blogspot.com/2009/01/c-interview-questions.html
What’s the difference between IEnumerable and IQueryable ? http://www.dotnetfunda.com/interviews/cat/110/linq
What is LINQ? What is the benefit on using LINQ over Dataset ? http://www.dotnetfunda.com/interviews/show/3815/what-is-the-benefit-of-using-linq-on-dataset

1.2       .NET 5-10 Rating Questions

Difference between EXE and DLL http://venkatcsharpinterview.blogspot.com/2009/01/c-interview-questions.html
What is DLL HELL in .NET http://venkataspinterview.blogspot.com/2011/05/what-is-dll-hell-in-net.html
Delegates and Events
What is a delegate? What is the main use of delegates in C#? http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-on-delegates.html
What do you mean by chaining delegates?

Or

What is a multicast delegate?

http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-on-delegates.html
What are different Type of Delegates in C# ?
Remoting
What is .NET Remoting? What are the 2 message encoding formats supported by .NET Remoting and when do you choose one over the other? What are the 2 message encoding formats supported by .NET Remoting and when do you choose one over the other? http://venkatcsharpinterview.blogspot.com/2010/04/remoting-interview-questions.html
If a method’s return type is void, can you use a return keyword in the method? http://venkatcsharpinterview.blogspot.com/2009/07/c-interview-questions-on-methods.html
Threading
What is the difference between Threads and Tasks? http://dotnetpattern.com/multi-threading-interview-questions
What are Concurrent Collection Classes? http://dotnetpattern.com/multi-threading-interview-questions

2        Object Oriented Programming

2.1       OOP 1-5 Rating Questions

What are Constructors? Can a class or a struct have multiple constructors? http://venkatcsharpinterview.blogspot.com/2009/07/c-interview-questions-on-constructors.html
Can a child class call the constructor of a base class? http://venkatcsharpinterview.blogspot.com/2009/07/c-interview-questions-on-constructors.html
Explain the difference between passing parameters by value and passing parameters by reference http://venkatcsharpinterview.blogspot.com/2009/07/c-interview-questions-on-methods.html
What is the main advantage of using inheritance? http://venkatcsharpinterview.blogspot.com/2009/02/c-interview-questions-on-inheritance.html
What is Polymorphism and Inheritance?
When can a derived class override a base class member? http://venkatcsharpinterview.blogspot.com/2009/02/c-interview-questions-on-polymorphism.html
What is the difference between a virtual method and an abstract method? http://venkatcsharpinterview.blogspot.com/2009/02/c-interview-questions-on-polymorphism.html
What is interface? Can an Interface contain fields? http://venkatcsharpinterview.blogspot.com/2009/07/c-interview-questions-related-to.html
What is the difference between function Overloading and Over Riding? http://venkatcsharpinterview.blogspot.com/2009/02/c-interview-questions-on-access.html
What are different type of Access Modifiers in C#? https://stackoverflow.com/questions/614818/what-is-the-difference-between-public-private-protected-and-nothing
What is a sealed class? http://venkatcsharpinterview.blogspot.com/2009/02/c-interview-questions-on-abstract-and.html
Can derived classes have greater accessibility than their base types?
What are the difference between interfaces and abstract classes http://venkatcsharpinterview.blogspot.com/2009/01/c-interview-questions.html
Does C# support multiple class inheritance? Why C# does not support multiple class inheritance? (Diamond Problem) http://venkatcsharpinterview.blogspot.com/2009/01/c-interview-questions.html
What are Advantages of using Interfaces http://venkatcsharpinterview.blogspot.com/2009/01/c-interview-questions.html

2.2       OOP 5-10 Rating Questions

What are the difference between interfaces and abstract classes http://venkatcsharpinterview.blogspot.com/2009/01/c-interview-questions.html
What is a partial class. What are the advantages of using partial classes? Is it possible to create partial structs, interfaces and methods? Can different parts of a partial class inherit from different interfaces? http://venkatcsharpinterview.blogspot.com/2009/07/c-interview-questions-on-partial.html
Can a class have static constructor? Can you have parameters for static constructors? http://venkatcsharpinterview.blogspot.com/2009/07/c-interview-questions-on-constructors.html
Can you pass value types by reference to a method? http://venkatcsharpinterview.blogspot.com/2009/07/c-interview-questions-on-methods.html
Design Patterns And Principles
What is SOLID Principle ? What is Single Responsibility Principle? http://www.c-sharpcorner.com/UploadFile/damubetha/solid-principles-in-C-Sharp/
What different Types of Design Patterns in C# ? What purpose they are used ? http://www.dotnettricks.com/learn/designpatterns/gang-of-four-gof-design-patterns-in-net
What is Singleton Pattern? Why is it used? http://www.dotnettricks.com/learn/designpatterns/gang-of-four-gof-design-patterns-in-net
What is Factory Pattern  ? Why is it used? http://www.dotnettricks.com/learn/designpatterns/gang-of-four-gof-design-patterns-in-net
What is Bridge Pattern ? Why is it used? http://www.dotnettricks.com/learn/designpatterns/gang-of-four-gof-design-patterns-in-net
What is Adapter Pattern ? Why is it used? http://www.dotnettricks.com/learn/designpatterns/gang-of-four-gof-design-patterns-in-net
What is Strategy Pattern? Why is it Used? http://www.dotnettricks.com/learn/designpatterns/gang-of-four-gof-design-patterns-in-net
What is Observer Patter? Why is it Used http://www.dotnettricks.com/learn/designpatterns/gang-of-four-gof-design-patterns-in-net

3        Database

3.1       OOP 1-5 Rating Questions

What is the difference between Having and Where clause http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html
What is the difference between Drop, Delete and Truncate statements in SQL Server? http://venkatsqlinterview.blogspot.com/2011/05/basic-sql-server-interview-questions.html
DIfference between primary key and unique key in SQL Server? http://venkatsqlinterview.blogspot.com/2011/05/basic-sql-server-interview-questions.html
What is Cascading referential integrity constraint? http://venkatsqlinterview.blogspot.com/2011/05/basic-sql-server-interview-questions.html
What is the use of an Index in SQL Server? https://stackoverflow.com/questions/91688/what-are-the-differences-between-a-clustered-and-a-non-clustered-index
What are the 2 types of Indexes in SQL Server? https://stackoverflow.com/questions/91688/what-are-the-differences-between-a-clustered-and-a-non-clustered-index
What is a Trigger in SQL Server? http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-on_10.html
What is the difference between inner join,left outter join and right outer join?
Write the Query to get the Second Largest value in the Table ?

3.2       OOP 5-10 Rating Questions

What are the 2 types of Temporary Tables in SQL Server? http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-on_2213.html
What is the difference between Local and Global Temporary Tables? http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-on_2213.html
In which database, the temporary tables get created? http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-on_2213.html
What you  will do if the query below is performing very slow? http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-on.html

https://dzone.com/articles/6-simple-performance-tips-sql

What are Partition Tables? And when to use them ?
What is the difference between a Temporary Table and a Table Variable? http://venkatsqlinterview.blogspot.com/2011/05/what-is-difference-between-temporary.html
What is the difference between a User Defined Function (UDF) and a Stored Procedure (SP) in SQL Server http://venkatsqlinterview.blogspot.com/2011/05/what-is-difference-between-user-defined.html

4        Web

ASP.NET Page is very slow. What will you do to make it fast http://venkataspinterview.blogspot.com/2011/09/aspnet-page-is-very-slow-what-will-you.html
What is page lifecycle of ASP.NET https://www.tutorialspoint.com/asp.net/asp.net_life_cycle.htm
what is veiwstate? Difference between EnableViewState and ViewStateMode properties? http://venkataspinterview.blogspot.com/2011/12/difference-between-enableviewstate-and.html
What is the difference between layers and tiers. Advantages ? http://venkataspinterview.blogspot.com/2011/03/what-are-advantages-and-disadvantages.html
What are the different Session state management options available in ASP.NET? http://www.c-sharpcorner.com/UploadFile/8ef97c/Asp-Net-interview-questions-and-answers/
What is caching in ASP.NET http://www.c-sharpcorner.com/UploadFile/8ef97c/Asp-Net-interview-questions-and-answers/
What is MVC?
What are Cookies in ASP.NET? What are different types of Cookies? http://www.c-sharpcorner.com/UploadFile/8ef97c/Asp-Net-interview-questions-and-answers/

http://venkataspinterview.blogspot.com/2008/07/aspnet-interview-questions-on-cookies.html

What is Query String in ASP? http://www.c-sharpcorner.com/UploadFile/8ef97c/Asp-Net-interview-questions-and-answers/
What are different page navigation techniques in ASP.NET? http://venkataspinterview.blogspot.com/2008/07/interview-questions-on-aspnet-page.html

5        Desktop

What is a DataSet? Can you enforce constarints and relations on tables inside a DataSet? http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-dataset.html
What is the difference between DataSet.Copy() and DataSet.Clone()? http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-dataset.html

6        SharePoint

Advertisements

On Form Load Check the User Team and Lock the form the if the owner of the record team doesn’t matches with Logged in user.

Following code will help you in the following:

  • getting the team names in the system
  • getting the team associated with the user.
  • validating the action if the team name doesn’t match

On Load Function that calls the getCurrentUserTeamNames

function Form_OnLoad_ValidateUserTeam() {
    var userTeams = getCurrentUserTeamNames();
    if (userTeams != null && userTeams.length > 0) {
        if (!isValidateFormAccess(userTeams)) {
            DisableFormFields();
        }
    }
}

function isValidateFormAccess(userTeams) {
    debugger;
    var recordOwner = Xrm.Page.getControl("header_ownerid").getAttribute().getValue();
 
    //var myStringArray = ["Hello", "World"];
    var userTeamsLength = userTeams.length;
    for (var i = 0; i < userTeamsLength; i++) {
        if (userTeams[i] == recordOwner[0].name) {
            return true;
        }   //Do something
    }
    return false;
}

GetCurrentUserTeamNames: this function will return the team names of the user

function getCurrentUserTeamNames() {
    debugger;
    //ajax call to get data from CRM
    var serverUrl = location.protocol + "//" + location.host + "/" + Xrm.Page.context.getOrgUniqueName();
    var odataSelect = serverUrl + "/XRMServices/2011/OrganizationData.svc" + "/" + "TeamSet?$select=Name,TeamId";
    var userTeams = [];
    $.ajax
    (
     {
         type: "GET",
         contentType: "application/json; charset=utf-8",
         datatype: "json",
         async: false,
         url: odataSelect,
         beforeSend: function (XMLHttpRequest) { XMLHttpRequest.setRequestHeader("Accept", "application/json"); },
         success: function (data, textStatus, XmlHttpRequest) {
             for (var i = 0; i < data.d.results.length; i++) {                  if (Check(data.d.results[i].TeamId)) {                      //alert("You are associated with team: " + data.d.results[i].Name);                        userTeams.push(data.d.results[i].Name);                  }              }              },            error: function (XmlHttpRequest, textStatus, errorThrown) {              if (XmlHttpRequest && XmlHttpRequest.responseText) {                  alert('OData Select Failed: ' + textStatus + errorThrown + odataSelect);              }          }      }     );       return userTeams; }       function Check(teamid) {       var userId = Xrm.Page.context.getUserId(); //Fetching user Id of current logged in user     var serverUrl = location.protocol + "//" + location.host + "/" + Xrm.Page.context.getOrgUniqueName();     var odataSelect = serverUrl + "/XRMServices/2011/OrganizationData.svc" + "/" + "TeamMembershipSet?$filter=SystemUserId eq guid'" + userId + "' and TeamId eq guid'" + teamid + "'";     var boolFlag = false;     $.ajax     (      {          type: "GET",          contentType: "application/json; charset=utf-8",          datatype: "json",            async: false,          url: odataSelect,            beforeSend: function (XMLHttpRequest) { XMLHttpRequest.setRequestHeader("Accept", "application/json"); },          success: function (data, textStatus, XmlHttpRequest) {              if (data.d.results.length > 0) {
                 //alert(data.d.results[0].TeamId);
                 boolFlag = true;
             }
         },
 
         error: function (XmlHttpRequest, textStatus, errorThrown) {
             if (XmlHttpRequest && XmlHttpRequest.responseText) {
                 alert('OData Select Failed: ' + textStatus + errorThrown + odataSelect);
             }
         }
     }
    );
 
    return boolFlag;
    //return false; //Returing false if the user is not associated with the team
}
 
 
 
function DisableFormFields() {
    disableAttrs();
    RefreshGrids();
}
 
 
 
function RefreshGrids() {
 
    var opportunitySubgrids = Xrm.Page.getControl(function (ctrl, i) {
        if (ctrl.getControlType() == "subgrid") {
            return (ctrl);
        }
        else {
            return false;
        }
    });
 
    opportunitySubgrids.forEach(function (attribute, index) {
        var control = Xrm.Page.getControl(attribute.getName());
        if (control) {
            control.refresh();
        }
    });
 
 
 
}
 
function disableAttrs() {
    debugger;
    Xrm.Page.data.entity.attributes.forEach(function (attribute, index) {
        var control = Xrm.Page.getControl(attribute.getName());
        if (control && (control.getName() != "processid" && control.getName() != "stageid")) {
            control.setDisabled(true);
 
            //notification();
 
        }
    });
    Xrm.Page.ui.setFormNotification("The Form is Locked", "INFORMATION")
}
 
function tabdisable(tabname, disablestatus) {
    var tab = Xrm.Page.ui.tabs.get(tabname);
    if (tab == null) alert("Error: The tab: " + tabname + " is not on the form");
    else {
        var tabsections = tab.sections.get();
        for (var i in tabsections) {
            var secname = tabsections[i].getName();
            sectiondisable(secname, disablestatus);
        }
    }
}   // tabdisable
function sectiondisable(sectionname, disablestatus) {
    var ctrlName = Xrm.Page.ui.controls.get();
    for (var i in ctrlName) {
        var ctrl = ctrlName[i];
        var ctrlSection = ctrl.getParent().getName();
        if (ctrlSection == sectionname) {
            ctrl.setDisabled(disablestatus);
        }
    }
}  // sectiondisable

Please Feel Free to contact me if anyone face issues. The current Code requires that

Jquery and Json must be included in the form