1. What are your top two technology stations and the two apps you use most often? What is the main solution to your needs?
2. Please describe the difference between GET request and Post request in HTTP protocol.
Operation mode |
Data location |
Vmcontext |
Data security |
Length limit |
Application Scenarios |
GET |
HTTP Header |
Plaintext |
Not safe |
Small length |
Querying data |
POST |
HTTP body |
Can be clear and dense |
Safety |
Supports large data transfer |
modifying data |
3. Please describe the area of the session and the cookie.
- The cookie data is stored on the client's browser and the session data is placed on the server.
- Cookies are not very secure, and others can analyze cookies stored locally and make cookie spoofing, taking into account that security should use the session.
- The session will be saved on the server for a certain amount of time. When the number of accesses increases, the performance of your server will be compared, and cookies should be used in consideration of mitigating server performance.
- A single cookie cannot hold more than 4K of data, and many browsers limit a maximum of 20 cookies per site.
- So personal advice: the login information and other important information stored as a session, Other information if necessary to keep, can be placed in a cookie
4. Briefly describe the relationship between servlet and JSP,
JSP is the servlet JSP inherits the servlet
What are the 5.JSP built-in objects and their respective roles?
Request object:
The client's request information is encapsulated in the requests object to understand the customer's needs and respond. It is an instance of the HttpServletRequest class
Response object:
Contains information about the response to a customer request, but it is seldom used directly in the JSP. It is an instance of the HttpServletResponse class.
Session object:
Refers to a client-to-server session, starting from the client connection to a webapplication of the server until the client disconnects from the server. It is an instance of the HttpSession class
Out object:
is an instance of the JspWriter class and is an object commonly used to output content to the client
Page object:
Points to the current JSP page itself, a bit like the this pointer in the class, which is an instance of the Java.lang.Object class
Application object:
The Application object implements the sharing of data among users and can store global variables. It starts at the start of the server until the server shuts down, during which time this object will persist, so that in the connection between the user's front and back connections or different users,
You can manipulate the same property of this object;
The operation of this object property anywhere will affect access to it by other users. The startup and shutdown of the server determines the life of the Application object. It is an instance of the ServletContext class
6. Describe your understanding of Java encapsulation, inheritance, polymorphism.
7. Write out 2 common design patterns (pseudo-code) and briefly describe the application scenario.
8.HashMap and Hashtable differences.
HashMap Read and write fast, but not secure
HashMap can be almost equivalent to Hashtable, except that HashMap is non-synchronized and can accept null (HashMap can accept null key value (key) and values (value), and Hashtable does not). HashMap is non-synchronized, and Hashtable is synchronized, which means that Hashtable is thread-safe, multiple threads can share a hashtable, and if there is no proper synchronization, Multiple threads are not able to share hashmap. Java 5 provides Concurrenthashmap, which is an alternative to Hashtable that is better than Hashtable extensibility. Another difference is that the HashMap iterator (Iterator) is a fail-fast iterator, and Hashtable's enumerator iterator is not fail-fast. So when there are other threads that change the structure of the HashMap (add or remove elements), the concurrentmodificationexception will be thrown, but the remove () of the iterator itself The Concurrentmodificationexception method removes the element without throwing an exception. But this is not a certain behavior, depends on the JVM. This one is also the difference between enumeration and iterator. Because Hashtable is thread-safe and synchronized, it is slower than HashMap in a single-threaded environment. If you don't need to sync and just need a single thread, it's better to use HashMap performance than Hashtable. HashMap cannot guarantee that the order of elements in the map will be constant over time.
The difference between 9.HashSet and TreeSet.
The difference between 10.ArrayList and LinkedList.
- 1.ArrayList is the realization of the data structure based on dynamic array, LinkedList data structure based on linked list.
- 2. For random access get and set,arraylist feel better than LinkedList, because linkedlist to move the pointer.
- 3. Add and Remove,linedlist for new and delete operations are dominant because ArrayList is moving data
The difference between 11.== and equals.
12. Briefly describe the generic, reflection, annotated application scenarios and the respective issues that were addressed.
What are the methods of the 13.Thread class, and how to implement thread synchronization in many ways?
14 What is the difference between a process and a thread, and in what ways Java can create threads.
15. The existing student table structure (student-id,class-id,name), please write down the SQL statement that counts how many students are in each class.
16. If you are developing a system login program, please describe how you can remember the user name and password this operation, and how to implement?
17. In the view layer does not support the storage of cookies, the server does not support the session of the scene how to maintain user login status.
18. Design a CMS system or blog system table structure (draw the approximate UML diagram can be).
Questions on Java basic plane