1. What is HL7?
Interoperability, or the back-and-forth exchange of patient health data
among different organizations, is seen as the "ultimate IT goal of the
modern healthcare system," when discussing meaningful use, HITECH and the Affordable Care Act, said Brull. "One of the major challenges to healthcare interoperability
is defining common standards for structured content of healthcare data
and the transport of that data between different systems, created by
different vendors," he said. Creating consensus behind a common
healthcare standard is the mission of HL7, which was founded in 1987.
"The HL7 Standard was created and has since become widely adopted by
vendors worldwide to define content," said Brull.
1).What is state management?
Ans: State management is the process by which you maintain state and page information over multiple requests for the same or different pages.
2).Http is stateless, What does this mean?
Ans: Stateless protocol is a communications protocol that treats each request as an independent transaction that is unrelated to any previous request so that the communication consists of independent pairs of requests and responses.
3).What is Session?
Ans: We know that Http is stateless, means when we open a webpage and fill some information and then move to next page then the data which we have entered will lost.
It happed do to Http protocol stateless nature. So here session come into existence, Session provide us the way of storing data in server memory. So you can store your page data into server
memory and retrieve it back during page postbacks.
4).What are the Advantage and disadvantage of Session?
Ans: Advantages:
Session provide us the way of maintain user state/data.
It is very easy to implement.
One big advantage of session is that we can store any kind of object in it. :eg, datatabe, dataset.. etc
By using session we don't need to worry about data collesp, because it store every client data separately.
Session is secure and transparent from the user.
Disadvantages:
Performance overhead in case of large volumes of data/user, because session data is stored in server memory.
Overhead involved in serializing and de-serializing session data, because in the case of StateServer and SQLServer session modes, we need to serialize the objects before storing them.
5).What is Session ID in Asp.net?
Ans: Asp.Net use 120 bit identifier to track each session. This is secure enough and can't be reverse engineered. When client communicate with server, only session id is transmitted, between them. When client request for data, ASP.NET looks on to session ID and retrieves corresponding data.
6).By default where the sessions ID's are stored ?
Ans: By default, the unique identifier for a session is stored in a non-expiring session cookie in the browser. You can specify that session identifiers not be stored in a cookie by setting the cookieless attribute to true in the sessionState configuration element.
We can also configure our application to store it in the url by specifying a "cookieless" session
The ASP Session cookie has this format:-
ASPSESSIONIDACSSDCCC=APHELKLDMNKNIOJONJACDHFN
7).Where does session stored if cookie is disabled on client’s machine?
Ans: If you want to disable the use of cookies in your ASP.NET application and still make use of session state, you can configure your application to store the session identifier in the URL instead of a cookie by setting the cookieless attribute of the sessionState configuration element to true, or to UseUri, in the Web.config file for your application.
The following code example shows a Web.config file that configures session state to use cookieless session identifiers.
8).Can you describe all the property set in web.config under session state?
Ans:
Mode: The mode setting supports three options: inproc, sqlserver, and
stateserver. As stated earlier, ASP.NET supports two modes: in process
and out of process. There are also two options for out-of-process state
management: memory based (stateserver), and SQL Server based
(sqlserver). We'll discuss implementing these options shortly.
Cookieless: The cookieless option for ASP.NET is configured with this simple Boolean setting.
Timeout: This option controls the length of time a session is considered valid. The session timeout is a sliding value; on each request the timeout period is set to the current time plus the timeout value
Sqlconnectionstring: The sqlconnectionstring identifies the database connection string that names the database used for mode sqlserver.
Server: In the out-of-process mode stateserver, it names the server that is running the required Windows NT service: ASPState.
Port: The port setting, which accompanies the server setting, identifies the port number that corresponds to the server setting for mode stateserver.
9).What are Session Events?
Ans: There are two types of session events available in ASP.NET:
Session_Start
Session_End
You can handle both these events in the global.asax file of your web application. When a new session initiates, the session_start event is raised, and the Session_End event raised when a session is abandoned or expires.
10).How you can disable session?
Ans: If we set session Mode="off" in web.config, session will be disabled in the application. For this, we need to configure web.config the following way:
11).What are the session modes available in asp.net?
Ans:
Off
InProc
StateServer(Out-Proc)
SQLServer
Custom
12).What is the default session modes in asp.net?
Ans: InProc
13).What are the disadvantages of using InProc session mode?
Ans: Its stores session information in the current Application Domain.
So it will lose data if we restart the server.
14).Session_End() event is supported by which session mode only?
Ans: Session_End() event is supported by InProc mode only.
15).What do you understand by StateServer(Out-Proc) mode?
Ans: StateServer session mode is also called Out-Proc session mode. StateServer uses a stand-alone Windows Service which is independent of IIS and can also be run on a separate server. This session state is totally managed by aspnet_state.exe. This server may run on the same system, but it's outside of the main application domain where your web application is running. This means if you restart your ASP.NET process, your session data will still be alive.
16).Under StateServer(Out-Proc) mode the session state is managed by?
Ans: aspnet_state.exe
17).What are the advantages and disadvantages of StateServer(Out-Proc) Session mode?
Ans: Advantages:
It keeps data separate from IIS so any issues with IIS will not hamper session data.
It is useful in web farm and web garden scenarios.
Disadvantages:
Process is slow due to serialization and de-serialization.
State Server always needs to be up and running.
18).Under SQLServer Session Mode where the session data store?
Ans: In SQLServersession mode, session data is serialized and stored in A SQL Server database.
19).What is the big disadvantage of SqlServer Session mode?
Ans: The main disadvantage of SqlServer Session mode storage method is the overhead related with data serialization and de-serialization.
20).What are the advantages and disadvantages of SqlServer Session mode?
Ans: Advantages:
Session data not affected if we restart IIS.
The most reliable and secure session management.
It keeps data located centrally, is easily accessible from other applications.
Very useful in web farms and web garden scenarios.
Disadvantages:
Processing is very slow in nature.
Object serialization and de-serialization creates overhead for the application.
As the session data is handled in a different server, we have to take care of SQL Server. It should be always up and running.
ASP.NET supports three different development models:
Web Pages, MVC (Model View Controller), and Web Forms.
The ASP.Net application codes could be written in either of the following languages:
1. C#
2. Visual Basic .Net
3. Jscript
4. J#
ASP.Net is used to produce interactive, data-driven web applications over the internet. It consists of a large number of controls like text boxes, buttons and labels for assembling, configuring and manipulating code to create HTML pages.
1. What is ASP.Net?
It is a framework developed by Microsoft on which we can develop new generation web sites using web forms(aspx), MVC, HTML, Javascript, CSS etc. Its successor of Microsoft Active Server Pages(ASP). Currently there is ASP.NET 4.0, which is used to develop web sites. There are various page extensions provided by Microsoft that are being used for web site development. Eg: aspx, asmx, ascx, ashx, cs, vb, html, xml etc.
2. What’s the use of Response.Output.Write()?
We can write formatted output using Response.Output.Write().
3. In which event of page cycle is the ViewState available?
After the Init() and before the Page_Load().
What is the difference between HashTable and ArrayList?
1) HashTable is a collection of objects which store values based on key
where as ArrayList is just a collection of objects stored based on index
2. What is the difference between HL7 version 2 and HL7 version 3? According
to Brull, HL7 version 3 (v3) isn't all that similar to HL7 version 2
(v2). "While v2 provides a 'negotiated framework' for developers to
easily use and adapt, v3 was targeted to be a stricter standard that
aimed to eliminate variances, in an effort to improve interoperability
between all users of the standard," he said. From a technical
standpoint, he added, typical HL7 structure data uses "pipes" (|) and
"hats" (^), while HL7 v3 is based on XML. "Due to a large embedded v2
base, adoption of v3 is still very slow in the U.S., with [more than] 90
percent of systems and applications still using some form of HL7 v2,"
he said. HL7 v3 includes both messages and documents, he added, with v3
documents being called CDA, or clinical document architecture. "While a
move to v3 message doesn't appear to be on the horizon, CDA documents
have been adopted in meaningful use standards for both Stages 1 and 2," Brull said.
[See also: HL7 CEO unveils big plans for standards organization.]
3. What are Z segments? Z
segments contain clinical or patient data that may not be a good fit
for other segments of the HL7 v2 standard, said Brull. "Essentially,
it's used as the 'catch all' for data that doesn't fit into the HL7
Standard message definitions – Z segments can be inserted into any
message." They're also one reason why the HL7 Standard is sometimes
called a "flexible standard," he added. "There literally are no limits
to the data contained in a Z segment, or in the number of Z segments
included in an HL7 message," said Brull.
Continued on the next page.
4. What is an ADT message? The
most commonly used HL7 v2 messaging type is ADT, or admit discharge
transfer messages, which record patient demographic and visit
information. They're typically initiated by the Hospital
Information Systems (HIS), or a registration application, said Brull.
They also "inform other connected systems about key patient information,
such as [when] the patient has been admitted, discharged, transferred,
or if the patient's demographic data has changed," such as their name,
insurance, or next of kin, he said.
5. What is an ORM message? According
to Brull, ORM messages are general order messages that contain any
request for clinical materials such as, for example, 500 ml of saline,
or services like an EKG study. "Order messages are usually associated
with a particular patient, but they can also be used by a department to
order materials," he said. "The transmission of ORM messages occurs
between the application placing the order, and the clinical application
filling the order." Typically, he added, the caregiver enters an order
in the HIS application. This then acts as the "placer" application. "The
system that receives the message fro the HIS application is typically
considered the 'filler' of the order," Brull said.
[See also: HL7 offers standard for clinical research in an EHR.]
6. What is an ORU message? ORUs,
or observational report messages, are usually the result message from
the "filler" application of the ORM message, said Brull. They typically
contain information and analysis from medical procedures, like test
results from the lab or the radiology department. "ORU messages also can
be used for linking orders and results to clinical trails," he added.
7. What are HL7 separator characters? "Separator
characters in HL7 are also known as message delimiters or special
encoding characters," said Brull. "The separator characters are defined
at the beginning of the HL7 message in the MSH segment." An example MSH
segment with the HL7-recommended separator characters would begin:
MSH|^~\&, with the separator characters defined as:
- | (field separator, aka pipe)
- ^ (component separator, aka hat)
- & (sub-component separator)
- ~ (field repeat separator)
- \ (escape character)
"While the above separator characters are recommended, the
separator character for segments, (ASCII 13 or HEX 0D), is not
negotiable," added Brull.
8. What are HL7 escape sequences? HL7
defined character sequences to represent "special" characters not
otherwise permitted in HL7 messages, said Brull. "These sequences begin
and end with the message's escape character – usually "\" – and contain
an identifying character followed by zero or more characters." The most
common use of these escape sequences, he said, is the escape the HL7
characters defined above.
1).What is state management?
Ans: State management is the process by which you maintain state and page information over multiple requests for the same or different pages.
2).Http is stateless, What does this mean?
Ans: Stateless protocol is a communications protocol that treats each request as an independent transaction that is unrelated to any previous request so that the communication consists of independent pairs of requests and responses.
3).What is Session?
Ans: We know that Http is stateless, means when we open a webpage and fill some information and then move to next page then the data which we have entered will lost.
It happed do to Http protocol stateless nature. So here session come into existence, Session provide us the way of storing data in server memory. So you can store your page data into server
memory and retrieve it back during page postbacks.
4).What are the Advantage and disadvantage of Session?
Ans: Advantages:
Session provide us the way of maintain user state/data.
It is very easy to implement.
One big advantage of session is that we can store any kind of object in it. :eg, datatabe, dataset.. etc
By using session we don't need to worry about data collesp, because it store every client data separately.
Session is secure and transparent from the user.
Disadvantages:
Performance overhead in case of large volumes of data/user, because session data is stored in server memory.
Overhead involved in serializing and de-serializing session data, because in the case of StateServer and SQLServer session modes, we need to serialize the objects before storing them.
5).What is Session ID in Asp.net?
Ans: Asp.Net use 120 bit identifier to track each session. This is secure enough and can't be reverse engineered. When client communicate with server, only session id is transmitted, between them. When client request for data, ASP.NET looks on to session ID and retrieves corresponding data.
6).By default where the sessions ID's are stored ?
Ans: By default, the unique identifier for a session is stored in a non-expiring session cookie in the browser. You can specify that session identifiers not be stored in a cookie by setting the cookieless attribute to true in the sessionState configuration element.
We can also configure our application to store it in the url by specifying a "cookieless" session
The ASP Session cookie has this format:-
ASPSESSIONIDACSSDCCC=APHELKLDMNKNIOJONJACDHFN
7).Where does session stored if cookie is disabled on client’s machine?
Ans: If you want to disable the use of cookies in your ASP.NET application and still make use of session state, you can configure your application to store the session identifier in the URL instead of a cookie by setting the cookieless attribute of the sessionState configuration element to true, or to UseUri, in the Web.config file for your application.
The following code example shows a Web.config file that configures session state to use cookieless session identifiers.
Code:
<configuration>
<system.web>
<sessionState
cookieless="true"
regenerateExpiredSessionId="true"
timeout="30" />
</system.web>
</configuration>
8).Can you describe all the property set in web.config under session state?
Ans:
Code:
<configuration>
<sessionstate
mode="inproc"
cookieless="false"
timeout="20"
sqlconnectionstring="data source=127.0.0.1;user id=<user id>;password=<password>"
server="127.0.0.1"
port="42424"
/>
</configuration>
Cookieless: The cookieless option for ASP.NET is configured with this simple Boolean setting.
Timeout: This option controls the length of time a session is considered valid. The session timeout is a sliding value; on each request the timeout period is set to the current time plus the timeout value
Sqlconnectionstring: The sqlconnectionstring identifies the database connection string that names the database used for mode sqlserver.
Server: In the out-of-process mode stateserver, it names the server that is running the required Windows NT service: ASPState.
Port: The port setting, which accompanies the server setting, identifies the port number that corresponds to the server setting for mode stateserver.
9).What are Session Events?
Ans: There are two types of session events available in ASP.NET:
Session_Start
Session_End
You can handle both these events in the global.asax file of your web application. When a new session initiates, the session_start event is raised, and the Session_End event raised when a session is abandoned or expires.
10).How you can disable session?
Ans: If we set session Mode="off" in web.config, session will be disabled in the application. For this, we need to configure web.config the following way:
Code:
<configuration>
<sessionstate Mode="off"/>
</configuration>
11).What are the session modes available in asp.net?
Ans:
Off
InProc
StateServer(Out-Proc)
SQLServer
Custom
12).What is the default session modes in asp.net?
Ans: InProc
13).What are the disadvantages of using InProc session mode?
Ans: Its stores session information in the current Application Domain.
So it will lose data if we restart the server.
14).Session_End() event is supported by which session mode only?
Ans: Session_End() event is supported by InProc mode only.
15).What do you understand by StateServer(Out-Proc) mode?
Ans: StateServer session mode is also called Out-Proc session mode. StateServer uses a stand-alone Windows Service which is independent of IIS and can also be run on a separate server. This session state is totally managed by aspnet_state.exe. This server may run on the same system, but it's outside of the main application domain where your web application is running. This means if you restart your ASP.NET process, your session data will still be alive.
16).Under StateServer(Out-Proc) mode the session state is managed by?
Ans: aspnet_state.exe
17).What are the advantages and disadvantages of StateServer(Out-Proc) Session mode?
Ans: Advantages:
It keeps data separate from IIS so any issues with IIS will not hamper session data.
It is useful in web farm and web garden scenarios.
Disadvantages:
Process is slow due to serialization and de-serialization.
State Server always needs to be up and running.
18).Under SQLServer Session Mode where the session data store?
Ans: In SQLServersession mode, session data is serialized and stored in A SQL Server database.
19).What is the big disadvantage of SqlServer Session mode?
Ans: The main disadvantage of SqlServer Session mode storage method is the overhead related with data serialization and de-serialization.
20).What are the advantages and disadvantages of SqlServer Session mode?
Ans: Advantages:
Session data not affected if we restart IIS.
The most reliable and secure session management.
It keeps data located centrally, is easily accessible from other applications.
Very useful in web farms and web garden scenarios.
Disadvantages:
Processing is very slow in nature.
Object serialization and de-serialization creates overhead for the application.
As the session data is handled in a different server, we have to take care of SQL Server. It should be always up and running.
ASP.NET supports three different development models:
Web Pages, MVC (Model View Controller), and Web Forms.
The ASP.Net application codes could be written in either of the following languages:
1. C#
2. Visual Basic .Net
3. Jscript
4. J#
ASP.Net is used to produce interactive, data-driven web applications over the internet. It consists of a large number of controls like text boxes, buttons and labels for assembling, configuring and manipulating code to create HTML pages.
1. What is ASP.Net?
It is a framework developed by Microsoft on which we can develop new generation web sites using web forms(aspx), MVC, HTML, Javascript, CSS etc. Its successor of Microsoft Active Server Pages(ASP). Currently there is ASP.NET 4.0, which is used to develop web sites. There are various page extensions provided by Microsoft that are being used for web site development. Eg: aspx, asmx, ascx, ashx, cs, vb, html, xml etc.
2. What’s the use of Response.Output.Write()?
We can write formatted output using Response.Output.Write().
3. In which event of page cycle is the ViewState available?
After the Init() and before the Page_Load().
4. What is the difference between Server.Transfer and Response.Redirect?
In Server. Transfer page processing transfers from one page to the other page without making a round-trip back to the client’s browser. This provides a faster response with a little less overhead on the server. The clients url history list or current url Server does not update in case of Server.Transfer.
Response. Redirect is used to redirect the user’s browser to another page or site. It performs trip back to the client where the client’s browser is redirected to the new page. The user’s browser history list is updated to reflect the new address.
5. From which base class all Web Forms are inherited?
Page class.
In Server. Transfer page processing transfers from one page to the other page without making a round-trip back to the client’s browser. This provides a faster response with a little less overhead on the server. The clients url history list or current url Server does not update in case of Server.Transfer.
Response. Redirect is used to redirect the user’s browser to another page or site. It performs trip back to the client where the client’s browser is redirected to the new page. The user’s browser history list is updated to reflect the new address.
5. From which base class all Web Forms are inherited?
Page class.
6. What are the different validators in ASP.NET?
Required field Validator
Range Validator
Compare Validator
Custom Validator
Regular expression Validator
Summary Validator
7. Which validator control you use if you need to make sure the values in two different controls matched?
Required field Validator
Range Validator
Compare Validator
Custom Validator
Regular expression Validator
Summary Validator
7. Which validator control you use if you need to make sure the values in two different controls matched?
Compare Validator control.
8. What is ViewState?
ViewState is used to retain the state of server-side objects between page post backs.
9. Where the viewstate is stored after the page postback?
ViewState is stored in a hidden field on the page at client side. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source.
8. What is ViewState?
ViewState is used to retain the state of server-side objects between page post backs.
9. Where the viewstate is stored after the page postback?
ViewState is stored in a hidden field on the page at client side. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source.
10. How long the items in ViewState exists?
They exist for the life of the current page.
11. What are the different Session state management options available in ASP.NET?
In-Process
Out-of-Process.
In-Process stores the session in memory on the web server.
Out-of-Process Session state management stores data in an external server. The external server may be either a SQL Server or a State Server. All objects stored in session are required to be serializable for Out-of-Process state management.
12. How you can add an event handler?
Using the Attributes property of server side control.
They exist for the life of the current page.
11. What are the different Session state management options available in ASP.NET?
In-Process
Out-of-Process.
In-Process stores the session in memory on the web server.
Out-of-Process Session state management stores data in an external server. The external server may be either a SQL Server or a State Server. All objects stored in session are required to be serializable for Out-of-Process state management.
12. How you can add an event handler?
Using the Attributes property of server side control.
e.g.
btnSubmit.Attributes.Add(“onMouseOver”,”JavascriptCode();”)
13. What is caching?
Caching is a technique used to increase performance by keeping frequently accessed data or files in memory. The request for a cached file/data will be accessed from cache instead of actual location of that file.
14. What are the different types of caching?
ASP.NET has 3 kinds of caching :
Output Caching,
Fragment Caching,
Data Caching.
15. Which type if caching will be used if we want to cache the portion of a page instead of whole page?
Fragment Caching: It caches the portion of the page generated by the request. For that, we can create user controls with the below code:
<%@ OutputCache Duration=”120″ VaryByParam=”CategoryID;SelectedID”%>
16. List the events in page life cycle.
btnSubmit.Attributes.Add(“onMouseOver”,”JavascriptCode();”)
13. What is caching?
Caching is a technique used to increase performance by keeping frequently accessed data or files in memory. The request for a cached file/data will be accessed from cache instead of actual location of that file.
14. What are the different types of caching?
ASP.NET has 3 kinds of caching :
Output Caching,
Fragment Caching,
Data Caching.
15. Which type if caching will be used if we want to cache the portion of a page instead of whole page?
Fragment Caching: It caches the portion of the page generated by the request. For that, we can create user controls with the below code:
<%@ OutputCache Duration=”120″ VaryByParam=”CategoryID;SelectedID”%>
16. List the events in page life cycle.
1) Page_PreInit
2) Page_Init
3) Page_InitComplete
4) Page_PreLoad
5) Page_Load
6) Page_LoadComplete
7) Page_PreRender
8)Render
17. Can we have a web application running without web.Config file?
Yes
2) Page_Init
3) Page_InitComplete
4) Page_PreLoad
5) Page_Load
6) Page_LoadComplete
7) Page_PreRender
8)Render
17. Can we have a web application running without web.Config file?
Yes
18. Is it possible to create web application with both webforms and mvc?
Yes. We have to include below mvc assembly references in the web forms application to create hybrid application.
System.Web.Mvc
System.Web.Razor
System.ComponentModel.DataAnnotations
19. Can we add code files of different languages in App_Code folder?
No. The code files must be in same language to be kept in App_code folder.
20. What is Protected Configuration?
It is a feature used to secure connection string information.
Yes. We have to include below mvc assembly references in the web forms application to create hybrid application.
System.Web.Mvc
System.Web.Razor
System.ComponentModel.DataAnnotations
19. Can we add code files of different languages in App_Code folder?
No. The code files must be in same language to be kept in App_code folder.
20. What is Protected Configuration?
It is a feature used to secure connection string information.
21. Write code to send e-mail from an ASP.NET application?
MailMessage mailMess = new MailMessage ();
mailMess.From = “abc@gmail.com”;
mailMess.To = “xyz@gmail.com”;
mailMess.Subject = “Test email”;
mailMess.Body = “Hi This is a test mail.”;
SmtpMail.SmtpServer = “localhost”;
SmtpMail.Send (mailMess);
MailMessage and SmtpMail are classes defined System.Web.Mail namespace.
22. How can we prevent browser from caching an ASPX page?
We can SetNoStore on HttpCachePolicy object exposed by the Response object’s Cache property:
Response.Cache.SetNoStore ();
Response.Write (DateTime.Now.ToLongTimeString ());
23. What is the good practice to implement validations in aspx page?
Client-side validation is the best way to validate data of a web page. It reduces the network traffic and saves server resources.
24. What are the event handlers that we can have in Global.asax file?
Application Events: Application_Start , Application_End, Application_AcquireRequestState, Application_AuthenticateRequest, Application_AuthorizeRequest, Application_BeginRequest, Application_Disposed, Application_EndRequest, Application_Error, Application_PostRequestHandlerExecute, Application_PreRequestHandlerExecute,
Application_PreSendRequestContent, Application_PreSendRequestHeaders, Application_ReleaseRequestState, Application_ResolveRequestCache, Application_UpdateRequestCache
Session Events: Session_Start,Session_End
25. Which protocol is used to call a Web service?
HTTP Protocol
26. Can we have multiple web config files for an asp.net application?
Yes.
27. What is the difference between web config and machine config?
Web config file is specific to a web application where as machine config is specific to a machine or server. There can be multiple web config files into an application where as we can have only one machine config file on a server.
28. Explain role based security ?
Role Based Security used to implement security based on roles assigned to user groups in the organization.
Then we can allow or deny users based on their role in the organization. Windows defines several built-in groups, including Administrators, Users, and Guests.
<AUTHORIZATION>< authorization >
< allow roles=”Domain_Name\Administrators” / > < !– Allow Administrators in domain. — >
< deny users=”*” / > < !– Deny anyone else. — >
< /authorization >
29. What is Cross Page Posting?
When we click submit button on a web page, the page post the data to the same page. The technique in which we post the data to different pages is called Cross Page posting. This can be achieved by setting POSTBACKURL property of the button that causes the postback. Findcontrol method of PreviousPage can be used to get the posted values on the page to which the page has been posted.
30. How can we apply Themes to an asp.net application?
We can specify the theme in web.config file. Below is the code example to apply theme:
<configuration>
<system.web>
<pages theme=”Windows7″ />
</system.web>
</configuration>
MailMessage mailMess = new MailMessage ();
mailMess.From = “abc@gmail.com”;
mailMess.To = “xyz@gmail.com”;
mailMess.Subject = “Test email”;
mailMess.Body = “Hi This is a test mail.”;
SmtpMail.SmtpServer = “localhost”;
SmtpMail.Send (mailMess);
MailMessage and SmtpMail are classes defined System.Web.Mail namespace.
22. How can we prevent browser from caching an ASPX page?
We can SetNoStore on HttpCachePolicy object exposed by the Response object’s Cache property:
Response.Cache.SetNoStore ();
Response.Write (DateTime.Now.ToLongTimeString ());
23. What is the good practice to implement validations in aspx page?
Client-side validation is the best way to validate data of a web page. It reduces the network traffic and saves server resources.
24. What are the event handlers that we can have in Global.asax file?
Application Events: Application_Start , Application_End, Application_AcquireRequestState, Application_AuthenticateRequest, Application_AuthorizeRequest, Application_BeginRequest, Application_Disposed, Application_EndRequest, Application_Error, Application_PostRequestHandlerExecute, Application_PreRequestHandlerExecute,
Application_PreSendRequestContent, Application_PreSendRequestHeaders, Application_ReleaseRequestState, Application_ResolveRequestCache, Application_UpdateRequestCache
Session Events: Session_Start,Session_End
25. Which protocol is used to call a Web service?
HTTP Protocol
26. Can we have multiple web config files for an asp.net application?
Yes.
27. What is the difference between web config and machine config?
Web config file is specific to a web application where as machine config is specific to a machine or server. There can be multiple web config files into an application where as we can have only one machine config file on a server.
28. Explain role based security ?
Role Based Security used to implement security based on roles assigned to user groups in the organization.
Then we can allow or deny users based on their role in the organization. Windows defines several built-in groups, including Administrators, Users, and Guests.
<AUTHORIZATION>< authorization >
< allow roles=”Domain_Name\Administrators” / > < !– Allow Administrators in domain. — >
< deny users=”*” / > < !– Deny anyone else. — >
< /authorization >
29. What is Cross Page Posting?
When we click submit button on a web page, the page post the data to the same page. The technique in which we post the data to different pages is called Cross Page posting. This can be achieved by setting POSTBACKURL property of the button that causes the postback. Findcontrol method of PreviousPage can be used to get the posted values on the page to which the page has been posted.
30. How can we apply Themes to an asp.net application?
We can specify the theme in web.config file. Below is the code example to apply theme:
<configuration>
<system.web>
<pages theme=”Windows7″ />
</system.web>
</configuration>
31. What is RedirectPermanent in ASP.Net?
RedirectPermanent Performs a permanent redirection from the requested URL to the specified URL. Once the redirection is done, it also returns 301 Moved Permanently responses.
RedirectPermanent Performs a permanent redirection from the requested URL to the specified URL. Once the redirection is done, it also returns 301 Moved Permanently responses.
32. What is MVC?
MVC is a framework used to create web applications. The web application base builds on Model-View-Controller pattern which separates the application logic from UI, and the input and events from the user will be controlled by the Controller.
33. Explain the working of passport authentication.
First of all it checks passport authentication cookie. If the cookie is not available then the application redirects the user to Passport Sign on page. Passport service authenticates the user details on sign on page and if valid then stores the authenticated cookie on client machine and then redirect the user to requested page
34. What are the advantages of Passport authentication?
All the websites can be accessed using single login credentials. So no need to remember login credentials for each web site.
Users can maintain his/ her information in a single location.
35. What are the asp.net Security Controls?
MVC is a framework used to create web applications. The web application base builds on Model-View-Controller pattern which separates the application logic from UI, and the input and events from the user will be controlled by the Controller.
33. Explain the working of passport authentication.
First of all it checks passport authentication cookie. If the cookie is not available then the application redirects the user to Passport Sign on page. Passport service authenticates the user details on sign on page and if valid then stores the authenticated cookie on client machine and then redirect the user to requested page
34. What are the advantages of Passport authentication?
All the websites can be accessed using single login credentials. So no need to remember login credentials for each web site.
Users can maintain his/ her information in a single location.
35. What are the asp.net Security Controls?
<asp:Login>: Provides a standard login capability that allows the users to enter their credentials
<asp:LoginName>: Allows you to display the name of the logged-in user
<asp:LoginStatus>: Displays whether the user is authenticated or not
<asp:LoginView>: Provides various login views depending on the selected template
<asp:PasswordRecovery>: email the users their lost password
36. How do you register JavaScript for webcontrols ?
We can register javascript for controls using <CONTROL -name> Attribtues.Add(scriptname,scripttext) method.
37. In which event are the controls fully loaded?
Page load event.
38. what is boxing and unboxing?
Boxing is assigning a value type to reference type variable.
Unboxing is reverse of boxing ie. Assigning reference type variable to value type variable.
39. Differentiate strong typing and weak typing?
In strong typing, the data types of variable are checked at compile time. On the other hand, in case of weak typing the variable data types are checked at runtime. In case of strong typing, there is no chance of compilation error. Scripts use weak typing and hence issues arises at runtime.
40. How we can force all the validation controls to run?
The Page.Validate() method is used to force all the validation controls to run and to perform validation.
41. List all templates of the Repeater control.
ItemTemplate
AlternatingltemTemplate
SeparatorTemplate
HeaderTemplate
FooterTemplate
42. List the major built-in objects in ASP.NET?
Application
Request
Response
Server
Session
Context
Trace
43. What is the appSettings Section in the web.config file?
The appSettings block in web config file sets the user-defined values for the whole application.
For example, in the following code snippet, the specified ConnectionString section is used throughout the project for database connection:
<em><configuration>
<appSettings>
<add key=”ConnectionString” value=”server=local; pwd=password; database=default” />
</appSettings></em>
44. Which data type does the RangeValidator control support?
The data types supported by the RangeValidator control are Integer, Double, String, Currency, and Date.
45. What is the difference between an HtmlInputCheckBox control and anHtmlInputRadioButton control?
In HtmlInputCheckBoxcontrol, multiple item selection is possible whereas in HtmlInputRadioButton controls, we can select only single item from the group of items.
46. Which namespaces are necessary to create a localized application?
System.Globalization
System.Resources
47. What are the different types of cookies in ASP.NET?
Session Cookie – Resides on the client machine for a single session until the user does not log out.
<asp:LoginName>: Allows you to display the name of the logged-in user
<asp:LoginStatus>: Displays whether the user is authenticated or not
<asp:LoginView>: Provides various login views depending on the selected template
<asp:PasswordRecovery>: email the users their lost password
36. How do you register JavaScript for webcontrols ?
We can register javascript for controls using <CONTROL -name> Attribtues.Add(scriptname,scripttext) method.
37. In which event are the controls fully loaded?
Page load event.
38. what is boxing and unboxing?
Boxing is assigning a value type to reference type variable.
Unboxing is reverse of boxing ie. Assigning reference type variable to value type variable.
39. Differentiate strong typing and weak typing?
In strong typing, the data types of variable are checked at compile time. On the other hand, in case of weak typing the variable data types are checked at runtime. In case of strong typing, there is no chance of compilation error. Scripts use weak typing and hence issues arises at runtime.
40. How we can force all the validation controls to run?
The Page.Validate() method is used to force all the validation controls to run and to perform validation.
41. List all templates of the Repeater control.
ItemTemplate
AlternatingltemTemplate
SeparatorTemplate
HeaderTemplate
FooterTemplate
42. List the major built-in objects in ASP.NET?
Application
Request
Response
Server
Session
Context
Trace
43. What is the appSettings Section in the web.config file?
The appSettings block in web config file sets the user-defined values for the whole application.
For example, in the following code snippet, the specified ConnectionString section is used throughout the project for database connection:
<em><configuration>
<appSettings>
<add key=”ConnectionString” value=”server=local; pwd=password; database=default” />
</appSettings></em>
44. Which data type does the RangeValidator control support?
The data types supported by the RangeValidator control are Integer, Double, String, Currency, and Date.
45. What is the difference between an HtmlInputCheckBox control and anHtmlInputRadioButton control?
In HtmlInputCheckBoxcontrol, multiple item selection is possible whereas in HtmlInputRadioButton controls, we can select only single item from the group of items.
46. Which namespaces are necessary to create a localized application?
System.Globalization
System.Resources
47. What are the different types of cookies in ASP.NET?
Session Cookie – Resides on the client machine for a single session until the user does not log out.
Persistent Cookie – Resides on a user’s machine for a period specified for its expiry, such as 10 days, one month, and never.
48. What is the file extension of web service?
Web services have file extension .asmx..
49. What are the components of ADO.NET?
The components of ADO.Net are Dataset, Data Reader, Data Adaptor, Command, connection.
50. What is the difference between ExecuteScalar and ExecuteNonQuery?
ExecuteScalar returns output value where as ExecuteNonQuery does not return any value but the number of rows affected by the query. ExecuteScalar used for fetching a single value and ExecuteNonQuery used to execute Insert and Update statements.
48. What is the file extension of web service?
Web services have file extension .asmx..
49. What are the components of ADO.NET?
The components of ADO.Net are Dataset, Data Reader, Data Adaptor, Command, connection.
50. What is the difference between ExecuteScalar and ExecuteNonQuery?
ExecuteScalar returns output value where as ExecuteNonQuery does not return any value but the number of rows affected by the query. ExecuteScalar used for fetching a single value and ExecuteNonQuery used to execute Insert and Update statements.
What can javascript programs do?
Generation of HTML pages on-the-fly without accessing the Web server. The user can be given control over the browser like User input validation Simple computations can be performed on the client's machine The user's browser, OS, screen size, etc. can be detected Date and Time Handling
Generation of HTML pages on-the-fly without accessing the Web server. The user can be given control over the browser like User input validation Simple computations can be performed on the client's machine The user's browser, OS, screen size, etc. can be detected Date and Time Handling
6. How to read and write a file using javascript?
--> I/O operations like reading or writing a file is not possible with client-side javascript. However , this can be done by coding a Java applet that reads files for the script.
7. How to detect the operating system on the client machine?
--> In order to detect the operating system on the client machine, the navigator.appVersion
string (property) should be used.
--> I/O operations like reading or writing a file is not possible with client-side javascript. However , this can be done by coding a Java applet that reads files for the script.
7. How to detect the operating system on the client machine?
--> In order to detect the operating system on the client machine, the navigator.appVersion
string (property) should be used.
1. What is JavaScript?
--> JavaScript is a platform-independent,event-driven, interpreted client-side scripting and programming language developed by Netscape Communications Corp. and Sun Microsystems.
2. How is JavaScript different from Java?
--> JavaScript was developed by Brendan Eich of Netscape; Java was developed at Sun Microsystems. While the two languages share some common syntax, they were developed independently of each other and for different audiences.
--> Java is a full-fledged programming language tailored for network computing; it includes hundreds of its own objects, including objects for creating user interfaces that appear in Java applets (in Web browsers) or standalone Java applications. In contrast, JavaScript relies on whatever environment it's operating in for the user interface, such as a Web document's form elements.
--> JavaScript was initially called LiveScript at Netscape while it was under development. A licensing deal between Netscape and Sun at the last minute let Netscape plug the "Java" name into the name of its scripting language. Programmers use entirely different tools for Java and JavaScript. It is also not uncommon for a programmer of one language to be ignorant of the other. The two languages don't rely on each other and are intended for different purposes.
--> In some ways, the "Java" name on JavaScript has confused the world's understanding of the differences between the two. On the other hand, JavaScript is much easier to learn than Java and can offer a gentle introduction for newcomers who want to graduate to Java and the kinds of applications you can develop with it.
--> JavaScript is a platform-independent,event-driven, interpreted client-side scripting and programming language developed by Netscape Communications Corp. and Sun Microsystems.
2. How is JavaScript different from Java?
--> JavaScript was developed by Brendan Eich of Netscape; Java was developed at Sun Microsystems. While the two languages share some common syntax, they were developed independently of each other and for different audiences.
--> Java is a full-fledged programming language tailored for network computing; it includes hundreds of its own objects, including objects for creating user interfaces that appear in Java applets (in Web browsers) or standalone Java applications. In contrast, JavaScript relies on whatever environment it's operating in for the user interface, such as a Web document's form elements.
--> JavaScript was initially called LiveScript at Netscape while it was under development. A licensing deal between Netscape and Sun at the last minute let Netscape plug the "Java" name into the name of its scripting language. Programmers use entirely different tools for Java and JavaScript. It is also not uncommon for a programmer of one language to be ignorant of the other. The two languages don't rely on each other and are intended for different purposes.
--> In some ways, the "Java" name on JavaScript has confused the world's understanding of the differences between the two. On the other hand, JavaScript is much easier to learn than Java and can offer a gentle introduction for newcomers who want to graduate to Java and the kinds of applications you can develop with it.
OOP'S CONCEPT
1. What is Object Oriented Programming ?
--> It is a problem solving technique to develop software systems. It is a technique to think real world in terms of objects. Object maps the software model to real world concept. These objects have responsibilities and provide services to application or other objects.
2. What is a Class ?
--> A class describes all the attributes of objects, as well as the methods that implement the behavior of member objects. It is a comprehensive data type which represents a blue print of objects. It’s a template of object.
3. What is an Object ?
--> It is a basic unit of a system. An object is an entity that has attributes, behavior, and identity. Objects are members of a class. Attributes and behavior of an object are defined by the class definition.
4. What is the relation between Classes and Objects?
--> They look very much same but are not same. Class is a definition, while object is instance of the class created. Class is a blue print while objects are actual objects existing in real world. Example we have class CAR which has attributes and methods like Speed, Brakes, Type of Car etc.Class CAR is just a prototype, now we can create real time objects which can be used to provide functionality. Example we can create a Maruti car object with 100 km speed and urgent brakes.
5. What are different properties provided by Object-oriented systems ?
--> Following are characteristics of Object Oriented System’s:-
Abstraction: It allows complex real world to be represented in simplified manner. Example color is abstracted to RGB.By just making the combination of these three colors we can achieve any color in world. It’s a model of real world or concept.
Encapsulation: The process of hiding all the internal details of an object from the outside world.
Communication: Using messages when application wants to achieve certain task it can only be done using combination of objects. A single object can not do the entire task. Example if we want to make order processing form. We will use Customer object, Order object, Product object and Payment object to achieve this functionality. In short these objects should communicate with each other. This is achieved when objects send messages to each other.
Object lifetime: All objects have life time. Objects are created, initialized, necessary functionalities are done and later the object is destroyed. Every object have there own state and identity, which differ from instance to instance.
6. What is an Abstract class ?
--> Abstract class defines an abstract concept which can not be instantiated and comparing o interface it can have some implementation while interfaces can not.
Below are some points for abstract class:-
=>We can not create object of abstract class it can only be inherited in a below class.
=> Normally abstract classes have base implementation and then child classes derive from the abstract class to make the class concrete.
7. What are Abstract methods?
--> Abstract class can contain abstract methods. Abstract methods do not have implementation. Abstract methods should be implemented in the subclasses which inherit them.
So if an abstract class has an abstract method class inheriting the abstract class should implement the method or else java compiler will through an error.
In this way, an abstract class can define a complete programming interface thereby providing its subclasses with the method declarations for all of the methods necessary to implement that programming interface.
Abstract methods are defined using "abstract" keyword. Below is a sample code snippet.
abstract class pcdsGraphics
{
abstract void draw();
}
Any class inheriting from "pcdsGraphics" class should implement the "draw" method or else the java compiler will throw an error. so if we do not implement a abstract method the program will not compile.
8. What is the difference between Abstract classes and Interfaces ?
--> Difference between Abstract class and Interface is as follows:-
(a). Abstract class can only be inherited while interfaces can not be it has to be implemented.
(b). Interface cannot implement any methods, whereas an abstract class can have implementation.
(c). Class can implement many interfaces but can have only one super class.
(d). Interface is not part of the class hierarchy while Abstract class comes in through inheritance.
(e). Unrelated classes can implement the same interface.
9. What is difference between Static and Non-Static fields of a class ?
--> Non-Static values are also called as instance variables. Each object of the class has its own copy of Non-Static instance variables.
So when a new object is created of the same class it will have completely its own copy of instance variables. While Static values have only one copy of instance variables and will be shared among all the objects of the class.
10. What are inner classes and what is the practical implementation of inner classes?
--> Inner classes are nested inside other class. They have access to outer class fields and methods even if the fields of outer class are defined as private.
public class Pcds
{
class pcdsEmp
{
// inner class defines the required structure
String first;
String last;
}
// array of name objects
clsName personArray[] = {new clsName(), new clsName(), new clsName()};
}
Normally inner classes are used for data structures like one shown above or some kind of helper classes.
11. What is a constructor in class?
--> Constructor has the same name as the class in which it resides and looks from syntax point of view it looks similiar to a method. Constructor is automatically called immediately after the object is created, before the new operator completes.
Constructors have no return type, not even void. This is because the implicit return type of a class' constructor is the class type itself. It is the constructor's job to initialize the internal state of an object so that the code creating an instance will have a fully initialized, usable object immediately.
12. Can constructors be parameterized?
--> Yes we can have parameterized constructor which can also be termed as constructor overloading. Below is a code snippet which shows two constructors for pcdsMaths class one with parameter and one with out.
class pcdsMaths
{
double PI;
// This is the constructor for the maths constant class.
pcdsMaths()
{PI = 3.14;}
pcdsMaths(int pi)
{
PI = pi;
} }
13. What is the use if instanceof keyword? and How do refer to a current instance of object?
--> "instanceof" keyword is used to check what is the type of object.
we can refer the current instance of object using "this" keyword. For instance if we have class which has color property we can refer the current object instance inside any of the method using "this.color".
14. what is Bootstrap, Extension and System Class loader? or Can you explain primordial class loader?
--> There three types of class loaders:-
BootStrap Class loader also called as primordial class loader.
Extension Class loader.
System Class loader.
Let’s now try to get the fundamentals of these class loaders.
Bootstrap Class loader : Bootstrap class loader loads those classes those which are essential for JVM to function properly. Bootstrap class loader is responsible for loading all core java classes for instance java.lang.*, java.io.* etc. Bootstrap class loader finds these necessary classes from “jdk/ jre/lib/rt.jar”. Bootstrap class loader can not be instantiated from JAVA code and is implemented natively inside JVM.
Extension Class loader : The extension class loader also termed as the standard extensions class loader is a child of the bootstrap class loader. Its primary responsibility is to load classes from the extension directories, normally located the “jre/lib/ext” directory. This provides the ability to simply drop in new extensions, such as various security extensions, without requiring modification to the user's class path.
System Class loader : The system class loader also termed application class loader is the class loader responsible for loading code from the path specified by the CLASSPATH environment variable. It is also used to load an application’s entry point class that is the "static void main ()" method in a class.
15. what’s the main difference between ArrayList / HashMap and Vector / Hashtable?
--> Vector / HashTable are synchronized which means they are thread safe. Cost of thread safe is performance degradation. So if you are sure that you are not dealing with huge number of threads then you should use ArrayList / HashMap.But yes you can still
synchronize List and Map’s using Collections provided methods :-
List OurList = Collections.synchronizedList (OurList);
Map OurMap = Collections.synchronizedMap (OurMap);
16. What are access modifiers?
--> Access modifiers decide whether a method or a data variable can be accessed by another method in another class or subclass.
Four types of access modifiers:
Public : - Can be accessed by any other class anywhere.
Protected : - Can be accessed by classes inside the package or by subclasses ( that means classes who inherit from this class).
Private :- Can be accessed only within the class. Even methods in subclasses in the same package do not have access.
Default :- (Its private access by default) accessible to classes in the same package but not by classes in other packages, even if these are subclasses.
17. Define exceptions ?
--> An exception is an abnormal condition that arises in a code sequence at run time. Basically there are four important keywords which form the main pillars of exception handling: try, catch, throw and finally. Code which you want to monitor for exception is contained in the try block. If any exception occurs in the try block its sent to the catch block which can handle this error in a more rational manner. To throw an exception manually you need to call use the throw keyword. If you want to put any clean up code use the finally block. The finally block is executed irrespective if there is an error or not.
18. What is serialization?How do we implement serialization actually?
--> Serialization is a process by which an object instance is converted in to stream of bytes. There are many useful stuff you can do when the object instance is converted in to stream of bytes for instance you can save the object in hard disk or send it across the network.
In order to implement serialization we need to use two classes from java.io package ObjectOutputStream and ObjectInputStream. ObjectOutputStream has a method called writeObject, while ObjectInputStream has a method called readObject. Using writeobject we can write and readObject can be used to read the object from the stream. Below are two code snippet which used the FileInputStream and FileOutputstream to read and write from harddisk.
--> It is a problem solving technique to develop software systems. It is a technique to think real world in terms of objects. Object maps the software model to real world concept. These objects have responsibilities and provide services to application or other objects.
2. What is a Class ?
--> A class describes all the attributes of objects, as well as the methods that implement the behavior of member objects. It is a comprehensive data type which represents a blue print of objects. It’s a template of object.
3. What is an Object ?
--> It is a basic unit of a system. An object is an entity that has attributes, behavior, and identity. Objects are members of a class. Attributes and behavior of an object are defined by the class definition.
4. What is the relation between Classes and Objects?
--> They look very much same but are not same. Class is a definition, while object is instance of the class created. Class is a blue print while objects are actual objects existing in real world. Example we have class CAR which has attributes and methods like Speed, Brakes, Type of Car etc.Class CAR is just a prototype, now we can create real time objects which can be used to provide functionality. Example we can create a Maruti car object with 100 km speed and urgent brakes.
5. What are different properties provided by Object-oriented systems ?
--> Following are characteristics of Object Oriented System’s:-
Abstraction: It allows complex real world to be represented in simplified manner. Example color is abstracted to RGB.By just making the combination of these three colors we can achieve any color in world. It’s a model of real world or concept.
Encapsulation: The process of hiding all the internal details of an object from the outside world.
Communication: Using messages when application wants to achieve certain task it can only be done using combination of objects. A single object can not do the entire task. Example if we want to make order processing form. We will use Customer object, Order object, Product object and Payment object to achieve this functionality. In short these objects should communicate with each other. This is achieved when objects send messages to each other.
Object lifetime: All objects have life time. Objects are created, initialized, necessary functionalities are done and later the object is destroyed. Every object have there own state and identity, which differ from instance to instance.
6. What is an Abstract class ?
--> Abstract class defines an abstract concept which can not be instantiated and comparing o interface it can have some implementation while interfaces can not.
Below are some points for abstract class:-
=>We can not create object of abstract class it can only be inherited in a below class.
=> Normally abstract classes have base implementation and then child classes derive from the abstract class to make the class concrete.
7. What are Abstract methods?
--> Abstract class can contain abstract methods. Abstract methods do not have implementation. Abstract methods should be implemented in the subclasses which inherit them.
So if an abstract class has an abstract method class inheriting the abstract class should implement the method or else java compiler will through an error.
In this way, an abstract class can define a complete programming interface thereby providing its subclasses with the method declarations for all of the methods necessary to implement that programming interface.
Abstract methods are defined using "abstract" keyword. Below is a sample code snippet.
abstract class pcdsGraphics
{
abstract void draw();
}
Any class inheriting from "pcdsGraphics" class should implement the "draw" method or else the java compiler will throw an error. so if we do not implement a abstract method the program will not compile.
8. What is the difference between Abstract classes and Interfaces ?
--> Difference between Abstract class and Interface is as follows:-
(a). Abstract class can only be inherited while interfaces can not be it has to be implemented.
(b). Interface cannot implement any methods, whereas an abstract class can have implementation.
(c). Class can implement many interfaces but can have only one super class.
(d). Interface is not part of the class hierarchy while Abstract class comes in through inheritance.
(e). Unrelated classes can implement the same interface.
9. What is difference between Static and Non-Static fields of a class ?
--> Non-Static values are also called as instance variables. Each object of the class has its own copy of Non-Static instance variables.
So when a new object is created of the same class it will have completely its own copy of instance variables. While Static values have only one copy of instance variables and will be shared among all the objects of the class.
10. What are inner classes and what is the practical implementation of inner classes?
--> Inner classes are nested inside other class. They have access to outer class fields and methods even if the fields of outer class are defined as private.
public class Pcds
{
class pcdsEmp
{
// inner class defines the required structure
String first;
String last;
}
// array of name objects
clsName personArray[] = {new clsName(), new clsName(), new clsName()};
}
Normally inner classes are used for data structures like one shown above or some kind of helper classes.
11. What is a constructor in class?
--> Constructor has the same name as the class in which it resides and looks from syntax point of view it looks similiar to a method. Constructor is automatically called immediately after the object is created, before the new operator completes.
Constructors have no return type, not even void. This is because the implicit return type of a class' constructor is the class type itself. It is the constructor's job to initialize the internal state of an object so that the code creating an instance will have a fully initialized, usable object immediately.
12. Can constructors be parameterized?
--> Yes we can have parameterized constructor which can also be termed as constructor overloading. Below is a code snippet which shows two constructors for pcdsMaths class one with parameter and one with out.
class pcdsMaths
{
double PI;
// This is the constructor for the maths constant class.
pcdsMaths()
{PI = 3.14;}
pcdsMaths(int pi)
{
PI = pi;
} }
13. What is the use if instanceof keyword? and How do refer to a current instance of object?
--> "instanceof" keyword is used to check what is the type of object.
we can refer the current instance of object using "this" keyword. For instance if we have class which has color property we can refer the current object instance inside any of the method using "this.color".
14. what is Bootstrap, Extension and System Class loader? or Can you explain primordial class loader?
--> There three types of class loaders:-
BootStrap Class loader also called as primordial class loader.
Extension Class loader.
System Class loader.
Let’s now try to get the fundamentals of these class loaders.
Bootstrap Class loader : Bootstrap class loader loads those classes those which are essential for JVM to function properly. Bootstrap class loader is responsible for loading all core java classes for instance java.lang.*, java.io.* etc. Bootstrap class loader finds these necessary classes from “jdk/ jre/lib/rt.jar”. Bootstrap class loader can not be instantiated from JAVA code and is implemented natively inside JVM.
Extension Class loader : The extension class loader also termed as the standard extensions class loader is a child of the bootstrap class loader. Its primary responsibility is to load classes from the extension directories, normally located the “jre/lib/ext” directory. This provides the ability to simply drop in new extensions, such as various security extensions, without requiring modification to the user's class path.
System Class loader : The system class loader also termed application class loader is the class loader responsible for loading code from the path specified by the CLASSPATH environment variable. It is also used to load an application’s entry point class that is the "static void main ()" method in a class.
15. what’s the main difference between ArrayList / HashMap and Vector / Hashtable?
--> Vector / HashTable are synchronized which means they are thread safe. Cost of thread safe is performance degradation. So if you are sure that you are not dealing with huge number of threads then you should use ArrayList / HashMap.But yes you can still
synchronize List and Map’s using Collections provided methods :-
List OurList = Collections.synchronizedList (OurList);
Map OurMap = Collections.synchronizedMap (OurMap);
16. What are access modifiers?
--> Access modifiers decide whether a method or a data variable can be accessed by another method in another class or subclass.
Four types of access modifiers:
Public : - Can be accessed by any other class anywhere.
Protected : - Can be accessed by classes inside the package or by subclasses ( that means classes who inherit from this class).
Private :- Can be accessed only within the class. Even methods in subclasses in the same package do not have access.
Default :- (Its private access by default) accessible to classes in the same package but not by classes in other packages, even if these are subclasses.
17. Define exceptions ?
--> An exception is an abnormal condition that arises in a code sequence at run time. Basically there are four important keywords which form the main pillars of exception handling: try, catch, throw and finally. Code which you want to monitor for exception is contained in the try block. If any exception occurs in the try block its sent to the catch block which can handle this error in a more rational manner. To throw an exception manually you need to call use the throw keyword. If you want to put any clean up code use the finally block. The finally block is executed irrespective if there is an error or not.
18. What is serialization?How do we implement serialization actually?
--> Serialization is a process by which an object instance is converted in to stream of bytes. There are many useful stuff you can do when the object instance is converted in to stream of bytes for instance you can save the object in hard disk or send it across the network.
In order to implement serialization we need to use two classes from java.io package ObjectOutputStream and ObjectInputStream. ObjectOutputStream has a method called writeObject, while ObjectInputStream has a method called readObject. Using writeobject we can write and readObject can be used to read the object from the stream. Below are two code snippet which used the FileInputStream and FileOutputstream to read and write from harddisk.
What is the difference between HashTable and ArrayList?
2) Retrieving value from HashTable is faster as it is linked with key whereas it is difficult in case of ArrayList value is fetched with index
3) HastTable is used for maintaining huge data
What is the Difference between a process and a thread?
A process has its own address space. however, a thread shares the
address space of the process with other threads running within that
process...
What is Abstraction and types of Access Specifier and define?
Abstraction:
"Abstraction is a process of hiding the implementation details and displaying the essential features."
"Abstraction is a process that involves identifying the critical behavior of an object and eliminating irrelevant and complex details."
Example1: A Laptop consists of many things such as processor, motherboard, RAM, keyboard, LCD screen, wireless antenna, web camera, usb ports, battery, speakers etc. To use it, you don't need to know how internally LCD screens, keyboard, web camera, battery, wireless antenna, speaker's works. You just need to know how to operate the laptop by switching it on. Think about if you would have to call to the engineer who knows all internal details of the laptop before operating it. This would have highly expensive as well as not easy to use everywhere by everyone.
So here the Laptop is an object that is designed to hide its complexity.
How to abstract: - By using Access Specifiers
.Net has five access Specifiers
Public -- Accessible outside the class through object reference.
Private -- Accessible inside the class only through member functions.
Protected -- Just like private but Accessible in derived classes also through member
functions.
Internal -- Visible inside the assembly. Accessible through objects.
Protected Internal -- Visible inside the assembly through objects and in derived classes outside the assembly through member functions.
1- Why would you like to change the company?
What is Abstraction and types of Access Specifier and define?
Abstraction:
"Abstraction is a process of hiding the implementation details and displaying the essential features."
"Abstraction is a process that involves identifying the critical behavior of an object and eliminating irrelevant and complex details."
Example1: A Laptop consists of many things such as processor, motherboard, RAM, keyboard, LCD screen, wireless antenna, web camera, usb ports, battery, speakers etc. To use it, you don't need to know how internally LCD screens, keyboard, web camera, battery, wireless antenna, speaker's works. You just need to know how to operate the laptop by switching it on. Think about if you would have to call to the engineer who knows all internal details of the laptop before operating it. This would have highly expensive as well as not easy to use everywhere by everyone.
So here the Laptop is an object that is designed to hide its complexity.
How to abstract: - By using Access Specifiers
.Net has five access Specifiers
Public -- Accessible outside the class through object reference.
Private -- Accessible inside the class only through member functions.
Protected -- Just like private but Accessible in derived classes also through member
functions.
Internal -- Visible inside the assembly. Accessible through objects.
Protected Internal -- Visible inside the assembly through objects and in derived classes outside the assembly through member functions.
1- Why would you like to change the company?
1) I am looking for a more challenging career in a firm with a larger employee base such as yours.
2) Keeping in mind my career goals, the time has come for me to move onto the next rung of
the ladder and make a mark for myself. This can be achieved in a company like this.
3) It is just a career move to enhance my knowledge in my own area of interest.
After completion of this question only interview will go for further questions
2- SQL Server - Acid Properties (Atomicity, Consistency, Isolation, Durability) Example
Atomicity
It
is one unit of work and does not dependent on previous and following
transactions. This transaction is either fullycompleted or not begun at
all. Any updates in the system during transactionwill complete entirely.
Ifany reason an error occurs and the transaction is unable to complete
all of itssteps, then the system will returned to the state where
transaction was started
Consistency
Data
is either committed or roll back, not “in-between” case where something
has beenupdated and something hasn’t and it will never leave your
databasetill transaction finished. If the transaction completes
successfully, then allchanges to the system will have been properly
made, and the system will be in avalid state. If any error occurs in a
transaction, then any changes alreadymade will be automatically rolled
back. This will return the system to itsstate before the transaction was
started. Since the system was in a consistentstate when the transaction
was started, it will once again be in a consistentstate.
Isolation
No
transaction sees the intermediate results ofthe current transaction.
Wehave two transactions both are performing the same function and
running at thesame time, the isolation will ensure that each transaction
separate from other untilboth are finished.
Durability
Once transaction completed whatever the changesmade to the system will be permanent even if the system crashes right after
Whenevertransaction will start each will obey all the acid properties.
No comments:
Post a Comment