Interview skills
1. Memorize your resume
The reason: Interview to the first question, generally is to give you a simple introduce yourself, or talk about your recent projects, an interviewer, if even familiar with their resumes, for mentioned project, technology cannot describe clearly, I think no company will accept this, even if you are a super talent, not your self expression, estimate will therefore have a headache, So, remember: be sure to memorize your resume, do not require you to memorize all, at least to memorize the two companies you have recently worked in, the two companies in which you have done the project, the module you are responsible for, the technology used in the project and the corresponding technology implementation scheme (this is particularly important).
2. Deeply understand and memorize some basic Knowledge of Java
The reason: Most companies interview junior or senior, both written examination and interview, and will be asked a series of basic questions, these questions may include the JVM, strings, collection, threads, etc., if each allow you to memorize you must remember, so is the understanding of memory, for the JVM, if let you talk about your understanding of the JVM, So you first need to know what the JVM’s structures are, what each structure does, and then consider how a Java object will traverse those structures from creation to recycling. If you combine these aspects, you’ll get more out of it and you’ll understand it better.
If you are talking about collections, for example, the difference between List, ArryList, LinkedList, Vector, etc., then the same way, you need to understand the structure of each one so that you can understand what it does, so that you can be more concise in your daily usage, and in the interview process, Nor will I be speechless.
Keep confident and heavy calm
Reason: in the interview process, confidence is indispensable, I believe you can, on the way to the interview you can say to yourself: I belive I can! Anyway, that’s what I did, and my heart suggests that, in fact, when facing the interviewer, your confident state will also make the interviewer think you are a very confident person, at least from the feeling will give you a high score.
Another heavy is to keep calm, if is to let you provide technical solution or tell me about a technology principle, it is not necessary to a nervous a guru said anything, you can say to the interviewer: I think first, and then their assembly knowledge of memories, assembly language, well organized, able to better performance you like, isn’t it? Interview everyone will be nervous, I will also be nervous, sometimes clearly remember the knowledge points forget, it doesn’t matter, boldly say forget, or directly say don’t know. Remember, it’s okay not to know some of it, but if you know all of it, you’re a CTO (just kidding).
4. Try to remember questions that you couldn’t answer or were inappropriate during the interview
Why: It’s okay to fail the interview, because every company has different requirements and may ask different questions about what you’re good at, but remember this: That you couldn’t answer the problems in the process of the interview, or you feel answer not very accurate, down on your own, if not, you can ask if the interviewer on the spot to have a good answer, if the interviewer doesn’t want to tell you (usually based in the interviewer is too lazy to answer you), then you will own home slowly check information, if it is a certain technology, You can also write your own case, after all, there are so many knowledge points, questions change, principles remain the same, the interview is also a process of learning knowledge, let you know most companies need or require the technology at present. I don’t know this time. I’ll know next time.
Before going to the interview, it’s best to find out about the company you are going to interview with
Reason: As the saying goes, you can win a hundred battles if you know yourself and the enemy. Interview is a battle, you need to know the basic information of the company you are interviewing with, including the job requirements, so that you can get a general idea of the technical requirements of the company you are interviewing with. The reason why I want you to know about the company’s main products and projects is to give you a general understanding of one of the company’s technical architecture, including you may have questions or doubts about one of their implementation methods, I believe the interviewer is willing to help you answer these questions. In this way, you both map the performance and learn the knowledge, why not?
6. Schedule your interview
Reason: It is estimated that many people do not understand this, and most of them are confused about how to arrange the interview time. But here’s the trick. If you have multiple interviews coming up, put the company you most want to work for at the bottom of the interview list, so that you’ve been through all the other companies. If you succeed, it’s an opportunity, and if you don’t, it’s a preparation for the final interview.
First, you need to remember the company and the basic information (this means that you are not from overseas). Second, if you can’t remember, you can first respond to a time, after learning the company information, through email or other ways to adjust the interview time. And it is recommended to arrange a day of interviews with no more than two companies, the best is a morning, afternoon, so that you can have enough time to adjust the state.
Summary of interview questions
1. Details of JVM structure principle and GC working mechanism
A: When it comes to GC, remember two things: 1. GC is responsible for reclaiming all memory that has no reference objects. Note: the garbage recycling is without any reference object to occupy the memory space rather than the object itself, 2, the GC recovery mechanism of two kinds of algorithms, and reference counting method b, accessibility analysis algorithm (accessibility, here you can see base 2 Java object what cycle), as for more detailed GC algorithm is introduced, everyone can refer to: Java GC mechanism algorithm.
The life cycle of Java objects
A: The create phase, the application phase, the invisible phase, the unreachable phase, the collection phase, the finalization phase, the object space reallocation phase, and so on, refer to the Java Object life cycle.
3. Storage principle of Map or HashMap
A: HashMap is a structure consisting of an array + a linked list. For details, see the implementation principle of HashMap.
4. When A and B fields in A table are combined indexed, will using A or B alone have index effect? (How to use like query to have index effect)
Answer: see A, B two fields do combination index, who is in front, who is behind, if A is in front, then use A alone will have index effect, use B alone will not, and vice versa. Similarly, when using a like fuzzy query, if only the preceding % is used, there is an index effect, and if a double % match is used, there is no index effect.
5. How to consider time zone conversion when storing date format in database?
A: Use TimeStamp, the reason is: Java programming encountered time zone conversion problems.
6. What methods are in the JavaObject class?
A: What are the methods of Object?
7, HTTP protocol, GET and POST differences
A: Talk about the difference between GET and POST in HTTP.
Threads, design patterns, caching aspects
SimpleDataFormat is non-thread-safe, so how can it be better used without risk?
A: About SimpleDateFormat safe time formatting thread safety.
2. What do you think of design patterns and briefly describe your understanding of the observer pattern
A: 1, what is the use of design pattern 2, observer pattern class diagram and implementation.
3. How can sessions be shared in a cluster environment
A: 1. Session sharing of Java cluster 2. Multi-server sharing scheme of session.
4. How to refresh and synchronize cache in distributed and cluster environment?
A. How to refresh the cache? Each cache framework has its own refresh mechanism, or cache invalidation mechanism. Take Redis and Ehcache for example, they both have their own expiration mechanism. In addition, when they actively refresh coverage, they only need to obtain the corresponding key to cover the data.
B. How do caches keep synchronized? This redis has its own cluster synchronization mechanism, namely replication function, for details: based on redis distributed cache implementation, Ehcache also has distributed cache synchronization configuration, just need to configure different server addresses, see: Ehcache distributed cache synchronization.
5, a SQL execution time is too long, how do you optimize, from what aspects?
Answer: 1, check whether SQL involves multiple tables of the join table or sub-query, if so, to see whether the business can be split, related fields redundant or merged into temporary tables (service and algorithm optimization);
2, related to linked list query, whether can be divided table query, single table query results for field integration;
3, if the above two can not operate, must be linked list query, then consider the corresponding query condition index. Speed up the query speed;
4, for a large number of tables to separate the history table (such as transaction table);
5, database separation of master and slave, read and write separation, reduce the pressure of reading and writing for the same table at the same time, as for master and slave synchronization, MySQL has its own binlog to achieve master and slave synchronization;
6, explain analysis of SQL statements, view execution plan, analysis of index is used, analysis of scan rows and so on;
7. Check the mysql execution log to see if there are any other problems.
Personal understanding: fundamentally speaking, the slow query is taking up a lot of mysql memory, so you can from this aspect to consider hand.
Design scheme correlation
The interview will also ask questions about the design proposal, such as:
1. Your interface service data has been intercepted. How do you prevent malicious data submission?
A: We can set a business number in the interface transfer parameter, which is used to distinguish whether the submission is repeated. In this way, even if the data is captured, the other party cannot distinguish the meaning of each field. In this case, this business number comes into play.
2. If the server often goes down, what aspects do you troubleshoot the problem from?
Answer: this left each to see an officer complement.
All in all, we have to see what we should see and learn what we should learn. Again, basics matter! Interview skills are also important, so good luck finding the job you want
In addition, advise everyone not to frequently job-hopping, these knowledge points can improve is good, do not blindly job-hopping, looking for a job is very tired, and no company like frequent job-hopping employees.
Java program monkey job hopping should learn what aspects of technology
Internet products, large enterprise projects often used:
1. Concurrent processing technology. Specific to Java usually involves java.util.concurrent, concurrent locking mechanism, NIO and other aspects, of course, the recent popular Netty framework can also be used as one of the alternatives for high concurrency processing, which requires a deep understanding of Java thread scheduling mechanism. However, these problems can only exist in one JVM for objects that may be involved in concurrency control (such as ReentrantLock, etc.). Once the system is large enough to deploy multiple JVMS to handle concurrency, a shared session technique (such as Spring-Session) should be adopted. Or, if possible, design the system backend as a stateless service, which requires a deep understanding of RESTful.
2. High availability and load balancing. Downtime of Internet products and enterprise applications usually requires a small amount of Downtime within a year, which requires sufficient high availability and load balancing architecture. This has nothing to do with Java technology itself, but it is a necessary technology for a junior programmer to become a senior programmer or even an architect CIO. Therefore, it is appropriate to take a look at Nginx, HAProxy, and other support for this aspect. In addition, now the most “fashionable” approach is to apply Docker, with ETCD, Kubernetes and other tools in the container level to achieve high availability and load balancing, of course, this needs to see the actual demand, the most fashionable is not necessarily the most suitable, to consider the construction cost.
3. Caching. Cache should be the eternal truth to improve the response speed in large systems or under high concurrency conditions (although I have seen the article about zero cache achieved by big data processing technology in taobao’s commodity search function, it is generally impossible to reach taobao’s volume and technical level), there are too many tools in this aspect. Ehcache, memcached, Redis… From the perspective of Java, you need to understand the Java connector to these tools, and the JSR-107 standard behind the caching technology. You can refer to the implementation of Spring-Cache and read the source code for further understanding.
4. Asynchronous processing technology. This is usually one of the ways to offset high concurrency. From a Java perspective, the simplest asynchronous processing is to start a new asynchronous thread, which also requires some understanding of Java thread scheduling. Of course, you can also use @async in Spring to easily implement asynchronous thread processing. If it is a very resource-intensive business process, a simple asynchronous thread will not meet the requirements, which requires some message-oriented middleware to do the asynchronous processing. There are many message-oriented middleware, such as ActivemQ, RabbitMQ, Kafka… What you need to know is Java’s connector to these middleware. However, the most critical aspect of asynchronous processing is the issue of transaction assurance, which may require some understanding of the two-step commit of a transaction.
Here’s a learning curve for Java developers looking to jump ship:
Java Architecture/Distributed: 697579751 (Daniu AC Group)