2024/10/15 11:45 30min部门是基础架构部,面试官迟到了20多min,也没开摄像头- 自我介绍- Java集合介绍- ArrayList 和 LinkedList都有200个元素,在第100个位置插入一个元素,哪个更快- HashMap主要用来做什么- HashMap是线程安全的吗?- 如何将其变为线程安全的- 加了分段式之后的性能如何- Java中如何实现线程安全?- synchronized和ReentrantLock区别- 给一段代码,是否会输出顺序结果```javaimport java.util.concurrent.CyclicBarrier;import java.util.concurrent.ExecutorService;import java.util.concurrent.Executors;import java.util.concurrent.atomic.AtomicInteger; public class Main { private static int i= 0; private static final int NUMBER_OF_THREADS = 100; // 线程数量 private static final CyclicBarrier barrier = new CyclicBarrier(NUMBER_OF_THREADS); public synchronized int add() { return i++; } private void print(String value) { System.out.println(value); } public static void main(String[] args) { ExecutorService executorService = Executors.newFixedThreadPool(NUMBER_OF_THREADS); Main counter1 = new Main(); Main counter2 = new Main(); for (int i = 0; i int finalI = i; executorService.submit(() -> { try { barrier.await(); if (finalI % 2 == 0) { counter1.print("Count1:" + counter1.add()); } else { counter2.print("Count2:" + counter2.add()); } } catch (Exception e) { e.printStackTrace(); } }); } executorService.shutdown(); }}```- 开源项目介绍- OTP码、2FA介绍及原理- OAuth2.0中的access_token生成算法- 秒杀业务如何保证高并发下的正确性反问:- 面试结果一天出吗?- 部门介绍#去哪儿##去哪儿求职进展汇总##去哪儿旅行秋招#