Summarize the Java Background Development interview questions and the java Background interview questions.

Source: Internet
Author: User
Tags reverse dns

Summarize the Java Background Development interview questions and the java Background interview questions.

Jing er has been summing up some interview questions recently, because he must take everything seriously. The same is true for the interview. As the interviewer of The financial department of Xinmei University, jiner tells you responsibly that the following questions cannot be answered and the interview will fail. However, the following are by no means the original questions. You will find that you are not strong enough to be asked.

1> how to locate online service OOM Problems

2> where does jvm gc roots exist?

3> How does mysql innodb optimize queries?

4> concepts of java cas

 

The following is a simple answer to these questions based on your interview criteria.

1> how to locate online service OOM Problems

Because the interview is mainly based on ideas and the answer is second, if I answer this question. I may come up with the whole idea: Java service OOM, the common reason is

Memory allocation may be too small, but normal services use a large amount of memory.

For example, the jmap-heap command can check the heap memory size and usage of the New Generation and old generation to see if the memory allocation is too small.

When an object is frequently applied but not released, the memory is constantly leaked, resulting in memory depletion.

For example, jmap-histo: The live object displays information about the surviving object and sorts the information according to the memory occupied. It is intuitive because it contains the number of instances, memory occupied, and class name.

Worker a resource is frequently requested and the system resources are exhausted. For example, you can create threads and initiate network connections.

You can use pstree and netstat to view the number of threads created by the process and the number of network connections. If resources are exhausted, OOM may also appear. You can also view/proc/$ {PID}/fd and/proc/$ {PID}/task to view the handle details and number of threads.

  

2> where does jvm gc roots exist?

This question should be answered step by step. If not, you 'd better briefly describe the JVM memory structure and root search algorithm (gc roots Tracing) before answering this question) perform accessibility analysis.

The GC Roots objects include the following (this problem was asked by our architect when we came to the new America University ):

Objects referenced in the Virtual Machine stack (local variable table in stack metadata)

Objects referenced by class static attributes in the callback Method Area

Objects referenced by constants in the constant Method Area

References of JNI in the local method Stack

The main area of GC management is Java heap. Generally, only garbage collection is performed for the heap. The method area, stack, and local method area are not managed by GC, so these areas are selected as gc roots. Objects referenced by gc roots will not be garbage collected.

  

3> How does mysql innodb optimize queries?

There are many answers to this question, and their experiences are different. This article mainly examines the ability to summarize and think in practice. It is better for the interviewer to add examples of use in the actual project after the summary of the general answer.

️ Innodb_buffer_pool_size this parameter is used to buffer data and indexes, and can linearly improve performance. The maximum value can be set to 7% of the memory size.

The slow query log is opened and the parameter log-queries-not-using-indexes is added to facilitate the optimization of all SQL statements not indexed in the system.

Explain performs query analysis using explain to check whether indexes are used and the number of rows accessed by rows

Disable skip_name_resolve for reverse DNS resolution.

In addition, there are some practices that go deep into the bone marrow during code writing. For example, the dynamic/static data separation increases the query_cache hit rate, reduces field redundancy, reduces queries, and breaks down complex queries, what about paging optimization.

Many people say that the interview questions have little to do with actual development, and they feel useless. In fact, many live training courses can be used for two months. The gap between people is not obvious to the extent that you can do it. But I have worked on a project before, and I am working with others. after doing so, I want to modify various slow query problems and performance problems for many others. I read the SQL statements they wrote, and I found that these SQL statements are naturally not used. Because I pay attention to these aspects when everyone is there, and I take it for granted that this affects performance.

There is also that there are fewer issues when the person who is evaluated in the interview actually writes the code, because they are more comprehensive. Many people do not intend to issue bugs, but they do not know. They do not know the situation A or B, and do not know the implementation of the JVM underlying layer, therefore, unexpected results may be generated. If something goes wrong, I don't know which direction to think about.

 

4> concepts of java cas

Cas: compare and swap, compare and exchange

The concurrent package in java uses cas to implement an optimistic lock different from the synchronized synchronization lock.

CAS uses CAS commands of the CPU and JNI to complete java's non-blocking algorithm. Other yard operations are completed using similar features. Compared with synchronized, java's concurrent package mainly depends on its performance improvement.

  

Question Run Time:

  In the past few years, we have purchased pumpkin for Halloween and made pumpkin lights by ourselves. The western knife I bought for fresh meat in the United States is very safe. I washed the pumpkin and put a clean iron basin next to it so that the fresh meat could be carved with pumpkin lights. I went to bed. I promised to use the remaining corner material for the pumpkin lamp to make him a pumpkin pie, so I would see it clean when I went to bed. I remember that one year I felt a waste of it. I had to eat the lid on the top of the pumpkin, and the fresh meat was very angry. We had to go out the next day and re-buy a Beckham pumpkin and re-create a pumpkin lamp.

Pumpkin pie can directly cook and put sugar into the flour to make it into a pancake for frying. It tastes better with milk and noodles. I always get used to pinching out various animal shapes to make a dish of animal food with outsize and tenderness. However, if it is a whole pumpkin, it will be steamed into 9 minutes and then ground it with flour. The longer it takes, the more elastic it will be. Of course, this job is done with fresh meat. But in this case, it is difficult to compress the shape into a ball with a spoon. At the beginning of the oil pan, it was a small fire. The pumpkin pie was almost ripe, and then ignited. The outside was crisp and the inside was soft.

It's a pity that I am very busy now. On weekends, I just made some snacks for fresh meat in my office. I remember that I was always idle, and I was always reluctant to pressurize myself when I was looking for a job. You can live your own life. I once went to huake to see the Peony with fresh meat and saw a girl lying leisurely on a bench and basking in the sun. This is not the original one. After so many years, I told myself that "there are flowers that can be folded straight and must be folded" and I was ready to accept everything now, in addition to having tried everything you want, I still feel a little sad.

Look at my BOSS on my cell phone. I said, "My husband and I check my daughter-in-law's cell phones to see who the daughter-in-law has been chatting with. What are you talking about ". The male casually said, "Yes, I care, so I confiscated your cell phone ." Then let's look at the BOSS's direct recruitment.

Don't look at the weekend. I usually don't go home, that is, I just go home on weekends. Every day, the male asked me to ask if I was alive. He recently changed his profile picture. his profile picture is a path of Neusoft, because we used to have a face on that small road every morning when we were in Neusoft. Since then, two people have been concerned about each other, trusting each other, and working together. Struggle is hard, and it is hard to stick to it if you are a person. The two men encouraged each other to move forward. When they wanted to give up, they couldn't bear to disappoint each other, so they achieved one goal after another.

Male recently held an interview along the road. During the interview, he gained a dozen young and beautiful headhunters and HR staff. The reason for his job change is: "I want to find a job near my daughter-in-law, and send my daughter-in-law to and from work every day ." I believe in my family's self-control. When I saw my offer salary, I quickly sent a text message asking him, "will you still be able to wash my clothes every week if you are so awesome ?" The male did not hesitate to return: "Yes ". As a result, I went home on the weekend and told me that I still had a few unwashed clothes last week. Let me wash my clothes if I had time. I suddenly thought it was so cold. I also fantasized that I want to persuade my male to come to our new beauty, just like I used to clean up my work every weekend when I was in everyone. Not good, too. There is a goddess harvester standing next to it. I have pressure too.

When a person is standing in front of himself, his mind is very clear. Who is the right person and who is the right person. Who is right depends on your plan. Plan to select the right person if you want to be happy. Those born with talent will choose the one you like. If the future is still the same in the present world, even if you are passionate, it will be more bitter than heartless. Pain is the source of talent, and will feel the same way if you have experienced it. I saw a person from a zero-dimensional space to a ten-dimensional space. I suddenly thought that the person I met was one of the choices, but I didn't like that one, so I made adjustments in this space.

A person makes a dream and wakes up to sigh the dream. In fact, when dreaming, there are tens of thousands of cells in the body, and they will only interpret this dream in their lifetime. Who can be sure that they are not a cell in others' dreams. So, don't take yourself too seriously. It's a good dream!

Related Article

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.