MVC

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 78

1.Explain TempData in MVC?

Answer: TempData is again a key, value pair as ViewData. This is derived from
“TempDataDictionary” class. TempData is used when the data is to be used in two
consecutive requests, this could be between the actions or between the controllers.
This requires typecasting in view. (Latest 50 MVC Interview Questions)
2. Why to use Html.Partial in MVC?
Answer: This method is used to render the specified partial view as an HTML
string. This method does not depend on any action methods. We can use this like
below

3. What do you mean by Separation of Concerns?


Answer: As per Wikipedia ‘the process of breaking a computer program into
distinct features that overlap in functionality as little as possible’. MVC design
pattern aims to separate content from presentation and data-processing from
content.
4. What are Display Modes in MVC4?
Answer: Display modes use a convention-based approach to allow selecting
different views based on the browser making the request. The default view engine
fi rst looks for views with names ending with .Mobile.cshtml when the browser’s
user agent indicates a known mobile device. For example, if we have a generic
view titled Index.cshtml and a mobile view titled Index.Mobile.cshtml, MVC 4
will automatically use the mobile view when viewed in a mobile browser.
Additionally, we can register your own custom device modes that will be based on
your own custom criteria — all in just one code statement. For example, to register
a WinPhone device mode that would serve views ending with .WinPhone.cshtml to
Windows Phone devices, you’d use the following code in the Application_Start
method of your Global.asax:

5. What are the advantages of MVC


Answer: A main advantage of MVC is separation of concern. Separation of
concern means we divide the application Model, Control and View.
We can easily maintain our application because of separation of concern.
In the same time we can split many developers work at a time. It will not affects
one developer work to another developer work.
It supports TTD (test-driven development). We can create an application with unit
test. We can write won test case.
Latest version of MVC Support default responsive web site and mobile templates.
6. What is the difference between ActionResult and ViewResult?
Answer:
ActionResult is an abstract class while ViewResult derives from the ActionResult
class.
ActionResult has several derived classes like ViewResult, JsonResult,
FileStreamResult, and so on.
ActionResult can be used to exploit polymorphism and dynamism. So if you are
returning different types of views dynamically, ActionResult is the best thing. For
example in the below code snippet, you can see we have a simple action called
DynamicView. Depending on the flag (IsHtmlView) it will either return a
ViewResult or JsonResult.
7. What is Route Constraints in MVC?
Answer: This is very necessary for when we want to add a specific constraint to
our URL. So, we want to set some constraint string after our host name. Fine, let’s
see how to implement it.
It’s very simple to implement, just open the RouteConfig.cs file and you will find
the routing definition in that. And modify the routing entry as in the following. We
will see that we have added “abc” before. (Latest 50 MVC Interview Questions)

8. What are the Folders in MVC application solutions?


Answer: When you create a project a folder structure gets created by default under
the name of your project which can be seen in solution explorer. Below I will give
you a brief explanation of what these folders are for.
Model: This folder contains classes that is used to provide data. These classes can
contain data that is retrieved from the database or data inserted in the form by the
user to update the database.

Controllers: These are the classes which will perform the action invoked by the
user. These classes contains methods known as “Actions” which responds to the
user action accordingly.

Views: These are simple pages which uses the model class data to populate the
HTML controls and renders it to the client browser.

App_Start: Contains Classes such as FilterConfig, RoutesConfig, WebApiConfig.


As of now we need to understand the RouteConfig class. This class contains the
default format of the URL that should be supplied in the browser to navigate to a
specified page.

9. What do you meant MVC?


Answer: MVC is a framework pattern that splits an application’s implementation
logic into
three component roles: models, views, and controllers.
Model: The business entity on which the overall application operates. Many
applications use a persistent storage mechanism (such as a database) to store data.
MVC does not specifically mention the data access layer because it is understood
to be encapsulated by the Model.
View: The user interface that renders the Model into a form of interaction.
Controller: Handles a request from a View and updates the Model that results in a
change of the Model’s state.
To implement MVC in .NET we need mainly three classes (View, Controller and
the Model).

10.Where do we see Separation of Concerns in MVC?


Answer: Between the data-processing (Model) and the rest of the application.
When we talk about Views and Controllers, their ownership itself explains
separation. The views are just the presentation form of an application, it does not
have to know specifically about the requests coming from controller. The Model is
independent of View and Controllers, it only holds business entities that can be
passed to any View by the controller as required for exposing them to the end user.
The controller is independent of Views and Models, its sole purpose is to handle
requests and pass it on as per the routes defined and as per the need of rendering
views. Thus our business entities (model), business logic (controllers) and
presentation logic (views) lie in logical/physical layers independent of each other.
11.Differences between Razor and ASPX View Engine in MVC?
Answer: Razor View Engine VS ASPX View Engine
Razor View Engine ASPX View Engine (Web form view engine)
The namespace used by the Razor View Engine is System.Web.Razor The
namespace used by the ASPX View Engine is
System.Web.Mvc.WebFormViewEngine
The file extensions used by the Razor View Engine are different from a web form
view engine. It uses cshtml with C# and vbhtml with vb for views, partial view,
templates and layout pages. The file extensions used by the Web Form View
Engines are like ASP.Net web forms. It uses the ASPX extension to view the aspc
extension for partial views or User Controls or templates and master extensions for
layout/master pages.
The Razor View Engine is an advanced view engine that was introduced with
MVC 3.0. This is not a new language but it is markup. A web form view engine is
the default view engine and available from the beginning of MVC
Razor has a syntax that is very compact and helps us to reduce typing. The web
form view engine has syntax that is the same as an ASP.Net forms application.
The Razor View Engine uses @ to render server-side content. The ASPX/web
form view engine uses “<%= %>” or “<%: %>” to render server-side content.
By default all text from an @ expression is HTML encoded. There is a different
syntax (“<%: %>”) to make text HTML encoded.
Razor does not require the code block to be closed, the Razor View Engine parses
itself and it is able to decide at runtime which is a content element and which is a
code element. A web form view engine requires the code block to be closed
properly otherwise it throws a runtime exception.
The Razor View Engine prevents Cross Site Scripting (XSS) attacks by encoding
the script or HTML tags before rendering to the view. A web form View engine
does not prevent Cross Site Scripting (XSS) attack.
The Razor Engine supports Test Driven Development (TDD). Web Form view
engine does not support Test Driven Development (TDD) because it depends on
the System.Web.UI.Page class to make the testing complex.
Razor uses “@* … *@” for multiline comments. The ASPX View Engine uses “”
for markup and “/* … */” for C# code.
There is only three transition characters with the Razor View Engine. There are
only three transition characters with the Razor View Engine.
The Razor View Engine is a bit slower than the ASPX View Engine.

12. What are the possible Razor view extensions?


Answer: Below are the two types of extensions razor view can have –
.cshtml – In C# programming language this extension will be used.
.vbhtml – In VB programming language this extension will be used.

13.What is Area in MVC?


Answer: Area is used to store the details of the modules of our project. This is
really helpful for big applications, where controllers, views and models are all in
main controller, view and model folders and it is very difficult to manage.
14. What is the difference between ViewBag and ViewData in MVC?
Answer: ViewBag is a wrapper around ViewData, which allows to create dynamic
properties. Advantage of viewbag over viewdata will be –
In ViewBag no need to typecast the objects as in ViewData.
ViewBag will take advantage of dynamic keyword which is introduced in version
4.0. But before using ViewBag we have to keep in mind that ViewBag is slower
than ViewData.

15. What are Filters?


Answer:
Sometimes we want to execute some logic either before the execution of the action
method or after the execution of the action method.We can use Action Filter for
such kind of scenario.Filters defines logic which is executed before or after the
execution of the action method.Action Filters are attributes which we can apply to
the action methods.Following are the MVC Filters:

Authorization filter
Action filter
Result filter
Exception filter
For example to apply authorize filter we apply the attribute as:

1. [Authorize]
2. public ActionResult Index()

3. return View(); (Latest 50 MVC Interview Questions)

16. What is a View Engine?


Answer: View Engines are responsible for generating the HTML from the
views.Views contains HTML and source code in some programming language
such as C#. View Engine generates HTML from the view which is returned to the
browser and rendered.Two main View Engines are WebForms and Razor ,each has
its own syntax.
17. Which assembly contains the ASP.NET MVC classes and interfaces?
Answer: The main functionality of ASP.NET MVC is defined in the
System.Web.Mvc assembly.It contains the classes and interfaces which supports
the MVC functionality. System.Web.Mvc is the namespace which contains the
classes used by the MVC application. ( (Dot Net Interview Question )
18: What is MVC (Model view controller)?
Answer: Model–view–controller (MVC) is a software architectural pattern for
implementing user interfaces. It divides a given software application into three
interconnected parts, so as to separate internal representation of information from
the way that information is presented to or accepted from the user.
MVC is a framework for building web applications using a MVC (Model View
Controller) design:

The Model represents the application core (for instance a list of database records).
The View displays the data (the database records).
The Controller handles the input (to the database records).
The MVC model also provides full control over HTML, CSS, and JavaScript.

mvc

The MVC model defines web applications with 3 logic layers:

The business layer (Model logic)


The display layer (View logic)
The input control (Controller logic)
The Model is the part of the application that handles the logic for the application
data.

Often model objects retrieve data (and store data) from a database.

The View is the part of the application that handles the display of the data.

Most often the views are created from the model data.

The Controller is the part of the application that handles user interaction.

Typically controllers read data from a view, control user input, and send input data
to the model.

The MVC separation helps you manage complex applications, because you can
focus on one aspect a time. For example, you can focus on the view without
depending on the business logic. It also makes it easier to test an application.

The MVC separation also simplifies group development. Different developers can
work on the view, the controller logic, and the business logic in parallel.

19. What are Action Filters in MVC?


Answer: Action Filters are additional attributes that can be applied to either a
controller section or the entire controller to modify the way in which action is
executed. These attributes are special .NET classes derived from System.Attribute
which can be attached to classes, methods, properties and fields. (Dot Net
Training)
20. What is Razor in MVC?
Answer: Razor is not a new programming language itself, but uses C# syntax for
embedding code in a page without the ASP.NET delimiters: <%= %>. It is a
simple-syntax view engine and was released as part of ASP.NET MVC 3. The
Razor file extension is “cshtml” for the C# language. It supports TDD (Test Driven
Development) because it does not depend on the System.Web.UI.Page class.
21. Explain the concept of MVC Scaffolding?
Answer: ASP.NET Scaffolding is a code generation framework for ASP.NET
Web applications. Visual Studio 2013 includes pre-installed code generators for
MVC and Web API projects. You add scaffolding to your project when you want
to quickly add code that interacts with data models. Using scaffolding can reduce
the amount of time to develop standard data operations in your project.
Scaffolding consists of page templates, entity page templates, field page templates,
and filter templates. These templates are called Scaffold templates and allow you
to quickly build a functional data-driven Website.
(MVC Interview Questions)

22. What is Output Caching in MVC?


Answer: The main purpose of using Output Caching is to dramatically improve the
performance of an ASP.NET MVC Application. It enables us to cache the content
returned by any controller method so that the same content does not need to be
generated each time the same controller method is invoked. Output Caching has
huge advantages, such as it reduces server round trips, reduces database server
round trips, reduces network traffic etc.
OutputCache label has a “Location” attribute and it is fully controllable. Its default
value is “Any”, however there are the following locations available; as of now, we
can use any one.

Any
Client
Downstream
Server
None
ServerAndClient

23. What is ViewStart?


Answer: Razor View Engine introduced a new layout named _ViewStart which is
applied on all view automatically. Razor View Engine firstly executes the
_ViewStart and then start rendering the other view and merges them.
24. Explain RenderSection in MVC?
Answer: RenderSection() is a method of the WebPageBase class. Scott wrote at
one point, The first parameter to the “RenderSection()” helper method specifies the
name of the section we want to render at that location in the layout template. The
second parameter is optional, and allows us to define whether the section we are
rendering is required or not. If a section is “required”, then Razor will throw an
error at runtime if that section is not implemented within a view template that is
based on the layout file (that can make it easier to track down content errors). It
returns the HTML content to render.(Company)
25. What is MVC?
Answer: MVC is a pattern which is used to split the application’s implementation
logic into three components: models, views, and controllers.
26. Can you explain the page life cycle of MVC?
Answer: Below are the processed followed in the sequence –
Appinitialization
Routing
Instantiateandexecutecontroller
Locateandinvokecontrolleraction
Instantiate and render view.
27. Explain JSON Binding?
Answer: JavaScript Object Notation (JSON) binding support started from MVC3
onwards via the new Json Value Provider Factory, which allows the action
methods to accept and model-bind data in JSON format. This is useful in Ajax
scenarios like client templates and data binding that need to post data back to the
server.
28. Can a view be shared across multiple controllers? If Yes, How we can do
that?
Answer: Yes, we can share a view across multiple controllers. We can put the
view in the “Shared” folder. When we create a new MVC Project we can see the
Layout page will be added in the shared folder, which is because it is used by
multiple child pages.
29. How we can handle the exception at controller level in MVC?
Answer: Exception Handling is made simple in MVC and it can be done by just
overriding “OnException” and set the result property of the filtercontext object (as
shown below) to the view detail, which is to be returned in case of exception.
30. What is Representational State Transfer (REST) mean?
Answer: REST is an architectural style which uses HTTP protocol methods like
GET, POST, PUT, and DELETE to access the data. MVC works in this style. In
MVC 4 there is a support for Web API which uses to build the service using HTTP
verbs.
31. What are the differences between Partial View and Display Template and
Edit Templates in MVC?
Answer: Display Templates – These are model centric. Meaning it depends on the
properties of the view model used. It uses convention that will only display like
divs or labels.
Edit Templates – These are also model centric but will have editable controls like
Textboxes. (MVC Interview Questions)
Partial View – These are view centric. These will differ from templates by the way
they render the properties (Id’s) Eg : CategoryViewModel has Product class
property then it will be rendered as Model.Product.ProductName but in case of
templates if we CategoryViewModel has List then @Html.DisplayFor(m =>
m.Products) works and it renders the template for each item of this list.
32. Why to use ASP.Net MVC
Answer: The strength of MVC (i.e. ASP.Net MVC) is listed below, that will
answer this question
MVC reduces the dependency between the components; this makes your code
more testable. (asp dotnet mvc online training)
MVC does not recommend use of server controls, hence the processing time
required to generate HTML response is drastically reduced.
The integration of java script libraries like jQuery, Microsoft MVC becomes easy
as compared to Webforms approach.
33. What is Bundling and Minification?
Answer: Bundling and Minification is used for improving the performance of the
application.Bundling reduces the number of HTTP requests made to the server by
combining several files into a single bundle.Minification reduces the size of the
individual files by removing unnecessary characters.
34. List out different return types of a controller action method?
Answer: There are total nine return types we can use to return results from
controller to view.
ViewResult (View): This return type is used to return a webpage from an action
method.
PartialviewResult (Partialview): This return type is used to send a part of a view
which will be rendered in another view.
RedirectResult (Redirect): This return type is used to redirect to any other
controller and action method depending on the URL.
RedirectToRouteResult (RedirectToAction, RedirectToRoute): This return type is
used when we want to redirect to any other action method.
ContentResult (Content): This return type is used to return HTTP content type like
text/plain as the result of the action.
jsonResult (json): This return type is used when we want to return a JSON
message.
javascriptResult (javascript): This return type is used to return JavaScript code that
will run in browser.
FileResult (File): This return type is used to send binary output in response.
EmptyResult: This return type is used to return nothing (void) in the result.
35. What is Route in MVC? What is Default Route in MVC?
Answer: A route is a URL pattern that is mapped to a handler. The handler can be
a physical file, such as a .aspx file in a Web Forms application. A handler can also
be a class that processes the request, such as a controller in an MVC application.
To define a route, you create an instance of the Route class by specifying the URL
pattern, the handler, and optionally a name for the route.
(Informatica Training Videos)
You add the route to the application by adding the Route object to the static Routes
property of the RouteTable class. The Routesproperty is a RouteCollection object
that stores all the routes for the application.

You typically do not have to write code to add routes in an MVC application.
Visual Studio project templates for MVC include preconfigured URL routes. These
are defined in the Mvc Application class, which is defined in the Global.asax file.

36. What is Partial View in MVC?


Answer: A partial view is a chunk of HTML that can be safely inserted into an
existing DOM. Most commonly, partial views are used to componentize Razor
views and make them easier to build and update. Partial views can also be returned
directly from controller methods. In this case, the browser still receives text/html
content but not necessarily HTML content that makes up an entire page. As a
result, if a URL that returns a partial view is directly invoked from the address bar
of a browser, an incomplete page may be displayed. This may be something like a
page that misses title, script and style sheets. However, when the same URL is
invoked via script, and the response is used to insert HTML within the existing
DOM, then the net effect for the end user may be much better and nicer.
Partial view is a reusable view (like a user control) which can be embedded inside
other view. For example, let’s say all the pages of your site have a standard
structure with left menu, header, and footer as in the following image,

37. Explain Areas in MVC?


Answer: From ASP.Net MVC 2.0 Microsoft provided a new feature in MVC
applications, Areas. Areas are just a way to divide or “isolate” the modules of large
applications in multiple or separated MVC. like:
When you add an area to a project, a route for the area is defined in an
AreaRegistration file. The route sends requests to the area based on the request
URL. To register routes for areas, you add code to theGlobal.asax file that can
automatically find the area routes in the AreaRegistration file.

AreaRegistration.RegisterAllAreas();

Benefits of Area in MVC

Allows us to organize models, views and controllers into separate functional


sections of the application, such as administration, billing, customer support and
much more.
Easy to integrate with other Areas created by another.
Easy for unit testing.

38.How to change the action name in MVC?


Answer : “ActionName” attribute can be used for changing the action name.
Below is the sample code snippet to demonstrate more –
[ActionName(“TestActionNew”)]
public ActionResult TestAction()

So in the above code snippet “TestAction” is the original action name and in
“ActionName” attribute, name – “TestActionNew” is given. So the caller of this
action method will use the name “TestActionNew” to call this action. (Latest 50
MVC Interview Questions)

39. What is Html.RenderPartial?


Answer: Result of the method – “RenderPartial” is directly written to the HTML
response. This method does not return anything (void). This method also does not
depend on action methods. RenderPartial() method calls “Write()” internally and
we have to make sure that “RenderPartial” method is enclosed in the bracket.
Below is the sample code snippet
40. How to create a Controller in MVC
Answer: Create a simple class and extend it from Controller class. The bare
minimum requirement for a class to become a controller is to inherit it from
ControllerBase is the class that is required to inherit to create the controller but
Controller class inherits from ControllerBase.
41. How to access a view on the server
Answer: The browser generates the request in which the information like
Controller name, Action Name and Parameters are provided, when server receives
this URL it resolves the Name of Controller and Action, after that it calls the
specified action with provided parameters. Action normally does some processing
and returns the ViewResult by specifying the view name (blank name searches
according to naming conventions).
42. What are HTML helpers in MVC?
Answer: HTML helpers help you to render HTML controls in the view. For
instance if you want to display a HTML textbox on the view , below is the HTML
helper code.
43. What are AJAX Helpers in MVC?
Answer: AJAX Helpers are used to create AJAX enabled elements like as Ajax
enabled forms and links which performs the request asynchronously and these are
extension methods of AJAXHelper class which exists in namespace –
System.Web.Mvc.
44. Can you explain RenderBody and RenderPage in MVC?
Answer: RenderBody is like ContentPlaceHolder in web forms. This will exist in
layout page and it will render the child pages/views. Layout page will have only
one RenderBody() method. RenderPage also exists in Layout page and multiple
RenderPage() can be there in Layout page.
45. Explain the methods used to render the views in MVC?
Answer: Below are the methods used to render the views from action –
View() – To return the view from action.
PartialView() – To return the partial view from action.
RedirectToAction() – To Redirect to different action which can be in same
controller or in different controller.
Redirect() – Similar to “Response.Redirect()” in webforms, used to redirect to
specified URL.
RedirectToRoute() – Redirect to action from the specified URL but URL in the
route table has been matched

(Latest 50 MVC Interview Questions)

46. What are the sub types of ActionResult?


Answer: Action Result is used to represent the action method result. Below are the
subtypes of ActionResult –
View Result
PartialViewResult
RedirectToRouteResult
RedirectResult
JavascriptResult
JSONResult
FileResult

47. What are Validation Annotations?


Answer: Data annotations are attributes which can be found in the
“System.Component Model.Data Annotations” name space. These attributes will
be used for server-side validation and client-side validation is also supported. Four
attributes – Required, String Length, Regular Expression and Range are used to
cover the common validation scenarios.
48.How do you implement Forms authentication in MVC?
Answer: Authentication is giving access to the user for a specific service by
verifying his/her identity using his/her credentials like username and password or
email and password. It assures that the correct user is authenticated or logged in for
a specific service and the right service has been provided to the specific user based
on their role that is nothing but authorization.
ASP.NET forms authentication occurs after IIS authentication is completed. You
can configure forms authentication by using forms element with in web.config file
of your application. The default attribute values for forms authentication are shown
below:

<authenticationmode=”Forms”>
<formsloginUrl=”Login.aspx” protection=”All” timeout=”30″
name=”.ASPXAUTH” path=”/” requireSSL=”false” slidingExpiration=”true”
defaultUrl=”default.aspx” cookieless=”UseDeviceProfile”
enableCrossAppRedirects=”false” />

The Forms Authentication class creates the authentication cookie automatically


when SetAuthCookie() or RedirectFromLoginPage() methods are called. The value
of authentication cookie contains a string representation of the encrypted and
signed Forms Authentication Ticket object.

49. What is Razor View Engine in MVC?


Answer: ASP.NET MVC has always supported the concept of “view engines” that
are the pluggable modules that implement various template syntax options. The
“default” view engine for ASP.NET MVC uses the same .aspx/.ascx/.master file
templates as ASP.NET Web Forms. In this article I go through the Razor View
Engine to create a view of an application. “Razor” was in development beginning
in June 2010 and was released for Microsoft Visual Studio in January 2011.
Razor is not a new programming language itself, but uses C# syntax for embedding
code in a page without the ASP.NET delimiters: <%= %>. It is a simple-syntax
view engine and was released as part of ASP.NET MVC 3. The Razor file
extension is “cshtml” for the C# language. It supports TDD (Test Driven
Development) because it does not depend on the System.Web.UI.Page class.

50. What is Scaffolding in MVC?


Answer: Scaffolding is a code generation framework for ASP.NET Web
applications. Visual Studio 2013 includes pre-installed code generators for MVC
and Web API projects. You add scaffolding to your project when you want to
quickly add code that interacts with data models. Using scaffolding can reduce the
amount of time to develop standard data operations in your project.
Post navigation
Top 50 Technical Interview Questions And Answers Pdf
Interview Question Answers / By Admin

1. What is a Network?_text]
Answer: A network is a set of devices connected to each other using a physical
transmission medium. (Top 50 Technical Interview Questions And Answers Pdf)
Example: A Computer Network is a group of computers connected with each other
to communicate and share information and resources like hardware, data, and
software across each other.

2. What is the concepts of Globalization and Localization in .NET?_text]


Answer: Localization means “process of translating resources for a specific
culture”, and Globalization means “process of designing applications that can
adapt to different cultures”.
Proper Globalization: Your application should be able to Accept, Verify, and
Display all global kind of data. It should well also be able to operate over this data,
accordingly. We will discuss more about this “Accordingly operations over diff.
culture data”.

Localizability and Localization: Localizability stands for clearly separating the


components of culture based operations regarding the user interface, and other
operations from the executable code.
.NET framework has greatly simplified the task of creating the applications
targeting the clients of multiple cultures. The namespaces involved in creation of
globalize, localizing applications are:

System.Globalization
System.Resources
System.Text

3. How can we construct an increment statement or decrement statement in


C?_text]
Answer: We can do this in two different ways. 1) By using the increment operator
++ and decrement operator. For example, the statement “i++” means to increment
the value of x by 1. Likewise, the statement “x –” means to decrement the value of
x by 1. 2) The 2nd way of writing increment statements is to use the conventional
+ plus sign or minus sign. In the case of “i++, another way to write it is “i = i +1.
4. Explain the concept of Reentrancy?_text]
Answer: It is a useful, memory-saving technique for multiprogrammed
timesharing systems. A Reentrant Procedure is one in which multiple users can
share a single copy of a program during the same period. Reentrancy has 2 key
aspects: The program code cannot modify itself, and the local data for each user
process must be stored separately. Thus, the permanent part is the code, and the
temporary part is the pointer back to the calling program and local variables used
by that program. Each execution instance is called activation. It executes the code
in the permanent part, but has its own copy of local variables/parameters. The
temporary part associated with each activation is the activation record. Generally,
the activation record is kept on the stack.
Note: A reentrant procedure can be interrupted and called by an interrupting
program, and still execute correctly on returning to the procedure.
5. What is the difference between verification and validation?_text]
Answer: Verification is a review without actually executing the process while
validation is checking the product with actual execution. For instance, code review
and syntax check is verification while actually running the product and checking
the results is validation.
6. So If Md5() Generates The Most Secure Hash, Why Would You Ever Use
The Less Secure Crc32() And Sha1()?_text]Answer :
Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending
on the data that you’re encrypting, you might have reasons to store a 32-bit value
in the database instead of the 160-bit value to save on space. Second, the more
secure the crypto is, the longer is the computation time to deliver the hash value. A
high volume site might be significantly slowed down, if frequent md5() generation
is required.7. What is a Proxy Server and how do they protect the computer
network?_text]
Answer: For data transmission, IP addresses are required and even DNS uses IP
addresses to route to the correct website. It means without the knowledge of
correct and actual IP addresses it is not possible to identify the physical location of
the network.
Proxy Servers prevent external users who are unauthorized to access such IP
addresses of the internal network. The Proxy Server makes the computer network
virtually invisible to the external users.

proxy server

image source: Proxy Server

Proxy Server also maintains the list of blacklisted websites so that the internal user
is automatically prevented from getting easily infected by the viruses, worms etc.
(Top 50 Technical Interview Questions And Answers Pdf)

8. What is Data Encapsulation?_text]Answer: In a computer network, to enable


data transmission from one computer to another, the network devices send
messages in the form of packets. These packets are then added with the IP header
by OSI reference model layer.
The Data Link Layer encapsulates each packet in a frame which contains the
hardware address of the source and the destination computer. If a destination
computer is on the remote network then the frames are routed through a gateway or
router to the destination computer. (Informatica Training Videos)9. Define
Network?_text]Answer: A network is a set of devices connected by physical
media links. A network is recursively is a connection of two or more nodes by a
physical link or two or more networks connected by one or more nodes.10. What
are different types of joins in the SQL?_text]Answer: There are 4 types of SQL
Joins:
Inner Join: This type of join is used to fetch the data among the tables which are
common in both the tables.
Left Join: This returns all the rows from the table which is on the left side of the
join but only the matching rows from the table which is on the right side of the
join.
Right Join: This returns all the rows from the table which is on the right side of the
join but only the matching rows from the table which is on the left side of the join.
Full Join: This returns the rows from all the tables on which the join condition has
put and the rows which do not match hold null values.
11. What are the typical elements of a process image?_text]Answer: User data:
Modifiable part of user space. May include program data, user stack area, and
programs that may be modified.
User program: The instructions to be executed.

System Stack: Each process has one or more LIFO stacks associated with it. Used
to store parameters and calling addresses for procedure and system calls.

Process control Block (PCB): Info needed by the OS to control processes.


12. What are local and global page replacements?_text]
Answer: Local replacement means that an incoming page is brought in only to the
relevant process address space. Global replacement policy allows any page frame
from any process to be replaced. The latter is applicable to variable partitions
model only.
Define latency, transfer and seek time with respect to disk I/O.
Seek time is the time required to move the disk arm to the required track.
Rotational delay or latency is the time it takes for the beginning of the required
sector to reach the head. Sum of seek time (if any) and latency is the access time.
Time taken to actually transfer a span of data is transfer time.
Describe the Buddy system of memory allocation.
Free memory is maintained in linked lists, each of equal sized blocks. Any such
block is of size 2^k. When some memory is required by a process, the block size of
next higher order is chosen, and broken into two. Note that the two such pieces
differ in address only in their kth bit. Such pieces are called buddies. When any
used block is freed, the OS checks to see if its buddy is also free. If so, it is
rejoined, and put into the original free-block linked-list.
13. What is Synchronous mode of data transmission?_text]
Answer: It is a serial mode of transmission.In this mode of transmission, bits are
sent in a continuous stream without start and stop bit and without gaps between
bytes. Regrouping the bits into meaningful bytes is the responsibility of the
receiver.
14. What is hamming code?_text]
Answer: The hamming code is an error correction method using redundant bits.
The number of bits is a function of the length of the data bits. In hamming code for
a data unit of m bits, we use the formula 2r >= m+r+1 to determine the number of
redundant bits needed. By rearranging the order of bit transmission of the data
units, the hamming code can correct burst errors. (PHP Interview Questions)_
15. What is Hypertext Transfer Protocol(HTTP) ?_text]
Answer: It is the main protocol used to access data on the World Wide Web .the
protol transfers data in the form of plain text,hypertext,audio,video,and so on. It is
so called because its efficiency allows its use in a hypertext environment where
there are rapid jumps from one document to another.
16. What is Beaconing?_text]
Answer: The process that allows a network to self-repair networks problems. The
stations on the network notify the other stations on the ring when they are not
receiving the transmissions. Beaconing is used in Token ring and FDDI networks.
(Top 50 Technical Interview Questions And Answers Pdf)
17. What is difference between ARP and RARP?_text]
Answer: The address resolution protocol (ARP) is used to associate the 32 bit IP
address with the 48 bit physical address, used by a host or a router to find the
physical address of another host on its network by sending a ARP query packet
that includes the IP address of the receiver.
The reverse address resolution protocol (RARP) allows a host to discover its
Internet address when it knows only its physical address.
18. What is difference between baseband and broadband transmission?_text]
Answer: In a baseband transmission, the entire bandwidth of the cable is
consumed by a single signal. In broadband transmission, signals are sent on
multiple frequencies, allowing multiple signals to be sent simultaneously.
19. What Is Meant By Pear In Php?_text]Answer :
PEAR is the next revolution in PHP. This repository is bringing higher level
programming to PHP. PEAR is a framework and distribution system for reusable
PHP components. It eases installation by bringing an automated wizard, and
packing the strength and experience of PHP users into a nicely organised OOP
library. PEAR also provides a command-line interface that can be used to
automatically install “packages”.20. What Is A Persistent Cookie?_text]
Answer :
A persistent cookie is a cookie which is stored in a cookie file permanently on the
browser’s computer. By default, cookies are created as temporary cookies which
stored only in the browser’s memory. When the browser is closed, temporary
cookies will be erased. You should decide when to use temporary cookies and
when to use persistent cookies based on their differences:

· Temporary cookies can not be used for tracking long-term information.


· Persistent cookies can be used for tracking long-term information.
· Temporary cookies are safer because no programs other than the browser can
access them.
· Persistent cookies are less secure because users can open cookie files see the
cookie values.
21. What Are The Differences Between Get And Post Methods In Form
Submitting, Give The Case Where We Can Use Get And We Can Use Post
Methods?_text]
Answer :
When you want to send short or small data, not containing ASCII characters, then
you can use GET” Method. But for long data sending, say more then 100 character
you can use POST method.

Once most important difference is when you are sending the form with GET
method. You can see the output which you are sending in the address bar. Whereas
if you send the form with POST” method then user can not see that information.

22. Explain DHCP briefly?_text]


Answer: DHCP stands for Dynamic Host Configuration Protocol and it
automatically assigns IP addresses to the network devices. It completely removes
the process of manual allocation of IP addresses and reduces the errors caused due
to this.
This entire process is centralized so that TCP/IP configuration can also be
completed from a central location. DHCP has “pool of IP addresses” from which it
allocates the IP address to the network devices. DHCP cannot recognize if any
device is configured manually and assigned with the same IP address from the
DHCP pool.

In this situation, it throws “IP address conflict” error.

DHCP

image source: DHCP

DHCP environment requires DHCP servers to set-up the TCP/IP configuration.


These servers then assign, release and renew the IP addresses as there might be a
chance that network devices can leave the network and some of them can join back
to the network. (Top 50 Technical Interview Questions And Answers Pdf)

23. What sort of criteria are you using to decide the organization you will
work for?_text]Answer: Most importantly, I am looking for a company that
values quality, ethics, and teamwork. I would like
to work for a company that hires overachievers.24. How would a professor who
knows you well describe you? One who does not know you
well?_text]
Answer: A professor who knows me well would likely describe my personal
qualities: sweet, down-to-earth,
smart, hard-working, and conscientious.
As specific examples of those who did not know me well, my soils professor and
soils teaching
assistant each considered me smart and respectful, and both thought that I must
have enjoyed the
25. What’s The Difference Between Htmlentities() And
Htmlspecialchars()?_text]Answer :
htmlspecialchars only takes care of <, >, single quote ‘, double quote ” and
ampersand.
htmlentities translates all occurrences of character sequences that have different
meaning in HTML.26. What is ASP.NET?_text]
Answer: ASP.NET was developed in direct response to the problems that
developers had with classic ASP. Since ASP is in such wide use, however,
Microsoft ensured that ASP scripts execute without modification on a machine
with the .NET Framework (the ASP engine, ASP.DLL, is not modified when
installing the .NET Framework). Thus, IIS can house both ASP and ASP.NET
scripts on the same machine. (Top 50 Technical Interview Questions And Answers
Pdf)
27. What is CMM?_text]
Answer: The Capability Maturity Model for Software (CMM or SW-CMM) is a
model for judging the maturity of the software processes of an organization and for
identifying the key practices that are required to increase the maturity of these
processes.
28.What is .Net framework?_text]Answer: It is a platform for building various
applications on windows. It has a list of inbuilt functionalities in the form of class,
library, and APIs which are used to build, deploy and run web services and
different applications. It supports different languages such as C#, VB .Net, Cobol,
Perl, etc. 29. In C program, how we can insert quote characters (‘ and ”) into
the output screen?_text]Answer: This is a common problem for
freshers/beginners because quotes are normally part of a “printf” statement in
program. If we want to insert the quote character as part of the output, use the
format specifiers , and ” (for double quote) , ’ (for single quote)30. What is
Firewalls?_text]
Answer: It is an electronic downbridge which is used to enhance the security of a
network. It’s configuration has two components.
i)Two routers
ii)Application gateway
the packets traveling through the LAN are inspected here and packets meeting
certain criteria are forwarded and others are dropped.
31. What is time-stamping?_text]
Answer: It is a technique proposed by Lamport, used to order events in a
distributed system without the use of clocks. This scheme is intended to order
events consisting of the transmission of messages. Each system ‘i’ in the network
maintains a counter Ci. Every time a system transmits a message, it increments its
counter by 1 and attaches the time-stamp Ti to the message. When a message is
received, the receiving system ‘j’ sets its counter Cj to 1 more than the maximum
of its current value and the incoming time-stamp Ti. At each site, the ordering of
messages is determined by the following rules: For messages x from site i and y
from site j, x precedes y if one of the following conditions holds….(a) if Ti<j.
32. What is busy waiting?_text]
Answer: The repeated execution of a loop of code while waiting for an event to
occur is called busy-waiting. The CPU is not engaged in any real productive
activity during this period, and the process does not progress toward completion.
Explain the popular multiprocessor thread-scheduling strategies.
Load Sharing: Processes are not assigned to a particular processor. A global queue
of threads is maintained. Each processor, when idle, selects a thread from this
queue. Note that load balancing refers to a scheme where work is allocated to
processors on a more permanent basis.
Gang Scheduling: A set of related threads is scheduled to run on a set of processors
at the same time, on a 1-to-1 basis. Closely related threads / processes may be
scheduled this way to reduce synchronization blocking, and minimize process
switching. Group scheduling predated this strategy.
Dedicated processor assignment: Provides implicit scheduling defined by
assignment of threads to processors. For the duration of program execution, each
program is allocated a set of processors equal in number to the number of threads
in the program. Processors are chosen from the available pool.
Dynamic scheduling: The number of thread in a program can be altered during the
course of execution.
33. What are the different types of multiplexing?_text]
Answer: Multiplexing is of three types. Frequency division multiplexing and wave
division multiplexing is for analog signals and time division multiplexing is for
digital signals. (Top 50 Technical Interview Questions And Answers Pdf)
34. What is World Wide Web ?_text]
Answer: World Wide Web is a repository of information spread all over the world
and linked together.It is a unique combination of flexibility,portability,and user-
friendly features .The World Wide Web today is a distributed client-server
service,in which a client using a browser can access a service using a server.The
service provided is distributed over many locations called web sites.
35. What is difference between baseband and broadband transmission?_text]
Answer: In a baseband transmission, the entire bandwidth of the cable is
consumed by a single signal. In broadband transmission, signals are sent on
multiple frequencies, allowing multiple signals to be sent simultaneously.
36. What is Hypertext Transfer Protocol(HTTP) ?_text]
Answer: It is the main protocol used to access data on the World Wide Web .the
protol transfers data in the form of plain text,hypertext,audio,video,and so on. It is
so called because its efficiency allows its use in a hypertext environment where
there are rapid jumps from one document to another.
37. Describe the layers of OSI model?_text]
Answer: OSI model stands for Open System Interconnection It is a framework
which guides the applications how they can communicate in a network.
OSI model has seven layers. They are listed below,

Physical Layer (Deals with transmission and reception of unstructured data


through a physical medium)
Data Link Layer (Helps in transferring error-free data frames between nodes)
Network Layer (Decides the physical path that should be taken by the data as per
the network conditions)
Transport Layer (Ensures that the messages are delivered in sequence and without
any loss or duplication)
Session Layer (Helps in establishing a session between processes of different
stations)
Presentation Layer (Formats the data as per the need and presents the same to
Application layer)
Application Layer (Serves as the mediator between Users and processes of
applications).

38. Explain the characteristics of networking?_text]


Answer: The main characteristics of networking are mentioned below,
Topology: This deals with how the computers or nodes are arranged in the
network. The computers are arranged physically or logically.
Protocols: Deals with the process how the computers communicate with one
another.
Medium: This is nothing but the medium used by the computers for
communication.
39. In how many ways the data is represented and what are they?_text]
Answer: Data transmitted through the networks’ comes in different ways like text,
audio, video, images, numbers etc.
Audio: It is nothing but the continuous sound which is different from text and
numbers.
Video: Continuous visual images or a combination of images.
Images: Every image is divided into pixels. And the pixels are represented using
bits. Pixels may vary in size based on the image resolution.
Numbers: These are converted into binary numbers and are represented using bits.
Text: Text is also represented as bits.

40. What is MVC?_text]


Answer: MVC stands for Model View Controller. It is an architectural model for
building the .Net applications.
Models – Model objects store and retrieve data from the database for an
application. They are usually the logical parts of an application that is implemented
by the application’s data domain.

View – These are the components that display the view of the application in the
form of UI. The view gets the information from the model objects for their display.
They have components like buttons, drop boxes, combo box, etc.

Controllers – They handle the User Interactions. They are responsible for
responding to the user inputs, work with the model objects, and pick a view to be
rendered to the user.

41. What is ICMP?_text]


Answer: ICMP is Internet Control Message Protocol, a network layer protocol of
the TCP/IP suite used by hosts and gateways to send notification of datagram
problems back to the sender. It uses the echo test / reply to test whether a
destination is reachable and responding. It also handles both control and error
messages. (Top 50 Technical Interview Questions And Answers Pdf)
42. What is IP address?_text]
Answer: The internet address (IP address) is 32bits that uniquely and universally
defines a host or router on the internet.The portion of the IP address that identifies
the network is called netid. The portion of the IP address that identifies the host or
router on the network is called hostid.

43. Explain CAS (Code Access Security)?_text]


Answer: .Net provides a security model that prevents unauthorized access to
resources. CAS is a part of that security model. CAS is present in the CLR. It
enables the users to set permissions at a granular level for the code.
CLR then executes the code depending on the available permissions. CAS can be
applied only to the managed code. Unmanaged code runs without CAS. If CAS is
used on assemblies, then the assembly is treated as partially trusted. Such
assemblies must undergo checks every time when it tries to access a resource.

The different components of CAS are Code group, Permissions, and Evidence.

Evidence– To decide what permissions to give, the CAS and CLR depend on the
specified evidence by the assembly. The examination of the assembly provides
details about the different pieces of evidence. Some common evidence include
Zone, URL, Site, Hash Value, Publisher and Application directory.

Code Group – Depending on the evidence, codes are put into different groups.
Each group has specific conditions attached to it. Any assembly that matches those
condition is put into that group.(Linux Admin Online Training)
Permissions – Each code group can perform only specific actions. They are called
Permissions. When CLR loads an assembly, it matches them to one of the code
groups and identifies what actions those assemblies can do. Some of the
Permissions include Full Trust, Everything, Nothing, Execution, Skip Verification,
and the Internet.

44. What is Network Topology?_text]


Answer: Network Topology is a physical layout of the computer network and it
defines how the computers, devices, cables etc are connected to each other.
45. What are Routers?_text]
Answer: The router is a network device which connects two or more network
segments. The router is used to transfer information from the source to destination.
Routers send the information in terms of data packets and when these data packets
are forwarded from one router to another router then the router reads the network
address in the packets and identifies the destination network.

46. What is DNS?_text]


Answer: Domain Name Server (DNS), in a non-professional language and we can
call it as Internet’s phone book. All the public IP addresses and their hostnames are
stored in the DNS and later it translates into a corresponding IP address.
For a human being, it is easy to remember and recognize the domain name,
however, the computer is a machine that does not understand the human language
and they only understand the language of IP addresses for data transfer.

There is a “Central Registry” where all the domain names are stored and it gets
updated on a periodic basis. All the internet service providers and different host
companies usually interact with this central registry to get the updated DNS details.

For Example: When you type a website , then your internet service provider looks
for the DNS associated with this domain name and translates this website
command into a machine language – IP address – 151.144.210.59 (note that, this is
imaginary IP address and not the actual IP for the given website) so that you will
get redirected to the appropriate destination. (Office 365 Online Training)
This is shortly explained in the below diagram:

DNS

image source: DNS

47. what are ipconfig and ifconfig?_text]


Answer: Ipconfig stands for Internet Protocol Configuration and this command is
used on Microsoft Windows to view and configure the network interface.
The command ipconfig is useful for displaying all TCP/IP network summary
information currently available on a network. It also helps to modify the DHCP
protocol and DNS setting.

Ifconfig (Interface Configuration) is a command that is used on Linux, Mac, and


UNIX operating system. It is used to configure, control the TCP/IP network
interface parameters from CLI i.e. Command Line Interface. It allows you to see
the IP addresses of these network interfaces

48. What is Asynchronous mode of data transmission?_text]


Answer: It is a serial mode of transmission.
In this mode of transmission, each byte is framed with a start bit and a stop bit.
There may be a variable length gap between each byte.
49. What are the different types of a network? Explain each briefly_text]
Answer: There are 4 major types of network.
Let’s take a look at each of them in detail.
Personal Area Network (PAN): It is a smallest and basic network type that is often
used at home. It is a connection between the computer and another device such as
phone, printer, modem tablets etc
Local Area Network (LAN): LAN is used in small offices and internet cafe to
connect a small group of computers to each other. Usually, they are used to
transfer a file or for playing the game in a network.
Metropolitan Area Network (MAN): It is a powerful network type than LAN. The
area covered by MAN is a small town, city etc. A huge server is used to cover such
a large span of area for connection.
Wide Area Network (WAN): It is more complex than LAN and covers a large span
of area typically a large physical distance. The Internet is the largest WAN which
is spread across the world. WAN is not owned by any single organization but it has
distributed ownership.
There are some other types of network as well:
 Storage Area Network (SAN)
 System Area Network (SAN)
 Enterprise Private Network (EPN)
 Passive Optical Local Area Network (POLAN)
50. What is call by value and call by reference in C Programming
language?_text]
Answer: We can pass value to function by two different ways: call by value and
call by reference. In case of call by value, a copy of value is passed to the function,
so original value is not modified in the call by value. But in case of call by
reference, an address of value is passed to the function, so original value is
modified in the call by reference.
Post navigation
12. Explain What Is Ajax? Write An Ajax Call?_text]Answer :
AJAX stands for asynchronous JavaScript and XML and allows applications to
send and retrieve data to/from a server asynchronously (in the background) without
refreshing the page. For example, your new Gmail messages appear and are
marked as new even if you have not refreshed the page.(Latest 50 Front End
Developer Interview Questions And Answers)

13. Do You Know What Is The Importance Of The Html


Doctype?_text]Answer:
DOCTYPE is an instruction to the web browser about what version of the markup
language the page is written. Its written before the HTML Tag. Doctype
declaration refers to a Document Type Definition (DTD).
14. Explain The Difference Between Inline, Block, Inline-block And Box-
sizing?_text]Answer:
inline is the default. An example of an inline element is .
block displays as a block element, such as inline-block displays an element as an
inline-level block container. Here’s an article on the topic.
box-sizing tells the browser sizing properties.

15. Explain What Is The Difference Between A Prototype And A


Class?_text]Answer:
Prototype-based inheritance allows you to create new objects with a single
operator; class-based inheritance allows you to create new objects through
instantiation. Prototypes are more concrete than classes, as they are examples of
objects rather than descriptions of format and instantiation.

Prototypes are important in JavaScript because JavaScript does not have classical
inheritance based on classes; all inheritances happen through prototypes. If the
JavaScript runtime can’t find an object’s property, it looks to the object’s
prototype, and continues up the prototype chain until the property is found.

16. What are your favorite types of front end development projects to work
on? What do you like about them?_text]Answer:
This question gives you insight into the personal preferences of the front end
developer. Some applicants may prefer to only work on website projects, while
others enjoy being involved in web application teams more. What to look for in an
answer:

A strong opinion on their favorite types of development


Enthusiasm for the project types they describe
Examples of their favorite front end development projects
Example: “I recently worked on a web application for a local hospital. It
streamlined the patient intake process and I loved knowing that my work helped
patients get the help they needed faster.”

17. Do You Know What Is Cors? How Does It Work?_text]Answer:


Cross-origin resource sharing (CORS) is a mechanism that allows many resources
(e.g., fonts, JavaScript, etc.) on a web page to be requested from another domain
outside the domain from which the resource originated. It’s a mechanism
supported in HTML5 that manages XMLHttpRequest access to a domain different.
CORS adds new HTTP headers that provide access to permitted origin domains.
For HTTP methods other than GET (or POST with certain MIME types), the
specification mandates that browsers first use an HTTP OPTIONS request header
to solicit a list of supported (and available) methods from the server. The actual
request can then be submitted. Servers can also notify clients whether “credentials”
(including Cookies and HTTP Authentication data) should be sent with
requests.(Latest 50 Front End Developer Interview Questions And Answers)

18. How To Optimize The Page Using Front End Code Or


Technology?_text]Answer :
Below is the list of best practices for front-end technology, which helps to optimize
page.

Improve server response by reducing resource usage per page


Combine all external CSS files into one file
Combine all external JS files into one file
Use responsive design instead of making device based redirects
Use asynchronous Javascript and remove block level Javascript
Use Minify version of stylesheet and javascript.
Optimize Image and use correct format of Image. Use the lazy loading design
pattern for large size of images.
Use browser side cache with Cache control.
Avoid plugins to drive functionality.
Configure view port and use CSS best practices.
Prioritize visible content.
Load style-sheets in header and script in footer.

19. Explain The Difference Between Static, Fixed, Absolute And Relative
Positioning?_text]Answer :
static is the default.
fixed is positioned relative to the browser.
absolute is positioned relative to its parent or ancestor element.
relative is positioned relative to normal positioning/the item itself. Used alone it
accomplishes nothing.

20. What is meant by Front-End Developer?_text]Answer:


Front-end web development is the practice of producing HTML, CSS and usually
JavaScript (while Web Assembly is a recent alternative to it) for a website or Web
Application so that a user can see and interact with them directly. The challenge
associated with front-end development is that the tools and techniques used to
create the front end of a website change constantly and so the developer needs to
constantly be aware of how the field is developing.

21. What are your favourite features of HTML5 and CSS3 and what would
you change?_text]Answer:
But rather than keeping up with new technologies, it reveals whether the front-end
developer being interviewed is also up to date with new features within the core
technologies.

22. Explain What Event Bubbling Is?_text]Answer :


Event bubbling causes all events in the child nodes to be automatically passed to
its parent nodes. The benefit of this method is speed because the code only needs
to traverse the DOM tree once.

23. Why Do We Need To Use W3c Standard Code?_text]Answer :


The goals of such standards are to ensure cross-platform compatibility and more
compact file sizes. The focus of these standards has been to separate “content”
from “formatting” by implementing CSS. It eases maintenance and
development.(Latest 50 Front End Developer Interview Questions And Answers)

24. Have You Ever Used A Css Preprocessor/precompiler? What Are The
Benefits?_text]Answer :
CSS preprocessors, such as SASS, have numerous benefits, such as variables and
nesting.25. Tell Me Where Do You Place Your Javascript On The
Page?_text]Answer :
It may depend on what you are using it for. There is some debate on this but
generally a good question to ask to get an understanding of the JS
knowledge.(Core Java Training Videos)
26. What Is The Difference Between Call And Apply?_text]Answer :
apply lets you invoke the function with arguments as an array. call requires the
parameters to be listed explicitly. Also, check out this stackoverflow answer.

27. What Is A Javascript Object?_text]Answer :


A collection of data containing both properties and methods. Each element in a
document is an object. Using the DOM you can get at each of these
elements/objects and do some cool sh*t.(Java Web Services Online Training)
28. Can you describe your workflow when you create a web
page?_text]Answer:
The workflow of a modern front-end developer has changed vastly in the past four
or five years. A huge array of tools are available to build organized, scalable web
applications by abstracting out many of the complexities and automating repetitive
tasks. Each developer will share a different workflow which will give some insight
into their organizational capacity and general technical preferences

29. If you arrive to a new company that has 3 competing stylesheets, how
would you best integrate them into the site?_text]Answer:
A stylesheet is template file consisting of font and layout settings to give a
standardized look to a website or web application. To keep a consistent look and
feel to a project, there should only be one stylesheet. I like to ask this question to
judge problem-solving, communication and team skills. (Latest 50 Front End
Developer Interview Questions And Answers)

30. Have you ever used an MVC? Which one and what do you like and dislike
about it?_text]Answer:
MVC stands for model view controller. MVCs typically organize webapps into a
well-structured pattern, making code easier to maintain. The term is well-known by
developers and some famous examples of MVCs include backbone.js and
angular.js. What makes this question interesting is not whether the frontend
interviewee has used an MVC, but what his or her preferences and experience
reveal. Candidates who are able to articulate why they use one MVC over another
show that they are engaged in what they do, care about the technology and have
considered different options. You want to be able to trust your frontend developer
to keep up to date with which technologies are relevant and have a clear idea of
when and what should be used.(Top 43 Java Developer Interview Questions And
Answers Pdf)
31. Have you learned anything interesting this week?_text]Answer:
I recently got into Elm. I’ve been hearing about how great of a functional
programming language it is for a while now. It may not be replacing JavaScript
anytime soon but it is a very interesting alternative. I also got around to learning
Regex. I’ve dabbled with it in the past but I never dove in deep. It’s a nice tool to
add to my bag of tricks.

32. What are pseudo-elements used for?_text]Answer:


The pseudo element property is used to style one aspect of an element, such as the
first letter of a paragraph. You can do lots of amazing things with them like wrap
text around images, make several different shapes with a single element or create a
body border.
Pseudo Element Roundup: a useful collection from CSS-Tricks.
Pseudo Elements: W3Schools resource on the subject.

33. Can you explain what Three.js is and quote its key features?_text]Answer:
Three.js is an open-source JavaScript 3D library that allows you to create and
display animated 3D computer graphics in a web browser. This is an API which
uses WebGL to create impressive web demonstrations. And the best part of
Three.js is that you can display all these graphics without depending on exclusive
plug-ins.

Important features of Three.js along with their various functions are:


Renderers: – canvas, svg, WebGL, CSS3D, DOM, Software; effects: stereo,
cross-eyed.
Shaders: – You can completely access GLSL capabilities which include: lens
flare, depth pass and the all-in-one post-processing library.
Scenes: – You can add or delete objects at run-time.
Cameras: – Allows you to make the most of Orthographic and Perspective
controllers like Trackball, FPS and Path.
Lights: – This feature allows you to flip between various lighting options like spot
and point lights, additionally permitting you to cast and receive shadows.
Animations: – You can morph and perform Keyframe operations.
Materials: – Your website can sport a smooth-shading, with various options
coming in the form of textures and sheen. Phong, depth, lambert and face are some
of the capabilities that you can employ.
Objects: – Through this feature, you can create meshes, lines, sprites, ribbons and
particles
Geometry: – Modifiers like tube, lathe and extrude are available along with
facilities to draw geometrical figures like cubes, spheres and cylinders (JAVA
Training Online)
Export/Import: – With this feature, you can work with CTM, Blender, FBX and
OBJ
Debugging: – WebGL Inspector, Stats.js and Three.js inspector are the features
under this head
Loaders: – This feature facilitates JSON, binary, scene, XHR and Image
Support: – You can check out the world of information that is available in the
form of public forum, API documentation and Wiki
After answering the above questions, you may be asked a series of questions
related to CoffeeScript
34. Describe Coffee Script?_text]Answer:
CoffeeScript is a little programming language that compiles into JavaScript. It is an
attempt to exhibit the good parts of JavaScript in a simple way. It also assists to
write JavaScript code better by presenting you with a more constant syntax and
skirting the unusual nature of JavaScript language. (Latest 50 Front End Developer
Interview Questions And Answers)

35. How do you structure your source code to make it easy for leverage by
your colleagues?_text]Answer:
A front-end developer needs to discuss their use of code organization and
commenting. They need to explain how they use notes in their programming
process to explain the steps they have taken, ensuring an efficiency of
understanding amongst collaborators.

36. Explain what is lazy loading?_text]Answer:


Lazy loading is a design pattern generally utilized in computer programming to
delay initialization of an object until the period at which it is required. It can
contribute to performance in the program’s operation if correctly and properly
utilized. Besides, it is a loading code only once the user needs it. For instance,
there is a button on the page, which reveals a different layout once the user pressed
it. Hence, there is no necessary to load code for that layout on initial page load.(e
learninig Portal)
37. How do you organise your front-end development
workflow?_text]Answer:
From initiation to completion, the work of a front-end developer has to go through
the sequence of processes. This path can be passed using various options. There are
many workflow softwares that automates repetitive tasks to some degree to
simplify and speed up work. There are also some tasks that are better to do
manually.

Just as every person has their own tastes, every front-end developer has their own
preferences and priorities regards the workflow. Answers to this question for
frontend developers will provide you with valuable insights into unique
organisational and technical specifics of each developer.

38. What Is The Difference Between Form Get And Form Post?_text]
Answer :
Get:
With GET the form data is encoded into a URL by the browser. The form data is
visible in the URL allowing it to be bookmarked and stored in web history. The
form data is restricted to ASCII codes. Because URL lengths are limited there can
be limitations on how much form data can be sent.

Post:
With POST all the name value pairs are submitted in the message body of the
HTTP request which has no restrictions on the length of the string. The name value
pairs cannot be seen in the web browser bar.

POST and GET correspond to different HTTP requests and they differ in how they
are submitted. Since the data is encoded in differently, different decoding may be
needed.

39. Do You Know What Is A Closure?_text]Answer :


Closures are expressions, usually functions, which can work with variables set
within a certain context. Or, to try and make it easier, inner functions referring to
local variables of its outer function create closures

40. Tell Me Are You Familiar With Jasmine Or Qunit?_text]Answer :


Jasmine and QUnit are JavaScript testing frameworks. I would familiarize yourself
with the basics.(Latest 50 Front End Developer Interview Questions And
Answers)41. How you can optimize the page using front end code or
technology?_text]Answer:
Below is the list of best practices for front-end technology, which helps to
optimize page.
 Improve server response by reducing resource usage per page
 Combine all external CSS files into one file
 Combine all external JS files into one file
 Use responsive design instead of making device based redirects
 Use asynchronous Javascript and remove block level Javascript
 Use Minify version of stylesheet and javascript.
 Optimize Image and use correct format of Image. Use the lazy loading
design pattern for large size of images.
 Use browser side cache with Cache control
 Avoid plugins to drive functionality
 Configure view port and use CSS best practices
 Prioritize visible content
 Load style-sheets in header and script in footer.
42. What is CoffeeScript? What are the Ways in which CoffeeScript is
Superior to JavaScript?_text]Answer:
CoffeeScript is a small programming language that helps you fine tune JavaScript
code. This language which compiles into JavaScript is a perfect alternative to the
irregular syntax of JavaScript. Consistency in syntax is what makes CoffeeScript
superior to JavaScript. Here are the basic rules for CoffeeScript:

Absence of curly braces


Functions that take arguments do not need parentheses
CoffeeScript is a better option compared to JavaScript on account of the following
inherent advantages.

CoffeeScript simplifies your daily programming chores in contrast to JavaScript.


CoffeeScript cuts down on coding requirements and permits you to express your
program with small codes, when compared to JavaScript.
Through CoffeeScript, you can make the most of the lightweight add-ons like
Python style list comprehension and Ruby string interpolation.

43. What are the applications of clone-function in CoffeeScript?_text]Answer:


If you wish to create a completely new object in CoffeeScript, you can rely on the
Clone function. You can do this in the following ways:
You need to copy all the attributes from the source object to the new object
You then need to repeat all the steps of copying attributes from the source object
for all the sub-objects. To perform this function, you need to call the Clone
function
The last step allows you to create a new object similar to the source object.44.
How do floats work?_text]Answer:
The CSS float property is a box that can be shifted left or right horizontally. The
float property has four values: left, right, inherit, and none. If you apply { float:
right; } to an element, it will move to the furthest right of it’s parent element. If
you apply { float: left;} to an element, it will move to the furthest left. { float:
inherit; } causes the element to inherit the float value of its parent.
Floats: more information from W3.org.
CSS Floats 101: a thorough guide on CSS floats.

45. How are the variables of CoffeeScript different from those of


JavaScript?_text]Answer:
In JavaScript, variables need to end with a semi-colon for them to be executed.
However, with CoffeeScript, there is no necessity to add a semi-colon at the end of
every statement. Hence, CoffeeScript simplifies the process of adding a semi-colon
to variables. (Latest 50 Front End Developer Interview Questions And Answers)

46. Explain the importance of the HTML DOCTYPE?_text]Answer:


DOCTYPE is an instruction to the web browser regarding what version of the
markup language the page is written. The DOCTYPE declaration need to be the
pretty first thing in your HTML document, before thetag. Doctype declaration
points to a Document Type Definition (DTD). It provides markup language rules,
so a browser can interpret the content correctly.

47. Explain the difference between classes and IDs?_text]Answer:


Classes and ID selectors, both are utilized as hooks for CSS styles. The ID’s are
commonly used to style elements that only look once on a page, such as one
instance of a navigational menu. The Classes are utilized to style different elements
in the same fashion, such as the presence of links.

48. Explain what is Event Delegation?_text]Answer:


Event delegation points to the process of using event propagation to handle events
at a higher level in the DOM than the element on which the event originated. It
enables you to avoid adding event listeners to particular nodes; instead, you can
add a single event listener to a parent element.

49. How can you increase page performance?_text]Answer:


I can increase the page performance by the following methods.
Clean up the HTML document.
Reduce external HTTP requests.
Sprites, compressed images, smaller images.
Incorporate JavaScript at the bottom of the page.
Minify CSS, JavaScript, HTML.
CDN and Caching.50. Explain how do you deal with browser-specific style
incompatibility?_text]Answer:
There are multiple ways to operate about this. According, the simple way to
proceed would be to utilize a conditional statement in the head tag of your HTML.
In this way, you can recognize the browser and load an external stylesheet.

Conclusion:
Hence, these are the most important front-end developer interview questions and
answers. It will assist you with your just-in-time preparation for that job interview
in front-end development. If we have missed any other important front-end
developer questions, let me know in the comments.

Post navigation
20. What are two common ways in which you can reduce the load time
of a web application?_text]Answer:
There are quite a lot of ways you can reduce load time:
 Enable browser caching
 Optimize images
 Minify resources
 Minimize HTTP Requests
 Reduce redirects
24. Who checks whether the authorized person only can access the
intranet?_text]Answer:
 An intranet of an organization is accessible to employees of that
particular organization only. A software known as firewall is used to
ensure this. Firewall checks whether the authorized person only can
access.
34. Explain how you optimize and reduce web application load
time?_text]Answer:
 Almost half of all users want a web page to load within two seconds.
Ask this question to learn if a candidate is aware of the impact that
page load time has on the user experience, and how a web developer
should analyze data and track improvements to optimize load time.

43: Describe the difference between cookies, session Storage, and local
Storage?_text]Answer:
 Cookies are small text files that websites place in a browser for
tracking or login purposes, and hold a modest amount of data.

 Meanwhile, localStorage and sessionStorage are new objects, both of


which are storage specifications but vary in scope and duration. Local
storage is more secure, and large amounts of data can be stored
locally, without affecting website performance. Futhermore, is it
permanent. sessionStorage only lasts as long as the duration of the
longest open tab.

44. Tell me two common ways in which you can reduce the load time
of a web application that you have written?_text]Answer:
 It will be a good idea to optimize images to no higher than screen
resolution and save it as a compression level which squeezes the size
considerably. Another thing that can be done is to eliminate all
JavaScript files to reduce the amount of transferable data

43. What is the difference between Web Server and Application Server ?
 Answer:
 Webserver:
 A Web server handles the HTTP protocol. When the Web server receives an
HTTP request, it responds with an HTTP response, such as sending back an
HTML page. To process a request, a Web server may respond with a static
HTML page or image, send a redirect, or delegate the dynamic response
generation to some other program such as CGI scripts, JSPs (JavaServer
Pages), servlets, ASPs (Active Server Pages), server-side JavaScripts, or
some other server-side technology. Whatever their purpose, such server-side
programs generate a response, most often in HTML, for viewing in a Web
browser.

 Application Server:
 As for the application server, according to our definition, an application
server exposes business logic to client applications through various
protocols, possibly including HTTP. While a Web server mainly deals with
sending HTML for display in a Web browser, an application server provides
access to business logic for use by client application programs. The
application program can use this logic just as it would call a method on an
object

 Post
Best 38 C# Interview Questions And Answers Pdf
C# Interview Questions And Answers / By Admin

1. What are the fundamental principles of OO programming ?


Answer:
As a developer, you might be tempted to answer that it comprises things like
Encapsulation, Polymorphism, Abstraction, and Inheritance. Although this is true,
it doesn’t really explain the fundamental core of what OO is and what its benefits
are.

Principles are crucial but they are not the most important aspect of what OO
actually is. What is really important is to understand in what grounds OO is built
upon, or in other words, what are the foundations of OO programming.

The two most fundamental core concepts on which OO has been built upon in C#
are this pointer and Dynamic Dispatch.

Obviously, there are principles like Encapsulation, Polymorphism, Abstraction,


and Inheritance, but these are the consequence and not the generating force behind
the OO paradigm in C#.

C# Interview Questions And Answers Pdf

2. Explain Partial Class in C# ?


Answer:
Partial classes concept added in .Net Framework 2.0 and it allows us to split the
business logic in multiple files with the same class name along with “partial”
keyword.

3. What is Thread in C# ?
Answer:
Thread is an execution path of a program. Thread is used to define the different or
unique flow of control. If our application involves some time consuming processes
then it’s better to use Multithreading., which involves multiple threads.

4. What does it mean ?


Answer:
Object Pool is nothing but a container of objects that are ready for use. Whenever
there is a request for a new object, the pool manager will take the request and it
will be served by allocating an object from the pool.

5. How it works ?
Answer:
We are going to use Factory pattern for this purpose. We will have a factory
method, which will take care about the creation of objects. Whenever there is a
request for a new object, the factory method will look into the object pool (we use
Queue object). If there is any object available within the allowed limit, it will
return the object (value object), otherwise a new object will be created and give
you back.

6. What is the difference between early binding and late binding in C# ?


Answer:
Early binding and late binding are the concept of polymorphism. There are two
types of polymorphism in C#.

Compile Time Polymorphism: It is also known as early binding.


Run Time Polymorphism: It is also known as late binding or method overriding or
dynamic polymorphism.

7. What is ArrayList ?
Answer:
ArrayList is a dynamic array. You can add and remove the elements from an
ArrayList at runtime. In the ArrayList, elements are not automatically sorted.

8. What you mean by delegate in C# ?


Answer:
Delegates are type safe pointers unlike function pointers as in C++. Delegate is
used to represent the reference of the methods of some return type and parameters.

C# Interview Questions And Answers Pdf

9. What is a constructor ?
Answer:
A constructor is a class member executed when an instance of the class is created.
The constructor has the same name as the class, and it can be overloaded via
different signatures. Constructors are used for initialization chores.

10. Why are strings in C# immutable ?


Answer:
Immutable means string values cannot be changed once they have been created.
Any modification to a string value results in a completely new string instance, thus
an inefficient use of memory and extraneous garbage collection. The mutable
System.Text.StringBuilder class should be used when string values will change.

11. What is object pool in .Net ?


Answer:
Object pool is a container of ready to use objects. It reduces the overhead of
creating new object.

12. Questions on Looping Statements


The section contains questions on if, while, do while, for, switch, continue and
goto looping statements ?
Answer:
IF Statements
Switch Statements
For Loop Statements While Loop Statements
Do While Loop Statements
Continue, Goto statements

13. What is Garbage Collection ?


Answer:
Garbage Collection is a process of releasing memory automatically occupied by
objects which are no longer accessible.
Describe the basic construction of a C# program. Write a simple program that
outputs “Hello World” to the console.

A typical C# program consists of a namespace declaration, a class, methods,


attributes, a main method, statements, expressions, and comments. A potential
example for printing “Hello World” to the console is detailed below.

using System;
namespace HelloWorldApplication
{
class HelloWorld
{
static void Main(string[] args)
{
Console.WriteLine(“Hello World”);
Console.ReadKey();

14. Questions and Answers on Object Oriented Concepts ?


Answer:
The section contains questions and answers on polymorphism, structures,
enumeration, inheritance, method overloading and method overriding, abstract
class and interface implementation.

Polymorphism
Structures
Enumerations
Fundamentals of Inheritance
Inheritance Implementation
Method Overloading
Method Overriding Constructor Overloading
Abstract Class & Methods
Interfaces Introduction
Interfaces Implementation
Introduction of Overloaded Operators
Recursion

15. What is the difference between dispose() and finalize() methods in C# ?


Answer:
The dispose() method is explicitly called by user to free unmanaged resources such
as files, database connections etc whereas finalize() method is implicitly called by
garbage collector to free unmanaged resources like files, database connections etc.

The dispose() method belongs to IDisposable interface whereas finalize() method


belongs the Object class.

16. What is delegate in C ?


Answer:
A delegate in C# is an object that holds the reference to a method. It is like
function pointer in C++.

C# Interview Questions And Answers Pdf


17. What is the difference between dynamic type variables and object type
variables in C# ?
Answer:
The difference between dynamic and object type variables has to do with when the
type checking takes place during the application lifecycle. Dynamic type variables
handle type checking at run time, while object type variables handle type checking
during compile time.
18. Explain nullable types in C# ?
Answer:
Nullable types are data types that, in addition to their normal values, also contain a
defined data type for null. Nullable types exist to help integrate C#, which
generally works with value types, and databases, which often use null values. You
can declare a nullable type in C# using the following syntax:

19. What is Managed and Un managed code ?


Answer:
Managed code is a code which is executed by CLR (Common Language Runtime)
i.e all application code based on .Net Platform. It is considered as managed
because of the .Net framework which internally uses the garbage collector to clear
up the unused memory.

Unmanaged code is any code that is executed by application runtime of any other
framework apart from .Net. The application runtime will take care of memory,
security and other performance operations.

20. Questions and Answers on Data Types, Variables and Operators ?


Answer:
The section contains questions and answers on integer, float, decimal and character
data types, variable initialization, their scope and lifetime, arithmetic, relational,
logical, bitwise and conditional operators.
Integer Data Types
Floating and Decimal Data Types
Char Types and String Literals
Initialization of Variables
Scope and Lifetime of Variables Type Conversion in Expressions
Arithmetic Operators
Relational and Logical Operators
Bit-wise and Conditional Operators
21. Questions and Answers on Miscellaneous topics ?
Answer:
The section contains questions and answers on basics of pointers and their
operation, accessor controls and string formatting.

Unsafe Code & Pointers Basics


Pointers Operation – 1
Pointers Operation – 2
Accessor Controls of Class Introduction of String Formatting
String Formatting – 1
String Formatting – 2
If you like to learn C# thoroughly, you should attempt to work on the complete set
of C# questions and answers mentioned above. It will immensely help anyone
trying to crack a C# code or an interview.
Here’s the list of Best Reference Books in C# Programming Language.

22. Questions and Answers on Reflections, Multithreaded Programming,


Collection Classes and Mathematical Functions ?
Answer:
The section contains questions and answers on collection framework, mathematical
classes, rounding functions, iterators and multithreaded programming.

Introduction of Reflections
Collection Classes
Maths Class
Rounding Functions in C# Multi-threaded Programming – 1
Multi-threaded Programming – 2
Iterators

23. what is the solution if you need to manipulate sets of items ?


Answer:
One solution would be to create a variable for each item in the set but again this
leads to a different problem

24. How many variables do you need ?


Answer:
So in this situation Arrays provide mechanisms that solves problem posed by these
questions. An array is a collection of related items, either value or reference type.
In C# arrays are immutable such that the number of dimensions and size of the
array are fixed.

Arrays Overview

An array contains zero or more items called elements. An array is an unordered


sequence of elements. All the elements in an array are of the same type (unlike
fields in a class that can be of different types). The elements of an array accessed
using an integer index that always starts from zero. C# supports single-dimensional
(vectors), multidimensional and jagged arrays.

Elements are identified by indexes relative to the beginning of the arrays. An index
is also commonly called indices or subscripts and are placed inside the indexing
operator ([]). Access to array elements is by their index value that ranges from 0 to
(length-1).

Array Properties

The length cannot be changed once created.


Elements are initialized to default values.
Arrays are reference types and are instances of System.Array.
Their number of dimensions or ranks can be determined by the Rank property.
An array length can be determined by the GetLength() method or Length property.

C# Interview Questions And Answers Pdf

25. What is Parsing? How to Parse a Date Time String ?


Answer:
Parsing is converting a string into another data type.

For Example:

string text = “500”;

int num = int.Parse(text);

500 is an integer. So, Parse method converts the string 500 into its own base type,
i.e int.
Follow the same method to convert a DateTime string.
string dateTime = “Jan 1, 2018”;
DateTime parsedValue = DateTime.Parse(dateTime).

26. What are the collection types can be used in C# ?


Answer:
Below are the collection types in C# –

ArrayList
Stack
Queue
SortedList
HashTable
Bit Array

27. Explain Attributes in C# ?


Answer:
Attributes are used to convey the info for runtime about the behavior of elements
like – “methods”, “classes”, “enums” etc.
Attributes can be used to add metadata like – comments, classes, compiler
instruction etc.
28. Name some properties of Thread Class ?
Answer:
Few Properties of thread class are:

IsAlive – contains value True when a thread is Active.


Name – Can return the name of the thread. Also, can set a name for the thread.
Priority – returns the prioritized value of the task set by the operating system.
IsBackground – gets or sets a value which indicates whether a thread should be a
background process or foreground.
ThreadState– describes the thread state.
29. List out the differences between Array and ArrayList in C# ?
Answer:
Array stores the values or elements of same data type but arraylist stores values of
different datatypes.
Arrays will use the fixed length but arraylist does not uses fixed length like array.

30. Why to use “using” in C# ?


Answer:
“Using” statement calls – “dispose” method internally, whenever any exception
occurred in any method call and in “Using” statement objects are read only and
cannot be reassignable or modifiable.

31. Explain namespaces in C# ?


Answer:
Namespaces are containers for the classes. We will use namespaces for grouping
the related classes in C#. “Using” keyword can be used for using the namespace in
other namespace.

32.List out two different types of errors in C# ?


Answer:
Below are the types of errors in C# –
Compile Time Error
Run Time Error

C# Interview Questions And Answers Pdf

33. What are the differences between static, public and void in C# ?
Answer:
Static classes/methods/variables are accessible throughout the application without
creating instance. Compiler will store the method address as an entry point.
Public methods or variables are accessible throughout the application.
Void is used for the methods to indicate it will not return any value.

34. Do we get error while executing “finally” block in C# ?


Answer:
Yes. We may get error in finally block.

35. What is the difference between “out” and “ref” parameters in C# ?


Answer:
“out” parameter can be passed to a method and it need not be initialized where as
“ref” parameter has to be initialized before it is used.

36. Explain Jagged Arrays in C# ?


Answer:
If the elements of an array is an array then it’s called as jagged array. The elements
can be of different sizes and dimensions.
37. What are the differences between events and delegates in C# ?
Answer:
Main difference between event and delegate is event will provide one more of
encapsulation over delegates. So when you are using events destination will listen
to it but delegates are naked, which works in subscriber/destination model.

38. What is a Generic Class ?


Answer:
Generics or Generic class is used to create classes or objects which do not have any
specific data type. The data type can be assigned during runtime, i.e when it is used
in the program.

For Example:

Generic Class

So, from the above code, we see 2 compare methods initially, to compare string
and int.

In case of other data type parameter comparisons, instead of creating many


overloaded methods, we can create a generic class and pass a substitute data type,
i.e T. So, T acts as a datatype until it is used specifically in the Main() method.

Post navigation
2018 Latest Dot Net Interview Questions And Answers Pdf
Dot Net Interview Questions / By Admin

1. What is the managed and unmanaged code in .net ?


Answer:
The .NET Framework provides a run-time environment called the Common
Language Runtime, which manages the execution of code and provides services
that make the development process easier. Compilers and tools expose the
runtime’s functionality and enable you to write code that benefits from this
managed execution environment. Code that you develop with a language compiler
that targets the runtime is called managed code; it benefits from features such as
cross-language integration, cross-language exception handling, enhanced security,
versioning and deployment support, a simplified model for component interaction,
and debugging and profiling services.
2. What are the memory-mapped files ?
Answer:
Memory-mapped files are used to map the content of a file to the logical address of
an application. It makes you able to run multiple process on the same machine to
share data with each other. To obtain a memory mapped file object, you can use
the method MemoryMappedFile.CreateFromFiles( ). It represents a persistent
memory-mapped file from a file on disk.

3. Explain GridView control in ASP.NET ?


Answer:
The GridView control displays the values of a data source in a table. Each column
represents a field, while each row represents a record. The GridView control
supports the following features:

Binding to data source controls, such as SqlDataSource.


Built-in sort capabilities.
Built-in update and delete capabilities.
Built-in paging capabilities.
Built-in row selection capabilities.
Programmatic access to the GridView object model to dynamically set properties,
handle events, and so on.
Multiple key fields.
Multiple data fields for the hyperlink columns.
Customizable appearance through themes and styles.
Creating a GridView

4. What is the difference between ASP.NET Web API and WCF ?


Answer:
The ASP. NET Web API is a framework that uses the HTTP services and makes it
easy to provide the response to the client request. The response depends on the
request of the clients. The Web API builds the HTTP services, and handles the
request using the HTTP protocols. The request may be GET, POST, DELETE,
PUT. We can also say that the ASP. NET Web API:

Is an HTTP service.
Is designed for reaching the broad range of clients.
Uses the HTTP application.
We use the ASP. NET Web API for creating the REST ful (Representational State
Transfer) services.
The following are some important points of the ASP. NET Web API:

The ASP. NET Web API supports the MVC application features that are
controller, media formatters, routing etcetera.
It is a platform for creating the REST services.
It is a framework for creating the HTTP services.
Responses can be formatted by the APIs MediaTypeFormatter into the Java Script
Object Notation (JSON) and Extencible Markup Language (XML) formats.

5. What are the defining traits of an object-oriented language ?


Answer:
The defining traits of an object-oriented language are:
a) Inheritance
b) Abstraction
c) Encapsulation
d) Polymorphism

Inheritance: The main class or the root class is called as a Base Class. Any class
which is expected to have ALL properties of the base class along with its own is
called as a Derived class. The process of deriving such a class is Derived class.

Abstraction: Abstraction is creating models or classes of some broad concept.


Abstraction can be achieved through Inheritance or even Composition.
Encapsulation: Encapsulation is a collection of functions of a class and object. The
“Food” class is an encapsulated form. It is achieved by specifying which class can
use which members (private, public, protected) of an object.

Polymorphism: Polymorphism means existing in different forms. Inheritance is an


example of Polymorphism. A base class exists in different forms as derived
classes. Operator overloading is an example of Polymorphism in which an operator
can be applied in different situations.

6. What is a CLS (Common Language Specification) ?


Answer:
CLS is a specification that defines the rules to support language integration. This is
done in such a way, that programs written in any language (.NET compliant) can
communicate with one another. This also can take full advantage of inheritance,
polymorphism, exceptions, and other features. This is a subset of the CTS, which
all .NET languages are expected to support.
7. How can we apply themes in ASP.NET application ?
Answer:
A theme is a collection of settings that define the look of controls and web pages.
These themes are applied across all the pages in a web application to maintain a
consistent appearance. Themes are included images and skin files; the skin files set
the visual properties of ASP.NET controls. Themes are of two types:

Page Theme

A Page theme contains the control skins, style sheets, graphic files, and other
resources inside the subfolder of the App_Theme folder in the Solution Explorer
window. A page theme is applied to a single page of the web site.

Global Theme

A Global theme is a theme that is applied to all the web sites on a web server and
includes property settings, and graphics. This theme allows us to maintain all the
websites on the same web server and define the same style for all the web pages of
the web sites.

8. Which method do you use to enforce garbage collection in .NET ?


Answer:
The System.GC.Collect() method.

9. What are the different types of indexes in .Net ?


Answer:
There are two types of indexes in .Net:

Clustered index and non-clustered index

10. How can you identify that the page is post back ?
Answer:
There is a property, named as “IsPostBack” property. You can check it to know
that the page is post backed or not.

11. What is the full form of ADO ?


Answer:
The full form of ADO is ActiveX Data Object.
12. What is Click Once ?
Answer:
ClickOnce is a new deployment technology that allows you to create and publish
self-updating applications that can be installed and run with minimal user
interaction.

BEST 36 Cognos Framework Manager Interview Questions


13. What is Ajax in ASP.NET ?
Answer:
Ajax stands for Asynchronous JavaScript and XML; in other words Ajax is the
combination of various technologies such as a JavaScript, CSS, XHTML, DOM,
etc.

AJAX allows web pages to be updated asynchronously by exchanging small


amounts of data with the server behind the scenes. This means that it is possible to
update parts of a web page, without reloading the entire page.

We can also define Ajax is a combination of client side technologies that provides
asynchronous communication between the user interface and the web server so that
partial page rendering occurs instead of complete page post back.

Ajax is platform-independent; in other words AJAX is a cross-platform technology


that can be used on any Operating System since it is based on XML & JavaScript.
It also supports open source implementation of other technology. It partially
renders the page to the server instead of complete page post back. We use AJAX
for developing faster, better and more interactive web applications. AJAX uses a
HTTP request between web server & browser.

With AJAX, when a user clicks a button, you can use JavaScript and DHTML to
immediately update the UI, and spawn an asynchronous request to the server to
fetch results.
When the response is generated, you can then use JavaScript and CSS to update
your UI accordingly without refreshing the entire page. While this is happening,
the form on the users screen doesn’t flash, blink, disappear, or stall.

The power of AJAX lies in its ability to communicate with the server
asynchronously, using a XMLHttpRequest object without requiring a browser
refresh.
Ajax essentially puts JavaScript technology and the XMLHttpRequest object
between your Web form and the server.

14. What is the global assembly cache (GAC) ?


Answer:
GAC is a machine-wide cache of assemblies that allows .NET applications to share
libraries. GAC solves some of the problems associated with dll’s (DLL Hell).

15. What is the use of Error Provider Control in .NET ?


Answer:
The ErrorProvider control is used to indicate invalid data on a data entry form.
Using this control, you can attach error messages that display next to the control
when the data is invalid, as seen in the following image. A red circle with an
exclamation point blinks, and when the user mouses over the icon, the error
message is displayed as a tooltip.

16. What is the PostBack property in ASP.NET ?


Answer:
If we create a web Page, which consists of one or more Web Controls that are
configured to use AutoPostBack (Every Web controls will have their own
AutoPostBack property), the ASP.NET adds a special JavaScipt function to the
rendered HTML Page. This function is named _doPostBack() . When Called, it
triggers a PostBack, sending data back to the web Server.

ASP.NET also adds two additional hidden input fields that are used to pass
information back to the server. This information consists of ID of the Control that
raised the event and any additional information if needed. These fields will empty
initially as shown below,

The following actions will be taken place when a user changes a control that has
the AutoPostBack property set to true:

On the client side, the JavaScript _doPostBack function is invoked, and the page is
resubmitted to the server.
ASP.NET re-creates the Page object using the .aspx file.
ASP.NET retrieves state information from the hidden view state field and updates
the controls accordingly.
The Page.Load event is fired.
The appropriate change event is fired for the control. (If more than one control has
been changed, the order of change events is undetermined.)
The Page.PreRender event fires, and the page is rendered (transformed from a set
of objects to an HTML page).
Finally, the Page.Unload event is fired.
The new page is sent to the client.

17. Explain Cookie-less Session in ASP.NET ?


Answer:
By default a session uses a cookie in the background. To enable a cookie-less
session, we need to change some configuration in the Web.Config file. Follow
these steps:

Open Web.Config file.


Add a tag under tag.
Add an attribute “cookieless” in the tag and set its value to “AutoDetect” like
below:

The possible values for “cookieless” attribute are:

AutoDetect: Session uses background cookie if cookies are enabled. If cookies are
disabled, then the URL is used to store session information.

UseCookie: Session always use background cookie. This is default.

UseDeviceProfile: Session uses background cookie if browser supports cookies


else URL is used.

UseUri: Session always use URL.


“regenerateExpiredSessionId” is used to ensure that if a cookieless url is expired a
new new url is created with a new session. And if the same cookieless url is being
used by multiple users an the same time, they all get a new regenerated session url.

18. How is it possible for .NET to support many languages ?


Answer:
The .NET language code is compiled to Microsoft Intermediate Language (MSIL).
The generated code is called managed code. This managed code is run in .NET
environment. So after compilation the language is not a barrier and the code can
call or use function of another language also.
19. What is Themes in ASP.NET ?
Answer:
A theme decides the look and feel of the website. It is a collection of files that
define the looks of a page. It can include skin files, CSS files & images.

We define themes in a special App_Themes folder. Inside this folder is one or


more subfolders named Theme1, Theme2 etc. that define the actual themes. The
theme property is applied late in the page’s life cycle, effectively overriding any
customization you may have for individual controls on your page.

How to apply themes

There are 3 different options to apply themes to our website:

Setting the theme at the page level: the Theme attribute is added to the page
directive of the page.
<%@ Page Language=”C#” AutoEventWireup=”true”
CodeFile=”Default.aspx.cs”Inherits=”Default” Theme=”Theme1″%>
Setting the theme at the site level: to set the theme for the entire website you can
set the theme in the web.config of the website. Open the web.config file and locate
the element and add the theme attribute to it:
….
….
Setting the theme programmatically at runtime: here the theme is set at runtime
through coding. It should be applied earlier in the page’s life cycle ie. Page_PreInit
event should be handled for setting the theme. The better option is to apply this to
the Base page class of the site as every page in the site inherits from this class.
Page.Theme = Theme1;
Uses of Themes

Since themes can contain CSS files, images and skins, you can change colors,
fonts, positioning and images simply by applying the desired themes.

You can have as many themes as you want and you can switch between them by
setting a single attribute in the web.config file or an individual aspx page. Also you
can switch between themes programmatically.
Setting the themes programmatically, you are offering your users a quick and easy
way to change the page to their likings.

Themes allow you to improve the usability of your site by giving users with vision
problems the option to select a high contrast theme with a large font size.

20. What are the Navigations technique in ASP.NET ?


Answer:
Navigation can cause data loss if it not properly handled. We do have many
techniques to transfer data from one page to another but every technique has its
own importance and benefits.

We will discuss the following techniques in this article.

Response.Redirect
Server.Transfer
Server.Exceute
Cross page posting

21. What is master page in ASP.NET ?


Answer:
The extension of MasterPage is ‘.master’. MasterPage cannot be directly accessed
from the client because it just acts as a template for the other Content Pages. In a
MasterPage we can have content either inside ContentPlaceHolder or outside it.
Only content inside the ContentPlaceHolder can be customized in the Content
Page. We can have multiple masters in one web application.A MasterPage can
have another MasterPage as Master to it. The MasterPageFile property of a
webform can be set dynamically and it should be done either in or before the
Page_PreInit event of the WebForm. Page.MasterPageFile = “MasterPage.master”.
The dynamically set Master Page must have the ContentPlaceHolder whose
content has been customized in the WebForm.

A master page is defined using the following code:

<%@ master language=”C#” %>

Adding a MasterPage to the Project


Add a new MasterPage file (MainMaster.master) to the Web Application.
Change the Id of ContentPlaceHolder into “cphHead” and the Id
“ContentPlaceHolder1” to “cphFirst”.Add one more ContentPlaceHolder
(cphSecond) to Master page.To the master page add some header, footer and some
default content for both the content place holders.
Header…This is First Content Place Holder (Default) </asp: ContentPlaceHolder>

This is Second Content Place Holder (Default).

Footer…

22. What is tracing in .NET ?


Answer:
Tracing helps to see the information of issues at the runtime of the application. By
default Tracing is disabled.

Tracing has the following important features:

We can see the execution path of the page and application using the debug
statement.
We can access and manipulate trace messages programmatically.
We can see the most recent tracing of the data.
Tracing can be done with the following 2 types.

Page Level: When the trace output is displayed on the page and for the page-level
tracing we need to set the property of tracing at the page level.

<%@ Page Trace=”true” Language=”C#” Application: Level: In Application-


Level tracing the information is stored for each request of the application. The
default number of requests to store is 10. But if you want to increase the number of
requests and discard the older request and display a recent request then you need to
set the property in the web.config file.

23. What are the data controls available in ASP.NET ?


Answer:
The Controls having DataSource Property are called Data Controls in ASP.NET.
ASP.NET allows powerful feature of data binding, you can bind any server control
to simple properties, collections, expressions and/or methods. When you use data
binding, you have more flexibility when you use data from a database or other
means. Data Bind controls are container controls. Controls -> Child Control

Data Binding is binding controls to data from databases. With data binding we can
bind a control to a particular column in a table from the database or we can bind
the whole table to the data grid. (svr technologies)
Data binding provides simple, convenient, and powerful way to create a read/write
link between the controls on a form and the data in their application.

Data binding allows you to take the results of properties, collection, method calls,
and database queries and integrate them with your ASP.NET code. You can
combine data binding with Web control rendering to relieve much of the
programming burden surrounding Web control creation. You can also use data
binding with ADO.NET and Web controls to populate control contents from SQL
select statements or stored procedures.

Data binding uses a special syntax:

The <%#, which instructs ASP.NET to evaluate the expression. The difference
between a data binding tags and a regular code insertion tags <% and %> becomes
apparent when the expression is evaluated. Expressions within the data binding
tags are evaluated only when the DataBind method in the Page objects or Web
control is called.

Data Bind Control can display data in connected and disconnected model.

Following are data bind controls in ASP.NET:

Repeater Control
DataGrid Control
DataList Control
GridView Control
DetailsView
FormView
DropDownList
ListBox
RadioButtonList
CheckBoxList
BulletList etc.

24. What is WebParts in ASP.NET ?


Answer:
ASP.NET 2.0 incorporates the concept of WEB PARTS in itself and we can code
and explore that as easily as we have done with the other controls in the previous
sessions.

We can compose web parts pages from “web parts”, which can be web controls,
user controls.

Component of Web Parts:

The web parts consist of different components like:

Web Part Manager


Web Part Zone
CatLog Part
CatLog Zone
Connections Zone
Editor Part
Editor Zone
Web Part Zone

Web Part Zone can contain one or more Web Part controls.
This provides the layout for the Controls it contains. A single ASPX page can
contain one or more Web Part Zones.
A Web Part Control can be any of the controls in the toolbox or even the
customized user controls.

25. What is the meaning of Immutable ?


Answer:
Immutable means once you create a thing, you cannot modify it.

For example: If you want give new value to old value then it will discard the old
value and create new instance in memory to hold the new value.
26. What are the various objects in Data set ?
Answer:
The DataSet class exists in the System.Data namespace.
The Classes contained in the DataSet class are:
a) DataTable
b) DataColumn
c) DataRow
d) Constraint
e) DataRelation

27. What are the advantages of using session ?


Answer:
The advantages of using session are:

A session stores user states and data to all over the application.
It is very easy to implement and we can store any kind of object.
It can store every user data separately.
Session is secure and transparent from user because session object is stored on the
server.

28. What are the disadvantages of using session ?


Answer:
The disadvantages of using session are:

Performance overhead occurs in case of large number of users, because session


data is stored in server memory.
Overhead involved in serializing and De-Serializing session Data. Because In case
of StateServer and SQLServer session mode we need to serialize the object before
store.

29. What is Data Cache in ASP.NET and how to use ?


Answer:
Data Cache is used to store frequently used data in the Cache memory. It’s much
efficient to retrieve data from the data cache instead of database or other sources.
We need to use System.Web.Caching namespace. The scope of the data caching is
within the application domain unlike “session”. Every user is able to access this
object.
When client request to the server, server execute the stored procedure or function
or select statements on the Sql Server database then it returns the response to the
browser. If we run again same process will happen on the web server with sql
server.

30. How to create data cache ?


Answer:
Cache [“Employee”] = “DataSet Name”

We can create data caching use Cache Keyword. It’s located in the
System.Web.Caching namespace. It’s just like assigning value to the variable.

31. How to remove a Data Cache ?


Answer:
We can remove Data Cache manually.

//We need to specify the cache name


Cache.Remove(String key);

32. Enterprise Library in ASP.NET ?


Answer:
Enterprise Library: It is a collection of application blocks and core infrastructure.
Enterprise library is the reusable software component designed for assisting the
software developers.

We use the Enterprise Library when we want to build application blocks intended
for the use of developers who create complex enterprise level application.
Enterprise Library Application Blocks

Security Application Block

Security Application Block provide developers to incorporate security


functionality in the application. This application can use various blocks such as
authenticating and authorizing users against the database.

Exception Handling Application Block


This block provides the developers to create consistency for processing the error
that occur throughout the layers of Enterprise Application.

Cryptography Application Block

Cryptography application blocks provides developers to add encryption and


hashing functionality in the applications.

Caching Application Block

Caching Application Block allows developers to incorporate local cache in the


applications.

33. What is an application server ?


Answer:
As defined in Wikipedia, an application server is a software engine that delivers
applications to client computers or devices. The application server runs your server
code. Some well known application servers are IIS (Microsoft), WebLogic Server
(BEA), JBoss (Red Hat), WebSphere (IBM).

Compare C# and VB.NET

A detailed comparison can be found over here.

34. What is a base class and derived class ?


Answer:
A class is a template for creating an object. The class from which other classes
derive fundamental functionality is called a base class. For e.g. If Class Y derives
from Class X, then Class X is a base class.

The class which derives functionality from a base class is called a derived class. If
Class Y derives from Class X, then Class Y is a derived class.

35. What is the state management in ASP.NET ?


Answer:
State management is a technique that is used to manage a state of an object on
different request. It is very important to manage state in any web application. There
are two types of state management systems in ASP.NET.
Client side state management
Server side state management

36. How do you check whether a DataReader is closed or opened ?


Answer:
There is a property named “IsClosed” property is used to check whether a
DataReader is closed or opened. This property returns a true value if a Data Reader
is closed, otherwise a false value is returned.
37. Which adapter should be used to get the data from an Access database ?
Answer:
OleDbDataAdapter is used to get the data from an Access database.

Introduction to ASP.NET

38. What are the different validators in ASP.NET ?


Answer:
ASP.NET validation controls define an important role in validating the user input
data. Whenever the user gives the input, it must always be validated before sending
it across to various layers of an application. If we get the user input with validation,
then chances are that we are sending the wrong data. So, validation is a good idea
to do whenever we are taking input from the user.

There are the following two types of validation in ASP.NET:

Client-Side Validation
Server-Side Validation
Client-Side Validation:

When validation is done on the client browser, then it is known as Client-Side


Validation. We use JavaScript to do the Client-Side Validation.

Server-Side Validation:

When validation occurs on the server, then it is known as Server-Side Validation.


Server-Side Validation is a secure form of validation. The main advantage of
Server-Side Validation is if the user somehow bypasses the Client-Side Validation,
we can still catch the problem on server-side.
The following are the Validation Controls in ASP.NET:

RequiredFieldValidator Control
CompareValidator Control
RangeValidator Control
RegularExpressionValidator Control
CustomFieldValidator Control
ValidationSummary

39. What are the basic requirements for connection pooling ?


Answer:
The following two requirements must be fulfilled for connection pooling:

There must be multiple processes to share the same connection describing the same
parameters and security settings.
The connection string must be identical.

RegularExpressionValidator Control
CustomFieldValidator Control
ValidationSummary

40. What is an application server ?


Answer:
As defined in Wikipedia, an application server is a software engine that delivers
applications to client computers or devices. The application server runs your server
code. Some well known application servers are IIS (Microsoft), WebLogic Server
(BEA), JBoss (Red Hat), WebSphere (IBM).

41. Which are the new features added in .NET framework 4.0 ?
Answer:
A list of new features of .NET Framework 4.0:

Improved Application Compatibility and Deployment Support


Dynamic Language Runtime
Managed Extensibility Framework
Parallel Programming framework
Improved Security Model
Networking Improvements
Improved Core ASP.NET Services
Improvements in WPF 4
Improved Entity Framework (EF)
Integration between WCF and WF

42. What are the disadvantages of cookies ?


Answer:
The main disadvantages of cookies are:

Cookie can store only string value.


Cookies are browser dependent.
Cookies are not secure.
Cookies can store only small amount of data.

43. What is an IL ?
Answer:
IL stands for Intermediate Language. It is also known as MSIL (Microsoft
Intermediate Language) or CIL (Common Intermediate Language).
All .NET source codes are first compiled to IL. Then, IL is converted to machine
code at the point where the software is installed, or at run-time by a Just-In-Time
(JIT) compiler.

44. What is View State ?


Answer:
View State is the method to preserve the Value of the Page and Controls between
round trips. It is a Page-Level State Management technique. View State is turned
on by default and normally serializes the data in every control on the page
regardless of whether it is actually used during a post-back.
A web application is stateless. That means that a new instance of a page is created
every time when we make a request to the server to get the page and after the
round trip our page has been lost immediately

Features of View State

These are the main features of view state:


Retains the value of the Control after post-back without using a session.
Stores the value of Pages and Control Properties defined in the page.
Creates a custom View State Provider that lets you store View State Information in
a SQL Server Database or in another data store.
Advantages of View State

Easy to Implement.
No server resources are required: The View State is contained in a structure within
the page load.
Enhanced security features: It can be encoded and compressed or Unicode
implementation.

45. What is the difference between trace and debug ?


Answer:
Debug class is used to debug builds while Trace is used for both debug and release
builds.

46. What are the different Session state management options available in
ASP.NET ?
Answer:
State Management in ASP.NET

A new instance of the Web page class is created each time the page is posted to the
server.

In traditional Web programming, all information that is associated with the page,
along with the controls on the page, would be lost with each roundtrip.

The Microsoft ASP.NET framework includes several options to help you preserve
data on both a per-page basis and an application-wide basis.
These options can be broadly divided into the following two categories:

Client-Side State Management Options


Server-Side State Management Options
Client-Side State Management

Client-based options involve storing information either in the page or on the client
computer.

Some client-based state management options are:


Hidden fields
View state
Cookies
Query strings
Server-Side State Management

There are situations where you need to store the state information on the server
side.

Server-side state management enables you to manage application-related and


session-related information on the server.

ASP.NET provides the following options to manage state at the server side:

Application state
Session state
State Management
oth debug and release builds.

47. What is implementation and interface inheritance ?


Answer:
When a class (type) is derived from another class(type) such that it inherits all the
members of the base type it is Implementation Inheritance.

When a type (class or a struct) inherits only the signatures of the functions from
another type it is Interface Inheritance.

In general Classes can be derived from another class, hence support


Implementation inheritance. At the same time Classes can also be derived from one
or more interfaces. Hence they support Interface inheritance.

Source: Exforsys.

48. How do you prevent a class from being inherited ?


Answer:
In VB.NET you use the NotInheritable modifier to prevent programmers from
using the class as a base class. In C#, use the sealed keyword.
49. Explain Different Types of Constructors in C# ?
Answer:
There are four different types of constructors you can write in a class –

1. Default Constructor

2. Parameterized Constructor

3. Copy Constructor

4. Static Constructor

50. What are design patterns ?


Answer:
Design patterns are common solutions to common design problems.

51. What is a connection pool ?


Answer:
A connection pool is a ‘collection of connections’ which are shared between the
clients requesting one. Once the connection is closed, it returns back to the pool.
This allows the connections to be reused.

52. What is business logic ?


Answer:
A connection pool is a ‘collection of connections’ which are shared between the
clients requesting one. Once the connection is closed, it returns back to the pool.
This allows the connections to be reused.

Post navigation
1. What is BCP ? When does it used ? (Top 50 Sql Server Dba Interview
Questions And Answers Pdf)
Answer :
BulkCopy is a tool used to copy huge amount of data from tables and
views. BCP does not copy the structures same as source to destination.
BULK INSERT command helps to import a data file into a database table or
view in a user-specified format.
Top 50 Sql Server Dba Interview Questions And Answers Pdf

2. When would you use it ?


Answer :
An execution plan is basically a road map that graphically or textually shows
the data retrieval methods chosen by the SQL Server query optimizer for a
stored procedure or ad- hoc query and is a very useful tool for a developer
to understand the performance characteristics of a query or stored
procedure since the plan is the one that SQL Server will place in its cache
and use to execute the stored procedure or query. From within Query
Analyzer is an option called “Show Execution Plan” (located on the Query
drop-down menu). If this option is turned on it will display query execution
plan in separate window when query is ran again.

3. How to implement one-to-one, one-to-many and many-to-many


relationships while designing tables ?
Answer :
One-to-One relationship can be implemented as a single table and rarely as
two tables with primary and foreign key relationships. One-to-Many
relationships are implemented by splitting the data into two tables with
primary key and foreign key relationships. Many-to-Many relationships are
implemented using a junction table with the keys from both the tables
forming the composite primary key of the junction table.

Top 50 Sql Server Dba Interview Questions And Answers Pdf

4. Explain primary key in Sql Server ?


Answer :
This is the combination of fields/columns which are used to uniquely
specify a row. Primary Key has a unique constraint defined on the column
and the value in the column cannot be NULL.

5. Explain foreign key in Sql Server ?


Answer :
Foreign key is used to establish a relationship between the columns of
other table. Foreign key relationship to be created between two tables by
referencing a column of the table to primary key of another table.

6. What are the difference between “Where” and “Having” clause in


Sql Server ?
Answer :
“Where” clause is used to filter the rows based on condition. “Having”
clause used with SELECT clause and this is used with GROUP BY clause. If
GROUP BY clause not used then “HAVING” clause works like a “WHERE”
clause. Top 50 Sql Server Dba Interview Questions And Answers Pdf

7. What is Magic Tables in SQL Server ?


Answer :
The MAGIC tables are automatically created and dropped, in case you use
TRIGGERS. SQL Server has two magic tables named, INSERTED and
DELETED
These are mantained by SQL server for there Internal processing. When we
use update insert or delete on tables these magic tables are used.These are
not physical tables but are Internal tables.When ever we use insert
statement is fired the Inserted table is populated with newly inserted Row
and when ever delete statement is fired the Deleted table is populated with
the delete
d row.But in case of update statement is fired both Inserted and Deleted
table used for records the Original row before updation get store in
Deleted table and new row Updated get store in Inserted table.

8. List out the different types of locks available in Sql Server ?


Answer :
Below are the list of locks available in Sql Server –
Update Locks
Shared Locks
Exclusive Locks
Top 50 Sql Server Dba Interview Questions And Answers Pdf

9. What is recursive stored procedure in Sql Server ?


Answer :
Recursive stored procedure is the stored procedure called as child stored
procedure inside the parent or main stored procedure. This can be done
easily in Sql Server by using “EXEC” keyword in a stored procedure. For
example
Create Procedure SP_Test
AS
BEGIN
EXEC sp_Child @params
END

Top 50 Sql Server Dba Interview Questions And Answers Pdf

10. How the authentication mode can be changed ?


Answer :
Authentication mode can be changed using following steps –
Start -> Programs -> Microsoft SQL Server -> “SQL Enterprise Manager”
and run SQL Enterprise Manager.

11. What are the new features in SQL Server 2005 when compared to
SQL Server 2000 ?
Answer :
There are quite a lot of changes and enhancements in SQL Server 2005. Few
of them are listed here :
Database Partitioning
Dynamic Management Views
System Catalog Views
Resource Database
Database Snapshots
SQL Server Integration Services
Support for Analysis Services on a a Failover Cluster.
Profiler being able to trace the MDX queries of the Analysis Server.
Peer-to Peer Replication
Database Mirroring

12. How to get @@ERROR and @@ROWCOUNT at the same time ?


Answer :
If @@Rowcount is checked after Error checking statement then it will have
0 as the value of @@Recordcount as it would have been reset. And if
@@Recordcount is checked before the error-checking statement then
@@Error would get reset. To get @@error and @@rowcount at the same
time do both in same statement and store them in local variable.

13. Explain Sql server authentication modes ?


Answer :
Below are the two authentication modes of sql server –
Mixed Mode
Windows Mode

Top 50 Sql Server Dba Interview Questions And Answers Pdf

14. What does man by SQL Wildcard Characters in Sql Serve ?


Answer :
WildCard Characters are used with “LIKE” operator in Sql Server. Wildcards
are used for data retrieval process from the table. Some of the wildcards
are
“-“ – This is used for substituting a single character.
“%” – This is used for substituting zero or more characters.
[list of chars] – Ranges of characters for matching.

15. Explain Indexing and what are the advantages of it ?


Answer :
Indexing contains pointers to the data in a table. Indexes are created in a
table to retrieve the data quickly. So Indexing improves the performance as
the retrieval of data takes less time. Indexing will be done for columns
which are being used more often while retrieving.

Top 50 Sql Server Dba Interview Questions And Answers Pdf

16. Explain “NOT NULL Constraint” in Sql Server ?


Answer :
“NOT NULL Constraint” is used in a column to make sure the value in the
column is not null. If this constraint has not set then by default columns will
accept NULL values too.

Top 50 Sql Server Dba Interview Questions And Answers Pdf

17. Why to use Sub Query in Sql Server and List out types of Sub
Queries ?
Answer :
Sub Queries are queries within a query. The parent or outer query is being
called as main query and the inner query is called as inner query or sub
query. Different types of Sub Queries are
Correlated – It is not an independent subquery. It is an inner query which is
referred by outer query.
Non Correlated – It is an independent subquery. It can be executed even
without outer query.

18. What are user defined functions (UDFs) in Sql Server ?


Answer :
User Defined functions are being used to handle complex queries.
There are two types of user defined functions –
Scalar – This type of functions are used for returning single scalar value.
Table Valued – This type of function are used for returning a table which
has list of rows. Sql supports data type called table which is used here for
returning a table.

19. List out difference between Union and Union All in Sql Server ?
Answer :
Union is used to combine all result sets and it removes the duplicate
records from the final result set obtained unlike Union All which returns all
the rows irrespective of whether rows are being duplicated or not.
Union checks the number of columns given in the SELECT statement should
be equal or not and the datatypes are also should be same and same
applied to UnionAll.

20.Explain “@@ROWCOUNT” and “@@ERROR” in Sql Server ?


Answer :
@@ROWCOUNT – Used to return the number of rows affected in the table
due to last statement.
@@ERROR – Used to return the error code which is occurred due to last
SQL statement. ‘0’ means there are no errors.

21. Why to use Cursor in Sql Server ?


Answer :
Cursor is used in case of row traversal. This can be considered as a pointer
pointing to one row at a time in the list of rows. Cursors can be used for
retrieval, removal or addition of records in a table.

22. List all types of constraints in Sql Server ?


Answer :
Below are the list of constraints in Sql Server –
NOT NULL
DEFAULT
CHECK
PRIMARY KEY
FOREIGN KEY
UNIQUE

Top 50 Sql Server Dba Interview Questions And Answers Pdf

23. Why to use IDENTITY in Sql Server ?


Answer :
IDENTITY is used for a column to auto increment the value of the column in
a table and it is mainly used with Primary Key.

24. What are the differences between Union, Intersect and Minus
operators ?
Answer :
Union operator is used to combine all the results or records of the table
and it removes the duplicate values.
Interact operator is used to return the common list of records between two
result sets.
Minus operator is used to get the list of records from the first result set and
which is not there in second result set.

25. Explain “ROW_NUMBER()” in Sql Server with an example ?


Answer :
“ROW_NUMBER()” is used to return a sequential number of each row within
a given partition. “1” will be the first position. “Partition By” and “Order By”
can be used along with “ROW_NUMBER()”. Below is the example for the
same
SELECT ROW_NUMBER() OVER(ORDER BY EmpSalary DESC) AS Row FROM
Employees WHERE Emp Name Name IS NOT NULL

Top 50 Sql Server Dba Interview Questions And Answers Pdf

26. What are the differences between “ROW_NUMBER()”, “RANK()”


and “DENSE_RANK()”?
Answer :
“ROW_NUMBER” – Used to return a sequential number of each row within a
given partition.
“RANK” – Used to returns a new row number for each distinct row in the
result set and it will leave a number gap in case of duplicates.
“DENSE_RANK” – Used to returns a new row number for each distinct row
in the result set and it will not leave any number gap in case of duplicates.
27. Explain about Link Server in Sql Server ?
Answer :
Linked Server is used to enable execution of OLEDB data sources in remote
servers. With Linked servers we can create easy SQL statements which will
allow remote data to be joined, combined and retrieved with data in local.

(Top 50 Sql Server Interview Questions And Answers Pdf)


28. What are the advantages of user defined functions over stored
procedures in Sql Server ?
Answer :
User Defined functions can be used in SELECT/WHERE/HAVING clauses
whereas stored procedure cannot be called. In case of table valued
functions, the returned table.
29. Why to use “NoLock” in Sql Server ?
Answer :
“No Lock” is used for unlocking the rows which are locked by some other
transaction. Once after the rows are committed or rolled back no need to
use No Lock. For example.

Top 50 Sql Server Dba Interview Questions And Answers Pdf

30. What are the significance of master, tempdb and model databases
?
Answer :
master – This database will have data and catalog of all the databases of
SQL Server instance.
tempdb – tempdb database will have temporary objects like local and
global temporary tables and stored procedures as well.
model – model database is mainly used for creating new user databases.

31. Explain about unique identifier datatype in Sql Server ?


Answer :
Unique Identifier datatype mainly used for primary key columns of the
tables or any other columns which need to have unique Ids. “NEWID()”
function can be used for generating unique identifier for the column.
Unique Identifiers are also named as GUIDs.

32. Why to use “PIVOT” in Sql Server ?


Answer :
Pivot table automatically count, sort and total the data in a table or
spreadsheet and used to create a separate table for displaying summarized
data.

33. Explain Alternate key, Candidate Key and Composite Key in Sql
Server ?
Answer :
Alternate Key – To identity a row uniquely we can have multiple keys one of
them is called primary key and rest of them are called alternate keys.
Candidate Key – Set of fields or columns which are uniquely identified in a
row and they constitute candidate keys.
Composite Key – One key formed by combining at least two or more
columns or fields.

34. How to use “DROP” keyword in Sql Server and Give an example ?
Answer :
“DROP” keyword is used to drop either Index or database or table. Below
are list of Sql statements using Drop keyword.
Dropping Index
DROP INDEX my_index
Dropping Database
DROP DATABASE my_database
Dropping Table
DROP TABLE my_table
deleted when the connection that created it is closed.

35. Can SQL servers link to other servers?


Answer:
SQL server can be joined to any database which owns OLE-DB provider to
provide a link. Example: Oracle holds OLE-DB provider which has a link to
unite among the SQL server club.

36. What is subquery and its properties ?


Answer :
A subquery is a query which can be nested inside a main query like Select,
Update, Insert or Delete statements. This can be used when expression is
allowed. Properties of subquery can be defined as
A sub query should not have order by clause
A subquery should be placed in the right hand side of the comparison
operator of the main query
A subquery should be enclosed in parenthesis because it needs to be
executed first before the main query
More than one subquery can be included.

Top 50 Sql Server Dba Interview Questions And Answers Pdf

37. What are the kinds of subquery?


Answer :
There are 3 kinds of subquery –
The query which returns only one row is Single row subquery
Which returns multiple rows is multiple row subquery
Which returns multiple columns to the main query is multiple column
subqueries. Beside that subquery returns, the Chief query will be
performed.
38. What is SQL server agent ?
Answer :
The SQL Server agent performs an active role in day to day duties of SQL
server manager (DBA). Server agent’s goal is to achieve the jobs simply with
the scheduler motor which provides our jobs to work at proposed date and
time.

39. What are scheduled tasks in SQL Server ?


Answer: Scheduled jobs are practiced to automate methods that can be
operated on a cataloged event at a constant interval. This scheduling of
jobs benefits to decrease human interference throughout night time and
feed can be produced at an appropriate time. A user can further order the
jobs in which it allows to be produced.
49. What is Index, cluster index and non cluster index ?
Answer :
Clustered Index:- A Clustered index is a special type of index that reorders
the way records in the table are physically stored. Therefore table may have
only one clustered index.Non-Clustered Index:- A Non-Clustered index is a
special type of index in which the logical order of the index does not match
the physical stored order of the rows in the disk. The leaf nodes of a non-
clustered index does not consists of the data pages. instead the leaf node
contains index rows.
Write down the general syntax for a SELECT statements covering all the
options.
Here’s the basic syntax: (Also checkout SELECT in books online for
advanced syntax).

You might also like