0

I have an interview later today and one of the sample questions I might be asked is as follows:

"Describe the lifecyle of a request to http://mywebsite.com/jobs/edit/1 from front-end to middle/API to backend. What kind of software architecture would be needed at each step?"

I am not very sure of any of this. Could someone help me out and post what they think would be a good answer to a question like this? Thanks.

jas7457
  • 1,971
  • 5
  • 30
  • 47
  • There is already a good answer that may help [here][1] [1]: http://stackoverflow.com/questions/4814514/http-request-life-cycle – TheAnswerIs42 Aug 05 '14 at 11:07
  • Would the part about software architecture simply be that you need a web server and a client machine to be able to communicate over HTTP using a TCP/IP protocol? This is the part that really trips me up – jas7457 Aug 05 '14 at 11:11
  • created another extensive answer that might help future viewers of this question: https://github.com/hardikvasa/http-connection-lifecycle – hnvasa Jul 01 '19 at 16:25

1 Answers1

1

I guess by architecture, software is meant in this question.

    1. The IP of mywebsite.com is resolved by a DNS request. 
    2. The DNS request is answered by the DNS server.
    3. A TCP/IP connection is opened to *.*.*.* 
       A http get/post request is issued to the server via HTTP
    4a) A firewall is passed (if present), and the request is hopefully forwarded to the web-server
    4b) The web-server receives the request, 
    and based on it's virtual hosting configuration information and the information in the http-headers, will forward the request to the respective application 
    via FastCGI or using a Server-Module/ISAPI.'
    5. The web-application receives the request for http://mywebsite.com/jobs/edit/1
    6a) HTTP-modules are executed for this request (e.g. forms authentication, banning)
    6b) If the route is registered in the routing regex, the request is routed to the appropriate MVC controller (jobs)
    7. The edit action in the MVC controller is called with parameter 1
    8. The edit view is returned for parameter 1
    9. The client receives the HTML
    10. the port is closed by the client & server

    "Describe the lifecyle of a request to http://mywebsite.com/jobs/edit/1 from front-end to middle/API to backend. 
    What kind of software architecture would be needed at each step?"

    1. Requires DNS-client
    2. Requires DNS-Server
    3. Requires web-browser or TCP/IP/HTTP capable application
    4. Requires web-server that is virtual name based hosting capable
    5. Requires a web-application, like PHP/ASP.NET/Python/Perl
    6-8. Requires MVC application architecture
    9-10. Stateless architecture
Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442