How will you programmatically read the identity of the impersonated user ?

Wednesday, August 5, 2009


VB
==
Dim curUser As String = _
System.Security.Principal.WindowsIdentity.GetCurrent().Name

C#
==
String curUser =
System.Security.Principal.WindowsIdentity.GetCurrent().Name;


www.codecollege.NET

Which class is doing the URL authorization ?


UrlAuthorizationModule.


www.codecollege.NET

Which class is doing the File authorization ?


FileAuthorizationModule.


www.codecollege.NET

What is URL authorization in ASP.NET ?


It is an authorization which maps users and roles to URLs in ASP.NET applications.


www.codecollege.NET

What is File authorization in ASP.NET ?


It is an Authorization which checks the access control list (ACL) of the .aspx or .asmx handler file to determine whether a user has access to the file.


www.codecollege.NET

What are the Types of Authorization ?


There are two types of Authorizations, they are:
1. File authorization
2. URL authorization


www.codecollege.NET

When will you go for DataReader and when for DataAdapter ?


You can go for DataReader when you want to only display the data.
You can go for DataAdapte when you want to display ,edit and update the data.


www.codecollege.NET

What are the differences between DataReader and DataAdapter ?




























Sno DataReader
DataAdapter
1 Works in Connected Mode Works in Disconnected Mode
2 Can have only one record at a time Can have more than 1 records.
3 Is ForwardOnly and Readonly Can navigate front and back and editable
4 Faster Slower





www.codecollege.NET

Daily Tips- Tip #25 - How will you Regenerate Expired Session Identifiers in ASP.NET ?



To Regenerate Expired Session Identifiers in ASP.NET, set the regenerateExpiredSessionId attribute of the sessionState configuration element to true.




www.codecollege.NET

How will you communicate between 2 user controls in ASP.NET ?



You can communicate between 2 user controls in ASP.NET, by using Properties and Methods defined inside them and by calling the usercontrol using FindControl() method along with the respective property.




www.codecollege.NET

CapGemini ASP.NET, SHAREPOINT, MOSS 2007 Interview Questions Set 2



1. What are the Session State Mechanisms in asp.net
2. What are the different types of Caching
3. What are the differences between Caching and Application
4. What areas have you worked with MOSS 2007
5. What are the objects in Classic ASP
6. How will you communicate between 2 user controls
7. How will you achive fragment caching and pageoutput caching
8. whats the difference between datareader and dataadapter
9. when will you go for datareader and when to dataadapter
10. Does cache supports Application Events
11. What are the different types of Authentications in ASP.NET?
12. What are the different types of Authorization in ASP.NET ?
13. What are the various Expiration methods in Cache ?


www.codecollege.NET

How are Sessions identified in ASP.NET ?



Sessions are identified by a unique identifier that can be read by using the SessionID property.




www.codecollege.NET

What type of object can you store in OutProc mode of sessions ?


The session-variable type must be either a primitive .NET type or serializable..



www.codecollege.NET

What type of object can you store in InProc mode of sessions ?


can be any valid .NET Framework type.



www.codecollege.NET

Can I share session state between ASP.NET and ASP pages?


Yes.



www.codecollege.NET

Does all ASP.NET Web server controls have a Render method ?


Yes.



www.codecollege.NET

Is Render an Event ?


No, its a Method.



www.codecollege.NET

When is the ViewState information saved for the page and for all controls in ASP.NET Page Life Cycle?


Before the SaveStateComplete Event and after the PreRender Event.



www.codecollege.NET

Does the PreRender Event occur for every control on the ASP.NET Page ?


Yes.



www.codecollege.NET

When is the Viewstate information loaded in the Page Life Cycle of an Asp.NET page ?


After the InitComplete event and before the PreLoad Event ASP.NET Page loads view state for itself and all controls, and then processes any postback data.



www.codecollege.NET

How can we Create a Strongly-Typed Reference with the Master Page ?


You can can we Create a Strongly-Typed Reference with the Master Page using the ,
@MasterType Directive .



www.codecollege.NET

How will you get an instance of the Master Page used in your current page ?


You can get an instance of the Master Page used in your current page using the property,
Page.Master .



www.codecollege.NET

How will you read the Master Pages content from the Content Page ?


You canread the Master Pages content from the Content Page by creating Public Properties and Methods in the masterpage.



www.codecollege.NET

What is the use of the Init Event ?


Use this event to read or initialize control properties.



www.codecollege.NET

What is the use of the PreInit Event ?


You can use the PreInit event for the following ,

1. Check the IsPostBack property to determine whether this is the first time the page is being processed.

2. Create or re-create dynamic controls.

3. Set a master page dynamically.

4. Set the Theme property dynamically.



www.codecollege.NET

Skelda ASP.NET, Sharepoint, SQL server interview questions



1. What is a masterpage
2. how will you get a value from a master page to the content page
3. what are the differences between UDF and SP
4. Is an UDF Precompiled
5. Explain the Page life cycle
6. what is inetinfo
7. what is aspnet_Wp.exe
8. what is ISAPI filter
9. what is the flow of the control for a page request
10. how you gave anonymous access for a sharepoint site
11. what privileges you gave for anonymous access of a sharepoint site
12. Is there any event called PreInit
13. When is the viewstate information loaded in a page
14. Have you done performance tuning in sql server
15. what does the "Run with privelege" meanin sharepoint?
16. What are the steps for deploying a webpart
17. What is an Bubbled Event ?
18. How will you fire an Event when mouse is moved over a button ?


www.codecollege.NET

What is Aggregation ?




Aggregation is a form of composition where one looks at the system as a whole rather than as parts.


www.codecollege.NET

What is Composition ?




Composition is a way to combine simple objects or data types into more complex ones.


www.codecollege.NET

What is Association ?



Association defines a relationship between classes of objects which allows one object to cause another to perform an action on its behalf.


www.codecollege.NET

What is Polymorphism ?



A feature using which more than one definition is given to a single method or operator.


www.codecollege.NET

What is Encapsulation ?



It is a feature which hides data and functions from others classes.


www.codecollege.NET

What is Hybrid Inheritance ?



A class inherits from more than one type of Inheritances mentioned above.
Ex:
It inherits from multiple and also multilevel


www.codecollege.NET

What is Multilevel Inheritance ?



classes inherits from parent classes in multiple level, ie Child inherits from Parent and grandchild classes inherit from Child , like that.


www.codecollege.NET

What is Multiple Inheritance ?



A class inherits from more than 1 class.


www.codecollege.NET

What is a Single Inheritance ?



A class inherits from a single class.


www.codecollege.NET

What are the major Types of Inheritance ?



The major Types are:
Single
Multiple
Multilevel
Hybrid


www.codecollege.NET

What is Inheritance ?

A feature in which the base class’s characteristics and behavior are derived to the child class also.

What is an Object ?



Is an instance of a class. It will be exactly the same as a class but can be assigned values and used whereas a class can’t be used without creating objects.


www.codecollege.NET

What is a Class ?


Class:
It defines characteristics of a thing and its behavior. It is blueprint based on which objects are created.
Example: Employee (which will have all the details about the employee like name, id, salary, etc and the methods which describes his behavior like calcSalary(),displaydetails(),etc.


www.codecollege.NET

What is a Concurrency Design Patterns ? Give Examples.


They deal with multi-threaded programs. They provide solutions for multi-thread design problems.
Example:
Balking, Double checked locking, guarded suspension


www.codecollege.NET

What is a Behavioral Design Pattern ? Give Examples.


Behavioral
They deal with communication between objects. They provide you the best way to communicate between objects.
Example:
Chain of responsibility, Command, Interpreter


www.codecollege.NET

What is a Structural Design Pattern ? Give Examples.


Structural
They deal with relationship between entities. They provide you the best way to relate entities on various scenarios.
Example:
Adapter, Aggregate, Bridge


www.codecollege.NET

What is a Creational Design Pattern ? Give Examples.


They deal with object creation. They provide you the best way to create objects based on the current situation.
Example:
Singleton, Factory method, Abstract factory, Builder


www.codecollege.NET

What are the Types of Design Patterns ?


The Main Types of Design Patterns are:
Design Patterns are generally classified into three categories, they are:
1. Creational
2. Structural
3. Behavioral


www.codecollege.NET

What are the 3 important object oriented concepts ?


1. Polymorphism
2. Inheritance
3. Encapsulation


www.codecollege.NET

Is non-clustered index faster than clustered index ?


Yes.


www.codecollege.NET

What is the smallest unit of execution in .NET ?


An Assembly.


www.codecollege.NET

What does the Initial Catalog parameter denote in the connection string ?


The name of the database to be connected.


www.codecollege.NET

Among Windows Authentication and SQL Server Authentication, which one is the most trusted ?


Windows Authentication as the checking is done with the Active Directory.


www.codecollege.NET

How will you debug an ASP.NET Web application ?


By attaching the aspnet_wp.exe process to the DbgClr debugger.


www.codecollege.NET

How will you generate documentation from the C# file using a command-line compiler ?


If the file is commented properly , Compiling it with the /doc switch will generate the documentation.


www.codecollege.NET

What are the different ways a method can be overloaded ?


1. With different number of arguments
2. With different datatypes of arguments
3. With different order of arguments


www.codecollege.NET

Can you declare an overriden method to be static if the original method is not static ?


No.


www.codecollege.NET

What’s the implicit name of the parameter that gets passed into the set method/property of a class?


Value.


www.codecollege.NET

How will specify BULK Insert to fire triggers ?


You can specify BULK Insert to fire triggers by "FIRE_TRIGGERS" option.


www.codecollege.NET

Will by default BULK Insert fire Insert Triggers ?


No.


www.codecollege.NET

Can a method alone be sealed ?


Yes.


www.codecollege.NET

How will you prevent your class being inherited by another class ?


Make that class as Sealed.


www.codecollege.NET

Will the finally block get executed if an exception has not occurred ?


Yes.


www.codecollege.NET

What is an INSTEAD OF trigger ?


It is a trigger which is executed "INSTEAD OF" a TSQL statement. The main use of it is it enables views to support updates which are not updatable otherwise.


www.codecollege.NET

What is referential integrity ?


Referential integrity in a relational database concept where consistency is established through Primary key and Foreign key relationship.


www.codecollege.NET

What is a self join ?


It is a join which joins the table to itself.


www.codecollege.NET

What are the Differences between Response.Expires and Expires.Absolute ?


Expires:
The Expires property specifies the duration of time before a page that is cached on a browser expires.
ExpiresAbsolute:
The ExpiresAbsolute property specifies the date and time at which a page cached on a browser expires.


www.codecollege.NET

What is an Ad Hoc Query ?


It is a dynamically query generated by some query generation tools.


www.codecollege.NET

What are the contents of assembly?


A static assembly will generally contain,
1. The assembly manifest.
2. Type metadata.
3. MSIL code .
4. A set of resources.


www.codecollege.NET

What is role based security?


Role based Security is a feature using which access to data and resources will be given based on the roles the authenticated user has.


www.codecollege.NET

What is the use of the fixed statement in C# ?


It prevents the garbage collector from relocating a movable variable and is permitted on unsafe context.


www.codecollege.NET

What is BCL ?


The Base Class Library (BCL) is a standard library which is common to all languages using the .NET Framework.


www.codecollege.NET

What is an app.config ?


It is the Configuration file for Windows applications , simillar to Web.config is for Web Applications.


www.codecollege.NET

Daily Tips- Tip #24 - How will you set the Execution Timeout for a browser ?


The following code will set the executionTimeout as 40 mins,

<httpRuntime executionTimeout="00:40:00" />


www.codecollege.NET

How will you make a process wait ?


The following code will make the process wait for 10 seconds.
System.Threading.Thread.Sleep(1000);



www.codecollege.NET

Can "#Region #End Region " be created inside methods ?


No. Region can enclose methods and events , but they cant be created inside methods and events.


www.codecollege.NET

Name some of Code Analysis Tools ?


1. FxCop
2. StyleCop
3. NDepend
4. SourceMonitor


www.codecollege.NET

Daily Tips- Tip #26 - How will you analyze and improve the behaviour of your managed applications ?


You can analyze and improve the behaviour of your managed applications using the CLR Profiler tool.


www.codecollege.NET

Daily Tips- Tip #25 - How will you compare two versions of an assembly ?


You can compare two versions of an assembly, and determine the differences using the LibCheck tool.


www.codecollege.NET

Daily Tips- Tip #24 - How will you merge .NET Assemblies (without Aspnet_merge.exe) ? (or) What is ILMerge ?


You can merge multiple .NET assemblies into a single .NET assembly using the ILMerge utility . It works in the same way with both .exes and .dlls.


www.codecollege.NET

Daily Tips- Tip #23 - How will you merge Assemblies created by Aspnet_compiler.exe ?


The ASP.NET Merge tool (Aspnet_merge.exe) enables you to combine and manage assemblies which are created by Aspnet_compiler.exe. It works on assemblies that have been created by using ASP.NET version 2.0 or later.


www.codecollege.NET

What is an Immutable Class ? , give an example.


The object of the Class whose memory is changed upon change in the content is a Mutable Class.
Ex:
String


www.codecollege.NET

What is a Mutable Class ? , give an example.


The object of the Class whose memory is not changed upon change in the content is a Mutable Class.
Ex:
StringBuilder


www.codecollege.NET

Can you edit data in the Repeater control?


No.


www.codecollege.NET

Which two properties are on every validation control?


1. Controltovalidate
2. ErrorMessage



www.codecollege.NET

Can an Interface have a static method ?


No.


www.codecollege.NET

What are the DataConnections supported by MOSS 2007 Report Center?


The DataConnections supported by MOSS 2007 Report Center are :
1. Office Data Connection files (ODC)
2. Universal Data Connection files (UDC)
3. Reporting Services Data Sources (RSDS)


www.codecollege.NET

LinkWithin

Blog Widget by LinkWithin

Recommended Books