5

foreword

After two interviews, record

XX Bank

1. Introduce yourself about the project experience, the main functions of the project, the part in charge of the project, and the project technology stack
2. What is the most difficult part of the projects that have been handled? I said that the questionnaire system was introduced into the answer sheet department
3. What's wrong with your multithreading in the case of concurrency.
4. Are you familiar with JVM? (unfamiliar)
5. What other databases are used in the project besides mysql. (h2)
6. What are the left link, sort, reverse, and group by keywords in mysql
7. What should I pay attention to besides field checking when processing excel table data? (don't know what to ask)
8. How to close the data stream
9.String StringBuilder StringBuffer difference.

A side of a technology company in Beijing

1. Introduce yourself
2. Written test algorithm questions review
3. The difference between http and https, what is the request process of https.
4. How do you implement your backend interface?
5. How to implement a background interface without using a framework? (prompt socket)
6. What problem does nginx mainly solve, how to solve it, what is the same origin, and if it can be solved without nginx, how to solve it
7. Example of relational database and non-relational database respectively, the difference between the two
8. What are the benefits of transactions and how to maintain data consistency
9. Where is the index used, what is the bottom layer of the index, how does the index look up data through the b+ tree (not a piece of data), the difference between the b tree and the b+ number, how does the joint index look up the data through the b+ tree
10. How does the server handle concurrent requests? If you are asked to design, how to design, whether the server processes a request to create a thread or a process, the difference between threads and processes, and the difference between concurrency and parallelism.
11. School grades.
This interview clearly felt that the questions were more in-depth and more inclined to thinking about knowledge.

Concurrency problem with save method

 @Test
void saveUser() throws InterruptedException {
    List<User> users1 = new ArrayList<>();
    List<User> users2 = new ArrayList<>();

    for (int i = 0; i < 50; i++) {
        User user = UserControllerTest.getOneUser();
        users1.add(user);
        user = UserControllerTest.getOneUser();
        users2.add(user);
    }

    new Thread(() -> {
        for (User user: users1) {
            this.userRepository.save(user);
        }
    }).start();
    new Thread(() -> {
        for (User user: users2) {
            this.userRepository.save(user);
        }
    }).start();

    Thread.sleep(10000);
    Assertions.assertEquals(this.userRepository.findAll().size(), 100);
}

Tested it, and there is no problem.


小强Zzz
1.2k 声望32 粉丝