Contact payment company interview questions

Source: Internet
Author: User

Question 1: Describe the differences between Post requests and Get requests and common application scenarios of the two

Both Post and Get requests are requests to obtain data from the server. Get requests are sent to the server through URLs, post is a request that puts the data to be submitted in the HTTP package body to submit data to the server. Theoretically, there is no length limit. For example, the URL length limit of IE browser is 2 kb. Post requests are more secure than Get requests. Because Get requests are implemented through URLs, the user name and password are easily exposed. Therefore, you must encrypt parameters when passing them. You can use Base64 () for encoding and decoding.

var b = new Base64();b.encode(pwd)b.decode(pwd)

The analysis of the two is in place in this article: complaints about GET and POST


Question 2: major differences between forward and redirect

Forward is the internal redirection of the server. After the program receives the request, it is redirected to another program, and the client does not need to know it. redirect means that a status header is sent to the user after the server receives the request, and the user requests again, in this case, there will be two communications between the client and the server. Because the request is made again, the information of the previous jsp is not retained.



Question 3: Write the execution results of the following javascript code

var a1 = 10; var a2 = 20;var r1 = "a1+a2=" + a1 + a2;var str1 = "I am a soft engineer";var r2 = str1.substring(9, 14);document.write(r1);document.write("%");document.write(r2);
Result: a1 + a2 = 1020% ft en


Question 4: Write the execution result of the following javascript code and explain the cause.

 function Person(name) {        this.name = name;        this.move = function () { alert("Prepare move for person [" + this.name + "]") }; } Person.prototype.move = function () { alert("Ready move for person [" + this.name + "]") }; $(function () {         var person = new Person("Jim");        person.move(); });

The execution result is: Prepare move for person [Jim]

I personally think the reason is that if the object comes with the move () method, it will not search for the prototype chain.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.