Sunday, 22 January 2017

Hi All,I wanted to share interview questions asked at FTD Hyderabad Interview for Dot Net developer experienced candidate.Please use the questions as reference and research the answers for self understandingThe questions are as follows

1. Introduce
yourself

2. In which
topics are you comfortable

C# OOPS :

1. Tell me
about Hash table vs Dictionary

2.What are
dey and which is faster

Dictionary is faster as it is strongly
typed

3. What is the difference

4. Boxing
and unboxing

5. Array and
array list are having same number of elements or Size which is faster and why
it is fast

Array will be faster in this case when
compared to ArrayList as the implementation of the arrayList in the internal
side is an array. As ArrayList will allow different datatypes to save it
requires boxing and unboxing which makes it slow.

Along with that ArrayList

4.Using key
usage why ?

5 Memory
leakage

https://msdn.microsoft.com/en-us/library/ms998530.aspx

Run a
profiler on your code.

Here are two
good options:

RedGate's
memory profiler

Jetbrains
dotTrace

Memory leaks
in .NET are not that common, but when they happen it is most commonly due to
unattached event handlers. Make sure you detach handlers, before the listeners
go out of scope.

Another
option is if you forget to call Dispose() on IDisposable resources. This may
prevent cleanup of unmanaged resources (which are not handled by GC).

6. Is Webservice
method overloading possible ? and How it
can be achieved ?

The function
overloading in Web Service is not as straightforward as in class. While trying
to overload member function, we make two or more methods with the same name
with different parameters. But this will not work in web services and will show
runtime error because WSDL is not supported by the same method name

The
procedure to solve this problem is very easy. Start each method with a Web
Method attribute. Add Description property to add a description of web method
and MessageName property to change web method name.

Each
computer where the common language runtime is installed has a machine-wide code
cache called the global assembly cache. The global assembly cache stores
assemblies specifically designated to be shared by several applications on the
computer.

Use a
developer tool called the Global Assembly Cache tool (Gacutil.exe), provided by
the Windows Software Development Kit (SDK).

Starting
with the .NET Framework 4, the default location for the global assembly cache
is %windir%\Microsoft.NET\assembly.

In earlier
versions of the .NET Framework, the default location is %windir%\assembly.

8. What is
presistent cookie

9. What are
cookies

10. What is
session management, how did you apply session management is your application

https://msdn.microsoft.com/en-us/library/z1hkazw7.aspx

Server side
session

4 types

Application state session

Session
state

Profile
properties

Database
support

Client side session

View state

Control state

Hidden fields

Cookies

Query strings

11. How can
session state is maintained in your application

12. What is
client side session and server side

13. What is
View bag and view data

Which is dynamic

viewBag.foo - dynamic

viewData["foo"]

14.
Similarities between ViewBag & ViewData , which is dynamic

Helps to
maintain data when you move from controller to view. Used to pass data from
controller to corresponding view. Short life means value becomes null when
redirection occurs. This is because their goal is to provide a way to
communicate between controllers and views. It’s a communication mechanism
within the server call.

Difference
between ViewBag & ViewData:

ViewData is
a dictionary of objects that is derived from ViewDataDictionary class and
accessible using strings as keys. ViewBag is a dynamic property that takes
advantage of the new dynamic features in C# 4.0. ViewData requires typecasting
for complex data type and check for null values to avoid error. ViewBag doesn’t
require typecasting for complex data type

LINQ query,
you always work with objects. The object may in-process object or out-process
object. Based on objects, LINQ query expression is translated and executed.
There are two ways of LINQ query execution

a . In case of differed execution,

a query is
not executed at the point of its declaration. It is executed when the Query
variable is iterated by using loop like as for, foreach.

DataContext
context = new DataContext();

var query =
from customer in context.Customers

where customer.City == "Delhi"

select customer; // Query does not execute
here

foreach (var Customer in query) // Query
executes here

{

Console.WriteLine(Customer.Name);

}

A LINQ query expression often causes deferred
execution. Deferred execution provides the facility of query reusability, since
it always fetches the updated data from the data source which exists at the
time of each execution.

b. Immediate
Execution

In case of
immediate execution, a query is executed at the point of its declaration. The
query which returns a singleton value (a single value or a set of values) like
Average, Sum, Count, List etc. caused Immediate Execution.

You can
force a query to execute immediately of by calling ToList, ToArray methods.

DataContext
context = new DataContext();

var query =
(from customer in context.Customers

where customer.City == "Delhi"

select customer).Count(); // Query execute
here

Immediate
execution doesn't provide the facility of query re-usability since it always
contains the same data which is fetched at the time of query declaration

22. What is
routing .and Uses

APP_sTART RouteConfig. RegisterRoutes in RouteConfig cls.

route =
{controller}/{action}/{id. optional}

WebApi.RouteConfig

api/{controller}/{action}/{id}

23. Can we
pass data from one controller to other controller

24. What are
'Action Filters'

Using an
Action Filter

An action
filter is an attribute. You can apply most action filters to either an
individual controller action or an entire controller.

An action
filter is an attribute that you can apply to a controller action -- or an
entire controller -- that modifies the way in which the action is executed. The
ASP.NET MVC framework includes several action filters:

OutputCache
– This action filter caches the output of a controller action for a specified
amount of time.

Authorize –
This action filter enables you to restrict access to a particular user or role

For example,
the Data controller in Listing 1 exposes an action named Index() that returns
the current time. This action is decorated with the OutputCache action filter.
This filter causes the value returned by the action to be cached for 10
seconds.

Hi All,I wanted to share interview questions asked at Bank of America Interview for Dot Net developer experienced candidate.Please use the questions as reference and research the answers for self understandingThe questions are as followsAsp.net

1. How do you show diff master pages to 2 roles , admin and
normal user.

2. If I miss mentioning master page will I get error , when
I will get error

Is compile time error

3.Can two text box have same name in same page under 2
different controls

How will you access the values

4. How to catch exception without try catch

Is it possible

5. One page with multiple text box server side pare. How
will you iterate REPEATER

and check given text in text Box

6. How will you get values from a text box and assign.

7.Validate a page using javascript

Text box text in click of button.

8.What are generics.

What is list

SQL :

9.Table with one column as dates

how to get the date diff of 12 23 34 rows etc as result
table

Answer hint :

[use self join on
table and second table with first row missing]

T1 T2

1 | 2

2 |3

3 | 4

10.How to call sp in a function

Answer hint :It's not possible. but you can call a function
from Stored proceure