Java (concurrent) multithreaded programming interview

Article Directory

  1. Basic knowledge

    1. What is a process? What is a thread? What is a coroutine? The connection and difference between the three?
    2. What is a zombie process? What is an orphan process?
    3. What is a daemon thread? What is the difference between a daemon thread and a user thread?
    4. How to find which thread has the highest cpu utilization on Windows and Linux?
    5. Talk about the difference between concurrency and parallelism?
    6. Why do multi-threaded (concurrent) programming? What are the disadvantages of multithreaded programming?
    7. Talk about the life cycle of the thread and the corresponding state? Which methods can be called in Java multithreading to switch to the next state?
    8. What is thread deadlock? How to avoid deadlock? Write a Java deadlock code?
    9. What is thread context switching?
  2. Java thread basics

    1. What are the ways to create threads in Java?
    2. What is the difference between runnable and callable?
    3. What is the difference between thread run() and start()? Isn't it okay to start a thread and call run()?
    4. What are Callable and Future?
    5. Talk about FutureTask?
    6. What is the thread scheduling algorithm used in Java? Thread scheduling strategy? What are Thread Scheduler and Time Slicing?
    7. What is the difference between sleep(), wait() and yield()?
    8. Why are the thread communication methods wait(), notify() and notifyAll() defined in the Object class?
    9. What is the purpose of the yield method in the Thread class? Why are the sleep() and yield() methods of the Thread class static?
    10. What is the difference between notify() and notifyAll()?
    11. What is the difference between interrupt(), isInterrupted() and interrupted() methods?
  3. Java memory model related

    1. Talk about JMM (Java Memory Model)?
    2. Do you know ThreadLocal? what's the effect? Do you know the principle? Have you encountered ThreadLocal memory leaks?
    3. What is instruction reordering? Do you know what happens-before? Do you know the semantics of as-if-serial?
    4. What is false sharing? How to avoid it?
  4. Locks in multithreading?

    1. Optimistic and pessimistic locking
    2. Fair lock and unfair lock
    3. Exclusive lock and shared lock
    4. What is a reentrant lock
    5. What is a spin lock
    6. The lock upgrade process?
    7. What is CAS
    8. LockSupport
    9. Condition
  5. voliate、synchronized、reentrantLock

    1. The voliate keyword and the realization principle of voliate?
    2. Synchronized lock and the underlying implementation principle of synchronized?
    3. The principle of reentrantLock and reentrantLock?
    4. What is the difference between reentrantLock and synchronized and voliate?
  6. Concurrent container

    1. ConcurrentHashMap
    2. CopyOnWriteArrayList
  7. Atomic operation class

  8. Multi-threaded blocking queue (AQS)

  9. Thread Pool

    1. Thread pool parameters
    2. Thread pool rejection strategy
    3. Waiting queue (blocking queue)
  10. Concurrency tools

    1. CountDownLatch
    2. CyclicBarrier
    3. Semaphore

Guess you like

Origin blog.csdn.net/weixin_44533129/article/details/112970209