اسئلة المقابلة الكتابية او الامتحان الكتابي المتوقع في المقابلات او بعدها asp.net interview questions
وننوة علي الاتي
1- هذه اسئلة متوقعة مختارة بعناية ولبس بالضرورة تأتي كلها في موضوع asp.net interview questions
2- هذه اسئلة مقابلة تاتي في صورة كتابية مع المقابلة او بعدها او ربما لن يكون هناك امتحان نظري ..فالموضوع كله في يد صاحب العمل
3-عند وجود احد هذه الاسئلة او غيرها حاول ان تبدع في الكتابة النظرية المعتمدة علي الخبرة العملية التي في الفيديوهات في موقعنا
Namespaces are logical groupings of names used within a program.
List the types of Authentication supported by ASP.NET.
- Windows (default)
- None (Security disabled)
· What is CLR?
Common Language Runtime (CLR) is a run-time environment that manages the execution of .NET code and provides services like memory management, debugging, security, etc. The CLR is also known as Virtual Execution System (VES).
Explain Assembly and Manifest.
An assembly is a collection of one or more files and one of them (DLL or EXE), The manifest is stored as binary data and contains details like version , the author, security permissions .
Explain Web Services.
Web services are programmable business logic components that provide access to functionality through the Internet. Web services are based on the Simple Object Access Protocol (SOAP), which is an application of XML. Web services are given the .asmx extension.
Explain the differences between server-side and client-side code?
Server side scripting means that all the script will be executed by the server, Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc.
Describe the difference between inline and code behind.
Inline code is written along side the HTML in a page. Code-behind is code written in a separate file and referenced by the .aspx page.
What is an interface and what is an abstract class?
In an interface, all methods must be abstract (must not be defined). In an abstract class, some methods can be defined. In an interface, no accessibility modifiers are allowed, whereas it is allowed in abstract classes.
Is it possible to see the code that ASP.NET generates from an ASPX file?
By enabling debugging
Can a custom .NET data type be used in a Web form?
This can be achieved by placing the DLL containing the custom data type
Can the view state be protected from tampering?
This can be achieved by enableViewStateMac="true"
What’ is the sequence in which ASP.NET events are processed?
Following is the sequence in which the events occur:-
• Page Load.
• Control events
• Page- Unload event.
Page_init event only occurs when first time the page is started, but Page Load occurs in subsequent request of the page.
In which event are the controls fully loaded?
How do we assign page specific attributes?
using the @Page
What is the use of @ Register directives?
Means that server control added to the page..
Where is View State information stored?
In HTML Hidden Fields.
What is the difference between “Web.config” and “Machine.Config”?
“Web.config” files apply settings to each web application, while “Machine.config” file apply settings to all ASP.NET applications.
What is a SESSION and APPLICATION object?
Session object store information between HTTP requests for a particular user, while application object are global across users.
How can we check if all the validation control are valid and proper?
Using the Page.IsValid ()
How to disable client side script in validators?
Set ‘EnableClientScript’ to false.
How can we kill a user session?
What are different IIS isolation levels?
IIS has three level of isolation : (LOW (IIS process) --Medium (Pooled) --High (Isolated)
what is the threading model used for ASP.NET.
ASP.NET uses MTA threading model.
What is the difference between URL and URI?
A URL (Uniform Resource Locator) is the address of some resource on the Web. A resource is nothing but a page of a site. There are other type of resources than Web pages, but thats the easiest conceptually.
A URI is a unique identifier to usually a namespace.
Though it looks like a URL but it doesn’t have to necessarily locate any resource on the web.
URI is a generic term. URL is a type of URI.
URI - Uniform Resource Identifier: it’s a string and its responsibility is to identify a resource by meta-information. It gives information about only one resource.
URL - Uniform Resource Locator: identifies the resource on the net and tells it is obtainable using what protocols.
Can you store multiple data types in System.Array? No.
What’s the difference between the System.Array.CopyTo() and System.Array.Clone()? The first one performs a deep copy of the array, the second one is shallow.
How can you sort the elements of the array in descending order? By calling Sort() and then Reverse() methods.
What’s the .NET datatype that allows the retrieval of data by a unique key? HashTable.
What’s class SortedList underneath? A sorted HashTable.
Can multiple catch blocks be executed? No,
What’s a delegate? A delegate object encapsulates a reference to a method, A strongly typed function pointer.
What’s a multicast delegate? It’s a delegate that points to and eventually fires off several methods.
. How’s the DLL Hell problem solved in .NET? Assembly versioning
What’s a satellite assembly? In multi-cultural application in .NET the localized assemblies that modify the core application are called satellite assemblies.
What’s the difference between <c> and <code> XML documentation tag? Single line code example and multiple-line code example.
What’s the difference between // comments, /* */ comments and /// comments? Single-line, multi-line and XML documentation comments.
Is XML case-sensitive? Yes
What’s the difference between the Debug class and Trace class? Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.
Can you change the value of a variable while debugging a C# application? Yes
Explain the three services model (three-tier application). Presentation (UI), business (logic and underlying code) and data (from storage or other sources).
What connections does Microsoft SQL Server support? Windows Authentication , SQL Server authentication
Which one is trusted and which one is untrusted? Windows Authentication is trusted
What does the parameter Initial Catalog define inside Connection String? The database name to connect to.
· What’s the data provider name to connect to Access database? Microsoft.Access.
What does Dispose method do with the connection object? Deletes it from the memory.
Difference between stored procedure and function
-Procedure can return zero or n values / function can return one value
-Procedures can have input, output parameters for it / functions can have only input
-Functions can be called from procedure / procedures cannot be called from function.
How many types of memories are there in .net?
Ans: Two types of memories are there in .net stack memory and heap memory
Is it possible to set the session out time manually?
Ans: Yes we can set the session out time manually in web.config.
What is the difference between primary key and unique key with not null?
Ans: There is no difference between primary key and unique key with not null.
What are difference between GET and POST Methods?
GET Method ():
1) Data is appended to the URL.
2) Data is not secret.
3) It is a single call system
4) Maximum data that can be sent is 256.
5) Data transmission is faster
6) this is the default method for many browsers
POST Method ():
1) Data is not appended to the URL.
2) Data is Secret
3) it is a two call system.
4) There is no Limit on the amount of data. That is characters any amount of data can be sent.
5) Data transmission is comparatively slow.
6) No default and should be explicitly specified.
What is difference between constants, read-only and, static?
Constants: The value can’t be changed
Read-only: The value will be initialized only once from the constructor of the class.
Static: Value can be initialized once, The value can be changed, access the variables without creating any instances
What is the difference between application exception and system exception?
Ans: system exceptions are thrown by CLR / application exceptions are thrown by applications.
What is the difference between .tostring(), Convert.tostring()?
Ans: The basic difference between them is “Convert” function handles NULLS while
“.ToString()” does not it will throw a NULL reference exception error. So as a good coding
practice using “convert” is always safe.
What is Collation?
Ans: Collation refers to how the data is sorted and compared
What is the difference between Primary key and unique key?
Ans: Primary key does not allow the null values but unique key allows one null value.
Primary key will create clustered index on column but unique key will create non-clustered index by default.
What is the difference between view state and hidden field?
Ans: viewstate is secured hidden field is insecure
Viewstate will store large amount of data but hidden filed will store small amount of data.
Can the validation be done in the server side? Or this can be done only in the Client side? - Client side is done by default. Server side validation is also possible.
Is it possible to have a static indexer in C#? - No. Static indexers are not allowed in C#.
What is indexer in C#? used to allow for classes or structs to be indexed like an array.
If I return out of a try/finally in C#, does the code in the finally-clause run? - Yes. The code in the finally always runs.
The C# keyword .int. maps to which .NET type? System.Int32
Which of these string definitions will prevent escaping on backslashes in C#?
string s = @.n Test string.;
Which of these statements correctly declares a two-dimensional array in C#?
If a method is marked as protected internal who can access it?
Classes within the same assembly, and classes derived from the declaring class.
What is boxing? Encapsulating a copy of a value type in an object.
In Object Oriented Programming, how would you describe encapsulation?
The separation of interface and implementation.
What’s the difference between private and shared assembly? Private assembly is used inside an application only ,hared assembly can be used by multiple applications
Where are shared assemblies stored? Global assembly cache.
Can you have two files with the same file name in GAC? Yes
Does C# support multiple inheritance? No, use interfaces instead.
C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write? Two.
Whats the top .NET class that everything is derived from? System.Object.
Can you inherit multiple interfaces? Yes, why not.
Whats polymorphism? Polymorphism means one interface and many forms.
There are two types of Polymorphism.
Compile time: function or operator overloading
Runtime: Inheritence & virtual functions
Can Struct be inherited? No
What is Object ? Object is anything that is a single item.
What is Class? A Class is the generic definition of what an object is a template.
What is Sealed modifiers?
Sealed types cannot be inherited & are concrete.
Sealed modifiers can also be applied to instance methods, properties, events & indexes. It cant be applied to static members.
Sealed members are allowed in sealed and non-sealed classes.
What is method overloading?
Method overloading allows us to write different version of the same method in a class or derived class
What is method overriding?
allows to invoke functions (that have the same signatures) and that belong to different classes
What are Constructors ? Constructor creates and initialises the objects in an application. . If no constructor defined then the CLR will provide an implicit constructor which is called as Default Constructor.
Static methods can not use non static members. ? yes
A constructor can be private. ? yes
What is "this" pointer? points to the current object of a class
What is difference between static and sealed classes?
sealed classes: we can create their instances, but cannot inherit them
static classes: we can neither create their instances, nor inherit them
There are three ways of inserting a style sheet:
1. External style sheet like <link rel="stylesheet" type="text/css" href="mystyle.css" />
2. Internal style sheet like <style type="text/css">
3. Inline or emdded style like <p style="color:sienna;margin-left:20px">This is a paragraph.</p>
Can you specify more than one css class for any HTML element?
Yes, you can like <div class="class1 class2">
What is the default/initial value for “position”? Static
Is CSS case sensitive? no