Java EE - Interview Questions and Answers for 'Http' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Java EE - Interview Questions and Answers for 'Http' - 13 question(s) found - Order By Newest

 Q1. What is session tracking and how do you track a user session in servlets?Java EE
Ans. Session tracking is a mechanism that servlets use to maintain state about a series requests from the same user across some period of time. The methods used for session tracking are:

User Authentication - occurs when a web server restricts access to some of its resources to only those clients that log in using a recognized username and password

Hidden form fields - fields are added to an HTML form that are not displayed in the client's browser. When the form containing the fields is submitted, the fields are sent back to the server

URL rewriting - every URL that the user clicks on is dynamically modified or rewritten to include extra information. The extra information can be in the form of extra path information, added parameters or some custom, server-specific URL change.

Cookies - a bit of information that is sent by a web server to a browser and which can later be read back from that browser.

HttpSession- places a limit on the number of sessions that can exist in memory.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     j2ee   servlets   session   session management   web applications   cookies   httpsession   url rewriting   architecture     Asked in 1 Companies


 Q2. What is URL?
Java EE
Ans. URL is Uniform Resource Locator which is representation of HTTP address.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     j2ee   http   internet   url      basic        rare


 Q3. What is HTTP ?Java EE
Ans. HTTP or Hypertext Transfer Protocol is internet protocol for tranmission of hypertext ( text with meta data ) over internet.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     j2ee   http   internet  fidelity     Asked in 2 Companies      basic        frequent


 Q4. What are different types of cookies ?Java EE
Ans. Session cookies , which are deleted once the session is over.

Permanent cookies , which stays at client PC even if the session is disconnected.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     j2ee   servlets   session   session management   web applications   cookies   httpsession


 Q5. what is content negotiation?
Ans. Suppose we want to visit a site for any information, information can be represented in different languages like English,German or may be other and their format for presentation can also differ from HTML to PDF or may be Plain text. In this case when an client makes an HTTP request to a server, client can also specify the media types here. Client can specify what it can accept back from host and on the basis of availability the host will return to the client. This is called content negotiation because client and server negotiated on the language and format of the content to be shared.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     j2ee   internet   content negotiation   http   architecture


 Q6. Why Web services use HTTP as the communication protocol ?Web Service
Ans. With the advent of Internet, HTTP is the most preferred way of communication. Most of the clients ( web thin client , web thick clients , mobile apps ) are designed to communicate using http only. Web Services using http makes them accessible from vast variety of client applications.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     rest   webservices   web servuces   http   architecture   technical architect


 Q7. What is the use of HTTPSession in relation to http protocol ?Java EE
Ans. http protocol on its own is stateless. So it helps in identifying the relationship between multiple stateless request as they come from a single source.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     j2ee   servlets   web application   session   httpsession   architecture     Asked in 1 Companies


 Q8. Why using cookie to store session info is a better idea than just using session info in the request ?Java EE
Ans. Session info in the request can be intercepted and hence a vulnerability. Cookie can be read and write by respective domain only and make sure that right session information is being passed by the client.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     j2ee   servlets   session   session management   web applications   cookies   httpsession   architecture


 Q9. http protocol is by default ... ?Java EE
Ans. stateless

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     j2ee   servlets   session   session management   web applications   cookies   httpsession   architecture


 Q10. What doesn Http keep alive header does ?Java EE
Ans. Http is connection less by default. header informs hosts to keep the connection alive so that the same connection can be reused for multiple communication.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   http   http-alive   client server communication


 Q11. Can we send a request body with the Get Request ? If not, What is the alternate to pass message to the Get Request ?Web Service
Ans. Request Body in case of Get Request has no meaning and hence it's not parsed when the request is received. Alternatively Request Parameters are passed as either Path Params or Query Params.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     rest  web services  http  http methods  get request


 Q12. What is the difference between http and https ?Java EE
Ans. https encrypts the data using SSL whereas http sends it as plain text, So https is secure protocol whereas http is not.

Moreover https connects on port 443, while HTTP is on port 80

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     http  https  web protocols     Asked in 1 Companies        basic


 Q13. Explain some of the http status codes you know ?Java EE
Ans. 500 is Internal Server Error

404 is resource not found

400 is Bad Request

403 is Forbidden

401 is Unauthorized

200 is OK

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     http  http status codes     Asked in 2 Companies        frequent


 Q14. Which of the following http response means the resource is not found ?Java EE
a. 500
b. 200
c. 404
d. 400

Ans.c. 404

 Q15. Which of the following is true ?Core Java
a. http and https are secured protocols
b. http is a secured protocol whereas https is not a secured protocol
c. https is an unsecured protocol whereas https is a secured protocol
d. https and https are unsecured protocols

Ans.b. http is a secured protocol whereas https is not a secured protocol


Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: