JAVA engineer interview questions

Source: Internet
Author: User

JAVA engineer interview questions

I went to a company for an interview today. I felt dizzy with my brains. I didn't make a few algorithm questions. The questions were relatively simple. I should have prepared myself, but the status was not good, after the interview, I felt quite dissatisfied. I still had to wait for a while and make sufficient preparations to make the interview more colorful. I will share my pen questions with you, make a summary for yourself:

1. A balance. There are several white balls of equal weight on the right disk and several black balls of equal weight on the left disk. At this time, the two sides are balanced. now we can take a white ball from the right disk and place it on the left disk. Then we can place the two black balls on the right disk and add 20 grams of weight to the left disk. At this time, both sides are balanced; if you move two white balls from the right disk to the left disk and move a black ball from the left disk to the right disk, You need to place 50 grams of weight on the right disk to balance the two sides. q: What are the weights of white and black balls?

2. Write the following binary tree's first-order traversal, middle-order traversal, and post-order traversal results:

3. What are the problems with the following procedures? Why?

public class SomeThing{public static void main(String[] args){SomeThing s=new SomeThing();System.out.println("the s.doSomething() is"+doSomething());}public String doSomething(){return "do something";}}

4. Which of the following is better for insertion sorting and Bubble sorting? Why?

5. What are the output results of the following programs?

public class Test{public static int y=8;public staitic void main(String[] args){change(y+5);System.out.println("y="+y);}public static int change(int y){y+=3;return y;}}

6. How can I determine if the other party receives the packet through UDP communication?

7. Calculate the number of online users of a Forum. Assume that there is a forum with 0.2 billion registered IDs. Each ID records the logon time and exit time in a log file from login to logout, you need to write an algorithm to calculate the online distribution of Forum users in one day. The sampling granularity is seconds.

8. What technologies are implemented for each layer of MVC and how?

9. Programming question: Write a Singleton (Singleton Mode)

10. What are the relationships and differences between BS and CS?

Interview exchange:

1. Talk about your career plans;

2. Briefly introduce yourself;

3. Communicate based on previous systems;

4. How to Create a database in Oracle;

5. ibatis, android, and foreground page technologies;

Okay, this all. Let's take a look at it and hope it will be helpful to everyone. Whether it's an interview or a job, it's a learning process. We have to make a summary and learn and make progress together !!


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: 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.