interview questions

The Java interview question outline is the following (mostly):

  • The basics of all aspects of Java
  • Java Features
  • Multithreading, Concurrency and Threading Basics
  • Basic Principles of Data Type Conversion
  • Garbage Collection (GC)
  • Java Collections Framework
  • array
  • string
  • Design Patterns
  • SOLID (Single Function, Open-Closed Principle, Liskov Substitution, Interface Segregation, and Dependency Inversion) design principles
  • abstract classes and interfaces
  • Generics and Enums
  • Java IO given NIO
  • Common network protocols
  • Data Structures and Algorithms in Java
  • regular expression
  • JVM
  • Java Best Practices
  • JDBC
  • Date, Time 与 Calendar
  • Java processing XML
  • JUnit

There are quite a lot, but according to the interview rules of big companies such as BAT, there are many things that will not be asked. The questions are closely related to Android, so I have sorted out the scope, as follows.

2017-2018 Android-BAT-Java interview questions classification:

  • 1. Java Features
  • 2. String, array, data type conversion
  • 3. The basics of all aspects of Java
  • 4. Abstract classes and interfaces
  • 5. JVM, garbage collection (GC)
  • 6. Java Data Structures and Algorithms
  • 7. Design Patterns
  • 8. Generics and Enums
  • 9. Common network protocols
  • 10.Java IO given NIO
  • 11. Multithreading, Concurrency and Threading Basics

1. Java features
(1.1) Understanding of java polymorphism
https://www.jianshu.com/p/8cfb92ecaabe
http://www.cnblogs.com/hupp/p/4854918.html
here extends "Dynamic Binding" ":
http://hxraid.iteye.com/blog/428891
(1.2) What is the mechanism for implementing polymorphism in Java?
https://www.jianshu.com/p/8cfb92ecaabe
http://www.cnblogs.com/hupp/p/4854918.html

2. String String, array, data type conversion
(2.1) Understanding of String in Java
https://www.jianshu.com/p/2f209af80f84
(2.2) The difference between String, Stringbuffer, Stringbuilder
http://blog. csdn.net/kingzone_2008/article/details/9220691
(2.3) Why is String designed to be immutable?
https://www.jianshu.com/p/16480390a847
https://www.jianshu.com/p/48b011688edc
(2.4) The method and principle of converting string to integerhttp
://blog.csdn.net/sinat_20259781/article /details/52024763
(2.5) How many bytes do int, char, and long occupy
http://blog.csdn.net/never_cxb/article/details/47204485
(2.6) The difference between int and integerhttps
://www.cnblogs .com/liuling/archive/2013/05/05/intAndInteger.html
https://www.jianshu.com/p/08010144d40f

3. The basics of all aspects of Java
(3.1) The difference between == and equals and hashCode in java
http://blog.csdn.net/hla199106/article/details/46907725
(3.2) The equal and hashCode methods of the Object class are rewritten, why ?
https://www.jianshu.com/p/f9cc84047bd6
(3.3) Modify the signature of the equals method of object A, then when using HashMap to store this object instance, which equals method will be called?
https://www.jianshu.com/p/7d3feb156be4
(3.4) What is the difference between thread sleep and waithttp
://blog.csdn.net/liuzhenwen/article/details/4202967
(3.5) Closures and local inner classes Difference
https://www.jianshu.com/p/f55b11a4cec2
https://www.jianshu.com/p/367b138fe909
(3.6) Difference between process and thread
https://www.jianshu.com/p/a4fa4edbeb8a
(3.7 ) The way of serialization
https://www.jianshu.com/p/ff770511a097
(3.8) The difference between Serializable and Parcelable
https://www.jianshu.com/p/a60b609ec7e7
(3.9) Can static properties and static methods be inherited? Can it be rewritten? and why?
http://blog.csdn.net/liuconey/article/details/51555362
http://blog.csdn.net/carmelo_z/article/details/67086140
(3.10) Design intent of static inner classes
http://blog.csdn .net/blessed24/article/details/78077134
https://www.cnblogs.com/aademeng/articles/6192954.html
(3.11) Understanding of member inner classes, static inner classes, partial inner classes and anonymous inner classes, and projects Application in
https://www.jianshu.com/p/5c5fa1377c79
https://www.jianshu.com/p/e385ce41ca5b
(3.12) What is an inner class? The role of inner classes
https://www.jianshu.com/p/e385ce41ca5b
(3.13) Talk about common coding methods?
https://www.cnblogs.com/liujinhong/p/5995946.html
(3.14) How many bytes of Chinese in utf-8 encoding; how many bytes of int type?
https://www.jianshu.com/p/c34d3e5790a4
(3.15) Java's exception system
https://www.jianshu.com/p/93aa1cf26b97
(3.16) How to serialize a Java object into a file?
http://blog.csdn.net/it_wangxiangpan/article/details/5781941
(3.17) The difference between final, finally, finalize
https://www.jianshu.com/p/59b77edd3319
(3.18) Talk about your reflection on Java Understand
https://www.jianshu.com/p/6277c1f9f48d
https://www.jianshu.com/p/1a21a9cb5bea
(3.19) Talk about your understanding of Java annotations
https://www.jianshu.com/p/ 0b1af95c1335
https://www.jianshu.com/p/4068da3c8d3d
(3.20) Talk about your understanding of dependency injection
https://www.jianshu.com/p/506dcd94d4f9
(3.21) The difference between static proxy and dynamic proxy, what scene use?
https://www.jianshu.com/p/2f518a4a4c2b
https://www.jianshu.com/p/861223789d53

4. Abstract class and interface
(4.1) Difference between abstract class and interface
https://www.jianshu.com/p/038f0b356e9a
https://www.jianshu.com/p/612e2d2a8a78
(4.2) The meaning of abstract class
http:/ /blog.csdn.net/wei_zhi/article/details/52736350
(4.3) Application scenarios of abstract classes and interfaces
http://blog.csdn.net/xcbeyond/article/details/7667733
(4.4) Can abstract classes have no methods and properties?
of course can. .
(4.5) The meaning of the interface
http://blog.csdn.net/oreo_go/article/details/52102514
PS: (4.1)-(4.4) are all a kind of things, basically after a detailed article, they can be solved.
(4.6) Can the static method of the parent class be rewritten by the subclass
https://www.jianshu.com/p/df43f5500ea3

5. JVM, garbage collection (GC)
(5.1) The working principle of the java virtual machine
https://www.cnblogs.com/lishun1005/p/6019678.html
(5.2) The difference between the java virtual machine and the Dalvik virtual machine
http:/ /www.jianshu.com/p/923aebd31b65
(5.3) Under what circumstances will the object be disposed of by the garbage collection mechanism?
https://www.jianshu.com/p/5261a62e4d29
https://www.jianshu.com/p/778dd3848196
(5.4) Talk about your understanding of parsing and dispatching.
This has been a bit in-depth, and it is recommended to start with a virtual machine and understand it first.
https://www.jianshu.com/p/355ae3bcec41

6. Java data structures and algorithms
There is no need to collect interview questions here. This is not something that can be mastered at once. You need Baidu to memorize a few simple algorithms.
It takes a process to master the algorithm. I suggest you can go to leetcode, lintcode and other websites to practice.
(6.1) Introduction to common data structures
https://www.jianshu.com/p/44a1e5bc077a
(6.2) What do you know about concurrent collections?
http://youyu4.iteye.com/blog/2352846
(6.3) List java collections and the inheritance relationship between collectionshttps:
//www.jianshu.com/p/63e76826e852
(6.4) Collection classes and collection frameworkhttps
: //www.jianshu.com/p/63e76826e852
(6.5) Container class introduction and the difference between them (container class is estimated that many people have not heard the word, Java container can be divided into 4 parts: List list, Set collection, Map Mapping, tool classes (Iterator iterator, Enumeration enumeration class, Arrays and Collections)
https://www.jianshu.com/p/c70989bd5f29
(6.6) The difference between List, Set, Map
https://www.jianshu.com /p/047e33fdefd2
(6.7) Implementation and storage of List and Map
https://www.jianshu.com/p/047e33fdefd2
(6.8) Implementation principle of HashMap
https://www.jianshu.com/p/8b372f3a195d/
(6.9) HashMap data structure?
https://www.jianshu.com/p/8b372f3a195d/
(6.10) Understanding HashMap source code
https://www.jianshu.com/p/8b372f3a195d/
(6.11) How does HashMap put data (from the perspective of HashMap source code)?
https://www.jianshu.com/p/8b372f3a195d/
(6.12) How to implement HashMap by hand?
Write it yourself, several traversal methods.
(6.13) Implementation principle of ConcurrentHashMap
https://www.jianshu.com/p/c0642afe03e0
(6.14) Comparison of ArrayMap and HashMap
https://www.jianshu.com/p/7b9a1b386265
(6.15) Implementation principle of HashTable
https:/ /www.jianshu.com/p/dbe7a1ea5928
(6.16) The specific implementation of TreeMap
https://www.jianshu.com/p/d9ad7f6d75a0
(6.17) The difference between HashMap and HashTable
https://www.jianshu.com/p/7456a339e4aa
(6.18) Difference between HashMap and HashSet
https://www.jianshu.com/p/749e6ce12d98
(6.19) How do HashSet and HashMap determine that the elements of the set are duplicated?
http://f543711700.iteye.com/blog/800929
http://blog.csdn.net/ning109314/article/details/17354839
(6.20) How does the collection Set implement Hash to prevent collision
http://blog.csdn.net/ zeb_perfect/article/details/52574915
http://blog.csdn.net/u010698072/article/details/52802179
(6.21) The difference between ArrayList and LinkedList, and application scenarios
https://www.cnblogs.com/soundcode/p/ 6294174.html
https://www.jianshu.com/p/e591690afacb
(6.22) Difference between array and linked list
https://www.jianshu.com/p/26fa29a3d669
(6.23) Depth-first traversal and breadth-first traversal of binary trees The specific implementation of
http://blog.csdn.net/fantasy_lin_/article/details/52751559
(6.24) the structure of the heap
http://blog.csdn.net/l294265421/article/details/50927538
(6.25) The difference between heap and tree
https://www.zhihu.com/question/36134980/answer/66080662
(6.26) What is the difference between heap and stack in memory (answer hint: you can answer from both data structure and actual implementation)?
https://www.jianshu.com/p/947a76e2ddbc
(6.27) what is deep copy and shallow copyhttp
://blog.csdn.net/u014727260/article/details/55003402
(6.28) handwritten linked list reverse order codehttp
:/ /blog.csdn.net/u012571415/article/details/46955535
(6.29) Talk about the understanding of trees and B+ trees
https://www.jianshu.com/p/6f68d3c118d6
(6.30) Judge whether a singly linked list is a ring or not?
http://blog.csdn.net/njr465167967/article/details/52634352
Algorithm questions, go to leetcode, lintcode and brush more questions, these are not problems
(6.31) linked list flip (ie: flip a single necklace list)
http:/ /blog.csdn.net/guyuealian/article/details/51119499
Algorithm questions, go to leetcode and lintcode to brush more questions, these are not problems
(6.32) Merge multiple single-order linked lists (assuming they are all incremental)
https: //www.jianshu.com/p/a3d5cd6c3ae2

7. Design Patterns
(7.1) In Java, when to use overloading and when to use rewriting?
http://blog.csdn.net/qq_33642117/article/details/51920354
(7.2) What is the singleton design pattern in Java? Write a thread-safe singleton in Java
https://www.cnblogs.com/garryfu/p/7976546.html
http://blog.csdn.net/cselmu9/article/details/51366946
(7.3) Use the factory pattern the most What are the main benefits? where do you use it?
http://blog.csdn.net/lee576/article/details/1549910

8. Generics and enumeration
(8.1) Talk about the principle of generics and give an example
https://www.jianshu.com/p/ddbe1db509da
(8.2) The difference between extends and super in generics
https://www.zhihu .com/question/20400700
(8.3) What are qualified wildcards and unqualified wildcards in generics
https://www.jianshu.com/p/ccdfc9bba821
https://www.cnblogs.com/fengmingyue/p/6087031. html

9. What is the structure of the HTTP response in common network protocols
(9.1)?
http://liuwangshu.cn/application/network/1-http.html
(9.2) What is a cookie? What is the difference between session and cookie
http://blog.csdn.net/duan1078774504/article/details/51912868
(9.3) How many handshakes does TCP/IP have when connecting? How many handshakes are there on release?
http://blog.csdn.net/guyuealian/article/details/52535294
(9.4) What is the TCP protocol? UDP protocol? the difference?
http://blog.csdn.net/qq_18425655/article/details/51955674

10. Java IO and NIO
(10.1) Talk about the understanding of io and nio, the difference?
This author has written 12 NIO articles:
http://www.importnew.com/18763.html

11. Multithreading, Concurrency and Threading Basics For
multithreading, please go through this article first:
https://www.jianshu.com/p/40d4c7aebd66
(11.1) Three ways to open threads?
http://blog.csdn.net/longshengguoji/article/details/41126119
(11.2) Talk about your understanding of multi-thread synchronization mechanism?
Generally, it asks how you understand it, that is, how to use it and in what scenarios.
https://www.jianshu.com/p/592ef5642513
(11.3) Why have threads instead of just processes?
http://blog.csdn.net/tongxinhaonan/article/details/42558561
(11.4) The difference between run() and start() methods
http://blog.csdn.net/dada360778512/article/details/6965790
(11.5) How Control the number of concurrent access threads allowed by a method?
http://blog.csdn.net/zuoanyinxiang/article/details/50448564
http://blog.csdn.net/anhenzhufeng/article/details/70225415
(11.6) The difference between wait and seek methods in Java
https:// www.jianshu.com/p/a67ad7ba89a5
(11.7) Talk about the understanding of wait/notify keywords
https://www.jianshu.com/p/f3d472c21c0e
(11.8) What causes a thread to block?
http://blog.csdn.net/sinat_22013331/article/details/45740641
http://blog.csdn.net/he3527/article/details/77618691
(11.9) How to close the thread?
https://www.jianshu.com/p/536b0df1fd55
(11.10) Talk about the synchronization method in java
https://www.jianshu.com/p/6542c8a96392
(11.11) How to ensure data consistency?
https://www.cnblogs.com/jiumao/p/7136631.html
Starting from the database to understand, the reason is similar. The focus is on synchronization and thread safety.
(11.12) How to ensure thread safety?
https://www.jianshu.com/p/fe7ed5b50933
http://blog.csdn.net/xiangxianghehe/article/details/51135299
(11.13) How to achieve thread synchronization?
https://www.jianshu.com/p/6542c8a96392
(11.14) Talk about the understanding of multithreading
https://www.jianshu.com/p/40d4c7aebd66
(11.15) Inter-thread operation List
I don't know what to ask, concurrent operation?
(11.16) The life cycle of objects in Java
http://blog.csdn.net/sodino/article/details/38387049
Extension: How to judge the "useless" of objects
https://www.jianshu.com/p/73d8d6c54515
(11.17) Synchronized usage
https://www.jianshu.com/p/19f861ab749e
(11.18) The principle of Synchronize
https://www.jianshu.com/p/19f861ab749e
(11.19) Talk about the Synchronized keyword, class lock, method lock, Understanding of reentrant lock
http://blog.csdn.net/le_le_name/article/details/52348314
https://www.jianshu.com/p/007bd7029faf
(11.20) Multi-threaded access and role of static synchronized methodhttp
:/ /blog.csdn.net/wangtaomtk/article/details/52318634
(11.21) Two synchronized methods in the same class, the problem of two threads accessing at the same timehttp:
//blog.csdn.net/aiyawalie/article/details/53261823
(11.22) Talk about the usage of the volatile keyword
https://www.jianshu.com/p/7798161d7472
(11.23) Talk about the role of the volatile keyword
https://www.jianshu.com/p/7798161d7472
(11.24) The principle of volatile
https://www.jianshu. com/p/7c614ac4dd92
http://ifeve.com/volatile/
(11.26) The difference between Synchronized and volatile keywords
http://blog.csdn.net/suifeng3051/article/details/52611233
https://www.cnblogs. com/tf-Y/p/5266710.html
(11.27) The difference between Synchronized and Lock
http://blog.csdn.net/u012403290/article/details/64910926?locationNum=11&fps=1
https://www.jianshu. com/p/2344a3e68ca9
(11.28) ReentrantLock, synchronized and volatile comparison
http://heaven-arch.iteye.com/blog/1738212
https://www.cnblogs.com/dennyzhangdd/p/6020566.html
(11.29) ReentrantLock internal implementation of
http://blog.csdn.net/yanyan19880509/article/details/52345422
(11.30) The principle of lock
http://blog.csdn.net/endlu/article/details/51249156
(11.31) Four necessary conditions for deadlock?
http://blog.csdn.net/ysdaniel/article/details/6644418
(11.32) How to avoid deadlock?
http://blog.csdn.net/ls5718/article/details/51896159
(11.33) Will object locks and class locks affect each other?
http://blog.csdn.net/u013142781/article/details/51697672
http://blog.csdn.net/codeharvest/article/details/70649375
First understand what they are, and try it yourself.
(11.34) What is a thread pool and how to use it?
https://www.jianshu.com/p/210eab345423
(11.35) Java's concurrency, multithreading, threading model
concurrency model: https://www.jianshu.com/p /067702fbf256
http://ifeve.com/%E5%B9%B6%E5%8F%91%E7%BC%96%E7%A8%8B%E6%A8%A1%E5%9E%8B/Thread
model:
https://www.cnblogs.com/tian830937/p/5277459.html
(11.36) What should I pay attention to in multithreading?
Concurrency issues, security issues, efficiency issues.
(11.37) Talk about your understanding of concurrent programming and give examples
https://www.jianshu.com/p/053943a425c3
http://blog.csdn.net/songxinjianqwe/article/details/72789899?locationNum=15&fps=1
There is a book called: java concurrent programming combat, buy it.
(11.38) How to ensure the safety of multi-threaded reading and writing files?
In other words, how do you ensure multi-thread safety, how do you ensure multi-thread safety to do one thing, it is not important. .
There is an article about writing files here:
http://blog.csdn.net/baple/article/details/23857485
(11.39) The principle of multi-threaded breakpoint resume
http://blog.csdn.net/ghost_Programmer/article/details /51923895
(11.40) Implementation of Breakpoint Resume
http://blog.csdn.net/ghost_Programmer/article/details/51923895



Author: nic_lee
Link: https://www.jianshu.com/p/7de76a9646fc
Source: Jianshu The
copyright belongs to the author. For commercial reprints, please contact the author for authorization, and for non-commercial reprints, please indicate the source.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325748465&siteId=291194637