LightBlog

Thursday, 29 September 2016

DOT NET INTERVIEW QUESTIONS POSTED BY INTERVIEW CANDIDATES



ASP Interview Question


1. What is the Web.config file and what is it used for?

A web.config file is very important. It contains all the configurations about the database and even for some controls. A web.config file allows you to store information in a secure environment so that hackers have a tough time in getting at it and the servers divide the information easily. This a very nice way to keep your configuration separate from your program. So that when you program gets out, so that the configuration file that hackers use to get into your program does not get out. So, most people use the web.config file quite liberally and should.

2. What is the difference between OLEDB and ODBC?

OLEDB and ODBC are database connectivity questions on how do you connect to the database. ODBC is very old. It is open database connectivity and Microsoft came up with it so that you can connect with multiple databases using the same internal code so that if you wanted to switch say, Oracle to SQL server, you switch the database but you do not rewrite the code. It is very nice. But it only works with databases.
OLE DB works with all sorts of data sources, including databases. Most people say that ODBC is absorbed by OLEDB and everyone should be using OLEDB from now on. I think I agree with that one too. So, if you want to use fax information, phone information, email information, Voice Over IP information – all that is available in OLEDB. You can write routines that provide information to you. That is very important.

3. What is the use of Global.asax in your VB.net environment?

Global.asax if a file that controls a lot of the http handling, especially the session variables. If you want to use sessions, you pretty much have to use global.asax but do not worry. If you make a new project, the global.asax is thrown in there for you. You do not have to worry too much about it. 

4. Difference between Response.Redirect and Server.Transfer?

Response.redirect sends a message to the client machine saying that, hey you wanted to go my webpage but go to this webpage instead. This happen when you move a webpage. A server.transfer does not tell the client machine anything. It says that I know you wanted to go to my webpage, I am going to go to a server lever, grab information about webpage and give it to you – the client, without telling the client anything. So, many client machines does not want to use response.redirect. We do not want to be redirected when the server tells us to be redirected and so they immediately stops you from redirecting them wheras a server transfer allows you to redirect without actually allowing them to redirecting them, instead your URL will still appear in the client machine.
So, it actually depends. If you want to keep your URL and hide information from other machines, say, your site, then server.transfer works better. If you want to redirect the client to another webpage, then response.redirect is more appropriate. 

5. What are the difference between webforms and MVC?

Webforms came out first as an outgrowth of some of the classic ASP, the pre .net stuffs. They are very nicely used. They are very easy to use, easy to understand and easy to learn. MVC has a slightly larger learning curve but most people say that Microsoft came up with MVC to speed up development and webforms are someday going to die. Now, whether or not they are true is another story. Microsoft says it is not true but the webform is probably good to use if you already have a bunch of webforms developers already then there is no need to add new MVC products and they will not be able to work on your stuffs. On the other hand, if you have new development with new developers, you might consider MVC. The one thing you should keep note that Grids are better in webforms and MVC people might say that AJAX and Grids are fine in MVC. However, I would suggest MVC because this is where the cutting edge is and development is faster in MVC.
How Display first row in first table  record in gridview?
1.What is worker process?
2.What is Application pool?
3.What is session?
4.What is Rendering?
5.Page life cycle events?
ASP.net Page life cycle
what is the use of statemanagement and types*
What is difference between Session and Application object?
How many types Cookies we have?

Explain about ViewState and Quert String.
What is SQL Injection?
What is Cross Site Scripting?
What is data Annotations?
What is default request size of file upload?
What is the AntiForgeryToken?
Can you bind check box inside the dropdown list?
Repeater Control in Asp.net
what is dataset?
what is table?
10.crystal reports and types?
11.web.config file
12.diff b/w data table and dataset?
13.session,querystring,cookies how to declare in webpage?
14.what is viewstate?
How can you find out that an AJAX request has been completed?

.diff b/w server.transfer and response.redirect?
gridview insert,delete,update,select
validation controls

write a query to retrieve the data from table?

8)what is scripting
12w)hen we will go for check box and check box list cntrl
13)diff b/w html&xml
14i)mplement wizard cntrl for email registration
15)implementexternal navigation by using html cntrl inpage technique
1)what is sw application
2diff bw visual 
stdio.net and.net frame work
3)type casting

what is use of global.asax file 
. 11.what is the html tag used for displaying the moving content on the web browser.
.Security.
2)ADO.Net – Data Source , Data Set, Connection/ disconnected oriented ,Data Reader, SQL Data Adapter e.t.c.

suppose a website consists of 10 web pages and deployed .After few days , client asked us to remove the 10th web page.And after few days
he asked us to add same web page.Is it possible to retriew the deleted web page ? and solution for this ?
What is Cache in 
Asp.net? Is it client side or Server side?
What is bubble event
1.What is the Diff B/w Visual Studio 2010 and 2012?
How to update the master page variables from child page
why we use blocks in dotnet.
3-tier architecture, 
Masterpage example,
gridview customization with single Add button, 
Finally Crystal reports
Can we terminate the session ,if yes then how
diff between session and application
how to deploy website into iis
How to store user information without using session
diff b/w ExecuteReader,ExecuteScalar, ExecuteNonQuery
When to use ExecuteNonQuery()
What is authentication and authorization
23)How many types of authentication 
What is worker process
Explain application pool and web garden
Why inproc is not suitable for large web application
What is authentication/How many types of authentication
Explain about Caching
4.Gridview using checkbox?.
listbox and list.?
10.connection oriented,disconnection oriented.?
11.diiiference btw dataadapter and datareader?
12.query to create table,deletion of record.?
15)diff between session and view state
1)what is the model following by the Asp.Net WebPage for Execution?
a)Pipeline b)Top to Bottom c)Bottom to Top d)Waterfall
a table how to add a column??
6.difference between dataset and data reader
7.what is serialization
8.what is session and application object
9.view state
4.syntax for table creation in asp with an example
5.diff b/w hash table and dictionary
8. diff b/w fragment caching full page caching
11. diff b/w grid view and repeater control
3.what is cashing?
4.what is cookie and tell me types of cookies?
6.what is 
ado.net?
7.tell me about connected and disconnected approaches?
8.tell me about gridview property's?

2)What is Http Handler and Http Moduler in 
ASP.NET?
3)What Is Tracing?How it is enabled in 
ASP.NET?
8)What are namespaces needed data mechanisms in ASP.NET?
1.What is Sql Dirty Reader.?
2.whats is Xpath.?


Differences b/w visual studio 10 and visual studio 12.?
differences b/w 4.0 and 4.5..?
7)types in asp.net authentications?

Do you know reporting tool
Have you ever used reporting tool

C# Interview Question

Named parameters are an alternate parameter syntax. They sometimes result in easier to read and clearer code. They are checked for correctness by the compiler. By specifying the formal parameter name, we can reorder arguments.

Example. In Main, we use the syntax "name:" and then a string literal to specify the value of the name parameter. The syntax "size:" and then an integer signifies the size parameter. You can reorder these named parameters in any way you want.
Also:You can specify names on onlysome parameters,using the positional syntax for some arguments.
class Program
{
    static void Main()
    {
               // Call the Test method several times in different ways.
               Test(name: "Perl", size: 5);
               Test(name: "Dot", size: -1);
               Test(6, "Net");
               Test(7, name: "Google");
    }
 
    static void Test(int size, string name)
    {
               Console.WriteLine("Size = {0}, Name = {1}", size, name);
    }
}
Optional Parameters and Named Arguments



When a function has an optional parameter, the caller can decide whether to provide a value or not. (Providing a value for the parameter is optional.) If the caller doesn't provide a value, the function uses a default value.
by using Optional parameters: //In new way we will write the code as shown below
public static double MyNewCurrencyExchange(double amount, double rate=1) 
{ 
    return (amount * rate); 
}
MyNewCurrencyExchange (500, 1.18);  // ordinary call 
MyNewCurrencyExchange (500);  // omitting rate
Now, by using Named parameters:
MyNewCurrencyExchange (rate:1.18, amount:500); // reversing the order of arguments.
by using Named and Optional parameters:
MyNewCurrencyExchange (amount:500);

Classes:

Q.Can you Store Different Types In an Array
Yes. It Is Possible With Object Array. Since ALL Types Inherit(directly or Indirectly)  From Object Type . We Can Add any type to the Object Array, We Can Add Complex Types Like Customer, Employee etc. You need To Override The To String Method If You Want The Meaningful OutPut
What Is Jagged array?
A jagged array is an array of arrays
What is a class
Real time example for class and object
A class is a construct that enables you to create your own custom types by grouping together variables of other types, methods and events. A class is like a blueprint. It defines the data and behavior of a type.
What is a static class when we will go for static class?
Use a static class as a unit of organization for methods not associated with particular objects. Also, a static class can make your implementation simpler and faster because you do not have to create an object in order to call its methods. It is useful to organize the methods inside the class in a meaningful way, such as the methods of the Math class in the System namespace.
Encapsulation ?Encapsulation example
Encapsulation is an Object Oriented Programming concept that binds together the data and functions that manipulate the data, and that keeps both safe from outside interference and misuse. Data encapsulation led to the important OOP concept of data hiding.
Encapsulation is the packing of data and functions into a single component. The features of encapsulation are supported using classes in most object-oriented programming languages, although other alternatives also exist.
Memory allocation process.
What Is Object.?
In the class-based object-oriented programming paradigm, "object" refers to a particular instance of a class where the object can be a combination of variables, functions, and data structures
Where Will you Declare Obect.?

What is static variable?
In the C programming language, static is used with global variables and functions to set their scope to the containing file. In local variables, static is used to store the variable in the statically allocated memory instead of the automatically allocated memory

OOps

what is oops?
OOPs is an Object Oriented Programming language,which is the extension of Procedure Oriented Programming language.OOps reduce the code of the program because of the extensive feature of Polymorphism.OOps have many properties such as DataHiding,Inheritence,Data Absraction,Data Encapsulation and many more.
Oops Princples**
.What are the benefits of OOPS
why only one stastic constructor in a class
What are access modifiers,explain all access modifiers
OOPS all concepts (class,object,inheritance,polymorphism,encapsulation,abtrsct class,interface,Structures)
What will execute first static constructor or instance constructor?
What is constructor explain types of constructors?
24.What is constructor and structure explain?

3.What is function overloading?
4.What is Function Overriding?
Note: We can not Make Static Member as abstract,Virtual and Override
Shadowing (method hiding)

A method or function of the base class is available to the child (derived) class without the use of the "overriding" keyword. The compiler hides the function or method of the base class. This concept is known as shadowing or method hiding. In the shadowing or method hiding, the child (derived) class has its own version of the function, the same function is also available in the base class.

Example
1.   Public class BaseClass  
2.   {  
3.       public string GetMethodOwnerName()  
4.       {  
5.          return "Base Class";  
6.       }  
7.   }  
8.   public class ChildClass : BaseClass  
9.   {  
10.      public new string GetMethodOwnerName()  
11.      {  
12.         return "ChildClass";  
13.      }  
14.   
Shadowing
Overriding
Shadowing is a VB.Net concept. It also known as method hiding in C#. Using this concept we can provide a new implementation for the base class method without overriding it.
Overriding allows us to re-write a base class function with a different definition.
Using the “new” keyword we can do the shadowing or method hiding.
C# uses the virtual/abstract and override keyword for method overriding.
Shadowing redefines an entire method or function.
Overriding redefines only the implementation of a method or function.
Showing is used to protect against subsequent base class modification.
Overriding does polymorphism by defining a different implementation.
We can change the access modifier.
We cannot change the access modifier. The access modifier must be the same as in the base class method or function.
There is no control of a base class on shadowing. In other words, a base class element cannot enforce or stop shadowing.
The base class has some control over the overriding. Using the keyword abstract, the base class forces the child (derived) class to implement the function or method.
Shadowing an element (function method or property) can be inherited further in a child (derived) class. The shadowed element is still hidden.
The same as shadowing, overriding an element is inherited further in a derived class and the overridden element is still overridden.
In shadowing, the signature of an element could be different.
In overriding, the signature of the element must be the same.
In shadowing, the base class cannot access the newly created child (derived) class method. This is because the base class has the same name of the element.
In concept, the base class can be accessed using the child object's overridden method.

810.what is the difference between abstraction and encapsulation?
12.What is interface when we will go for it?
18.Difference between parsing and converting?
20.What is boxing and unboxing?
22.Can we change static variable value or is it fixed?
23.What is call by value,call by reference and call by out?
25.what is an exception and types explain?
16.Tell me about get and set property?
17.What are value types and referrence types explain with example?
1.Diff b/w Static method and Instance method with examples Q.Why Use Abstaract Class(KudaVenkat)
Notice That We Have Full Time Employee and Contract employee classes as standalone classes
Regarding these employee types  All The Employees in the organization have Id Name and Gender properties We also Computing Full Name This Means The above classes both have some Common columns and related functionality  instead of writing duplicate columns we are taking abstract class and method and both these classes are should inherit and should override the method otherwise it will get error
What is the Use of Interfaces?
Q.Why Would You Use Interfaces
Q. an Interface Doesn’t contain Implementation only Declaration. So what is the Benefit of using Interfaces
Advantages of Interface:
Interface allow us to develop loosely coupled system
Interface are very usefull for Dependency Injection
Interfaces makes unit testing and mock testing easier
An interface looks like a class, but has no implementation.
-The only thing it contains are declarations of
events, indexers, methods and/or properties.
-The reason interfaces only provide declarations is because they are
inherited by classes and structs, which must provide an implementation for each interface member declared.
Interfaces in C# are provided as a replacement of multiple inheritance.
-Because C# does not support multiple inheritance, it was necessary to incorporate some other method so that the class can inherit the behavior of more than one class, avoiding the problem of name
ambiguity that is found in C++.
-With name ambiguity, the object of a class does not know which method to call if the two base classes of that class object contain the same named method.
Purposes of Interfaces
-create loosely coupled software
-support design by contract (an implementor must provide the entire interface)
-allow for pluggable software
-allow different objects to interact easily
-hide implementation details of classes from each other
-facilitate reuse of software
Q.Difference between dll and exe files

Q. Is It Possible to Store number of list  of Different Types In a single Generic list
Yes It Possible By Using List OF List Objects
8Q. What Is Deligate.?
6)executing sqlcommand by using storedprocedure(sp)
1)diff b/w web.config & machine.config

what are enumerations? how that is achieved in C#.net?
5)System.String and System.StringBuilder classes ?
.
Exception Handling.
What is multiple inheritance?
What is the use of Private Costructor
What is the use of Abstract over Interface
1)What is Abstract class....
tell me one Example for Abstract class.

What is the difference between Constant,ReadOnly*
abstraction with example
overload,override
8.access modifiers
9.asemblies
1)What is Constructor?Is it contain return type?
. Property
Difference between for and switch
what is a interface,delegate,streambuilder.?
what is garbage collector
Diff between Constant and static
9)write a console program to print one dimensional array
10)when we will go for parameterized method with example
11)console program to define one class with two instance methods
12)imp of new keyword
15)advantages of static variables
16)what do you mean by application
17)scope of the access modifiers call by value call by reference

Default access modifiers of class and class members
3)Can we create static method in abstract class
4)What is multiple inheritance
5)What is early binding and late binding
6)Have you ever used deligate in your project
7)how to declare delegates write the syntax
8)What is interface, have you ever used interface in your project in your project
What is abstract class how to call static method of abstract class
What is copy and clone
1.what is boxing and unboxing?
2.partial class advantages
3.virtual declare a method or property
4.advantages of using system.text string builder over system.string
5.difference between clone() and copy()

what is partial class...
one example for partial class..
.what is main difference between generic class and normal class.
What is method overloading and overriding?
What is the difference between Static Polymorphism and Dynamic Ploymorphism with Proof*
How can you prevent a class from inheritance
1.Data hiding
2.Data binding 
3.encapsulation
4.if i have 4 methods in interface and i want to implement only two methods in my class how can i achieve? note: in b/w u can implement any thing?

6What is the difference between Inheritance and Abstract class.
why would we use interface over abstract class
What is collections?
what is strong name in dotnet.
what is GAC
tell about garbage collector..........etc

when we will go for "for loop" and while loop?
Can we override a method in dervied class without using virtual keyword in base class
.Exception Handling.
difference b/w string and string builder?
What is assembly?
Can you explain oops concept?
difference b/w abstract and polymorphism?*

Difference between constructor and Destructor?
Destructors are used to destruct instances of classes. A destructor is declared using the following
Identifier:The identifier is the same as the class name.
destructor-body:The block that contains the statements that destruct the instance of the class.

Remarks

Destructors cannot be used with structs. They are only used with classes.
A class can only have one destructor.
Destructors cannot be inherited or overloaded.
Destructors cannot be called. They are invoked automatically.
A destructor does not take modifiers or have parameters. For example, the following is a declaration of a destructor for the class  MyClass:
~ MyClass() 
{
   // Cleanup statements.
}
 


No comments:

Post a Comment

LightBlog