Interview Ali exam

The following is we put together the most comprehensive Java interview questions Alibaba history, involving a large number of Java interview questions and related knowledge.

JAVA foundation

What several basic data types 1.JAVA yes, how many bytes each occupation.

2.String class can inherit it, and why.

3.String, Stringbuffer, the difference between the StringBuilder.

What is the difference 4.ArrayList and LinkedList.

5. The talk order to instantiate classes, static data such as the parent class, constructors, fields subclass static data constructors, fields, the time when new, their execution order.

6. What type Map used, what's the difference, HashMap is thread-safe for you, what is the use of concurrent Map are and what they are internal principles, such as storage, hashcode, expansion, default capacity.

Why 7.JAVA8 of ConcurrentHashMap abandoned segmented lock, there is a problem, and if you come to design, how to design.

8. There is no sequential Map implementation class, and if so, how to ensure that they are ordered.

9. The difference between the abstract class and interface, the class can inherit more than one class it, what interfaces can inherit multiple interfaces, what classes can implement multiple interfaces.

10. Inheritance and where the difference between the polymerization.

11.IO model which, nio talk about your understanding of the difference between him and bio, aio is valid to talk about reactor models.

12. The principle of reflection, reflecting what three ways to create a class instance yes.

13. A reflection, Class.forName ClassLoader and distinction.

14. The dynamic proxy describes several implementations of, say respectively corresponding advantages and disadvantages.

15. The dynamic agent and cglib achieve distinction.

16. Why CGlib ways to implement proxy for interface.

17.final use.

18. The three kinds of write modes to achieve a single embodiment.

19. How to automate all of hashcode and equals implemented as subclasses of the parent class? What do the pros and cons.

20. Requests the combination of OO design, talk about access modifiers public, private, protected, default application design role.

21. A deep copy and shallow copy distinction.

22. A linked list data structure described arrays and respective time complexity.

And the difference between 23.error exception of, CheckedException, the difference of RuntimeException.

24. Please list the five runtime exception.

25. In your own code, if you create a java.lang.String class that can be loaded if the class loader? why.

26. talk about your understanding of java.lang.Object object hashCode and equals methods. Under what scenarios need to implement these two methods.

27. In jdk1.5, the introduction of generics, generics presence is used to solve the problem.

28. Such a.hashcode () what's the use, you have to do with a.equals (b).

29. There is no possible two unequal objects have the same hashcode.

How internal HashSet 30.Java in the works.

31. What is serialization, serialized how and why serialization, deserialization encounter any problems, how to solve.

32.java8 of new features.

JVM knowledge

Stack memory overflow will occur 1. What conditions.

2.JVM memory structures, Eden and Survivor ratio.

Why 3.JVM memory to be divided into the new generation, the old era, lasting generations. Why the new generation into Eden and Survivor.

4.JVM in a full GC process like, how old's promotion to the object, you know, talk about several major JVM parameters.

5. Do you know what kinds of garbage collectors, their advantages and disadvantages, and highlight some of the lower cms G1, including principles, processes, strengths and weaknesses.

6. The principle of garbage collection algorithms.

7. When a memory overflow, how do you debug.

Knowledge 8.JVM understand how much memory model, such as reordering, memory barriers, happen-before, main memory, working memory and so on.

9. Tell me what you know about a simple class loader can delegate it to break the parents, how to break.

10. The talk of reflection JAVA.

JVM arguments 11. What are your online application.

12.g1 cms and the difference, the throughput of priority and in response to selection priority garbage collector.

13. how to play thread stack information.

14 Please explain the meaning of the following jvm parameters:

-server -Xms512m -Xmx512m -Xss1024K

-XX:PermSize=256m -XX:MaxPermSize=512m -

XX:MaxTenuringThreshold=20XX:CMSInitiatingOccupancyFraction=80 -

XX:+UseCMSInitiatingOccupancyOnly。

Open source framework for knowledge

1. Simple structure tomcat talk, as well as class loader process, the thread model.

How 2.tomcat tuning, which parameters involved.

3. Spring load talk about the process.

The principle of 4.Spring AOP.

5. talk about Spring transaction propagation properties.

How 6.Spring management services.

7.Spring how to configure a transaction (specifically say some of the key elements of xml).

8. Spring talk about your understanding of the principle of non-singleton injection? Its life cycle? Loop injection principle, aop implementation principle, talk about a few aop in terms of how they work with each other.

9.Springmvc DispatcherServlet in the initialization process.

10.netty threading model, based on how to achieve netty reactor model.

11. Why netty.

12. What is TCP stick package, unpacking. What is the solution way it is.

13.netty of fashwheeltimer usage, implementation principles, whether there had been insufficient time to call, how to solve.

14.netty heartbeat process how to do in the weak net.

15.netty communication protocol is what.

16.springmvc used notes, what is the role of principle.

17.springboot start mechanism.

operating system

Under 1.Linux system you concerned about what kernel parameters, to talk about you know.

There are several models at 2.Linux IO, what their meaning yes.

3.epoll and poll What is the difference.

4. What Linux commands usually used.

5. Review the last five files with one command.

6. output command java process running with his party.

OS thread you understand under 7. introduce the switching process.

8. The difference between processes and threads.

What's in command after 9.top, what role.

10. Online high CPU burst, how you find the problem.

Multithreading

1. Several multi-threaded implementation, what is thread-safe.

2.volatile principle, effect, can lock it in place.

3. Draw a state diagram of the life cycle of the thread.

The difference 4.sleep and wait.

Difference 5.sleep and sleep (0) is.

Synchronized with the difference 6.Lock.

What is the principle 7.synchronized is generally used in any place (such as the time difference added to the static methods and non-static methods, static methods and non-static methods are performed simultaneously have an impact on it), explain the following terms: re-ordering, self spin locks, lock bias, lightweight lock, reentrant lock, lock fair, unfair locks, optimistic locking, pessimistic locking.

8. What type atomic used, what their principle yes.

Which research tools 9.JUC under concurrent, talk about the principle.

10. used the thread pool, and if used, please explain the principles and talk about newCache and newFixed What is the difference, what is the meaning of each parameter constructor is such coreSize, maxsize and so on.

11. The thread pool closed way there are several, what is their difference yes.

12. If there is a third party interface, there are many threads to call to get data, now up to 10 per regulations threads simultaneously call it, how to do it.

13.spring the controller is a single case or multiple cases, how to ensure the safety of concurrency.

14. The three threads with a sequence of three letters abc print cycle, such abcabcabc.

15.ThreadLocal used it and for what purposes, what the principle is, use the time to pay attention.

16. If you could achieve a secure concurrent list, how would you do.

17. What are lock-free data structures, principles of what they accomplish.

18. talk about the wait and notify java synchronization mechanism.

What 19.CAS mechanism is how to solve the ABA problem.

20. The multi-threaded if the thread tangled up in how to do.

21.countdowlatch and cyclicbarrier internal principles and usage, as well as the differences between each other (such as countdownlatch await the method and how to achieve).

22. How much of AbstractQueuedSynchronizer understanding, talk about locking and unlocking process, fairness and the exclusive lock lock any different.

23. The use of synchronized static methods and non-static methods of modifying any difference.

24. DESCRIPTION ConcurrentLinkedQueue LinkedBlockingQueue and usefulness and differences.

25. The cause thread deadlock? How to lift thread deadlock.

26. The very multiple threads (possibly different machines), you need to wait between coordination in order to complete some work, ask how such coordination program design.

27. used to read and write lock on it, what the principle is, under what scenario with the general.

28. open multiple threads, if the guarantee execution order, which has several implementations, or how to ensure that multiple threads are executing the then get the results.

29. The implementation of the queue delay, similarities and differences, and time delayQueue wheel algorithm.

TCP与HTTP

1.http1.0 and http1.1 What is the difference.

2.TCP three-way handshake and four waving process, why the disconnect to 4 times, if only to shake hands twice, what will appear.

The difference 3.TIME_WAIT and CLOSE_WAIT.

4. talk about you know several HTTP response, such as 200, 302, 404.

5. When you open a link in browser (such as: http: //www.javastack.cn) when the computer to do what work steps.

6.TCP / IP how to ensure the reliability, talk about the structure of the TCP header.

7. How to avoid browser cache.

8. How to understand the stateless protocol HTTP.

9. DESCRIPTION Http get and post requests and packet format distinction.

What method 10.HTTP

11. DESCRIPTION packet format of the HTTP request.

Long connection 12.HTTP of what that means.

What 13.HTTPS encryption method that talk about the entire encryption and decryption process.

14.Http and https three-way handshake What is the difference.

15. What is the block transfer.

Difference 16.Session and cookie.

Distributed architecture and design

1. Use your own java achieve a LRU.

2. How do distributed cluster under a unique serial number.

3. Design a spike system for 30 minutes without payment will automatically close the transaction.

4. How to use redis zookeeper and implement distributed lock? What is the difference advantages and disadvantages, what will be the problem, what the scenarios are applicable. (Extension: If you know redlock, talk about his algorithm, where controversy)

5. If someone malicious to create illegal connections, how to solve.

6. The principle of distributed transactions, advantages and disadvantages, how to use distributed transactions, the difference between 2pc 3pc solve what problems, what problems have not been resolved, how to solve your own projects in a distributed transaction is related to how to deal with .

7. What is the consistency of hash.

8. What is restful, restful talk about your understanding.

9. How to design a good API.

10. How to design build and maintain a long connection of 100w.

11. Explain what MESI protocol (cache coherency).

12. Several HASH algorithm to talk about, you know, simple can be.

13. What is paxos algorithm, what is zab agreement.

14. an online documentation system, documents can be edited, how to prevent multiple people to edit the same document to be updated.

15. The online system suddenly became very slow, how do you find the problem.

16. you usually talk about design patterns used.

17.Dubbo principle, the source code has seen it, how the transfer of data, how to achieve clustering, load balancing, service registration and discovery, retry forwarding, fail-fast strategy is like.

18. What is the first RPC request process Yes.

19. rpc over themselves to achieve it, you can simply talk about principles. Rpc to solve any problems.

20. The purpose and significance asynchronous mode.

21. programming himself how to consider some design principles, such as the principles and applications in the work of opening and closing.

22. Design a social networking site in the "private letter" function, require high concurrency, scalability and so on. Painting about architecture diagram.

23.MVC mode, namely common MVC framework.

At 24. The chat server architecture have been involved in the design and drawing, to talk about the problems encountered, how to solve.

25. The application server how to monitor performance, the difference in various ways.

26. How to design a high concurrent payment scheme, how to structure design.

27. How to achieve load balancing, which algorithm can be implemented.

28.Zookeeper purposes, what is the principle of elections Yes.

Principle mechanism 29.Zookeeper watch.

30.Mybatis principle underlying implementation.

31. Consider a program to achieve countDownLatch distributed environment.

32. how to prevent back-office systems resubmit the request.

33. The detailed description of a process from being released to consumer service.

34. talk about your understanding of service management.

35. How do interface idempotency.

36. How do policy limiting usage scenarios, and funnel token bucket algorithm.

37. What is data consistency, how you understand the data consistency.

38. Distributed caller to the service, does not depend on the service provider, then hang up after how to deal with the service side, a large number of ineffective waste of resources requested, if only when the service provider is not high throughput of how to do that, if the service hung up, then for a restart, how to do the minimum waste of resources, the realization of what the flow rate half-open mechanism Yes.

How to achieve generalization call 39.dubbo, if it is you, how would you do.

40. Remote call timeouts will, if do elegant control, JDK comes out mechanism which, how to achieve.

algorithm

110 million in digital inside to find a minimum of 10.

2. 100 million numbers, of which two are duplicates, find it quickly, time and space to be optimal.

320 million randomly generated integer disorder, to find out the value of intermediate size.

4. The input to one does not know the length of the (potentially large) string, to design a program that will repeat the characters rearranged.

The binary tree traversal.

6. There is 3n + 1 digits, of which the 3n is repeated, only one is not repeated, how to find out.

7. Write a string (eg: www.javastack.cn) the inverse function.

8. The common sorting algorithm, fast discharge, merge, bubbling. Fast row optimal time complexity, the complexity of the worst. Bubble sort optimization.

9. binary search time complexity of advantages.

10.'ve built a good TreeSet, how to complete the reverse-order.

11. What is a B + tree, B- trees, lists the actual usage scenarios.

12. The one-way linked list, delete the penultimate N data.

13.200 orderly arrays, each array element 100 which identify the elements top20.

14. The one-way linked list, look for the elements in the middle.

Knowledge Database

1. What are the database isolation level, what their meaning is, MYSQL default isolation level is what it is.

2. What is the phantom reads.

3.MYSQL What storage engines, their advantages and disadvantages.

4. high concurrency, how to do safe modify the same rows of data.

5. What is the optimistic and pessimistic locking lock is, INNODB standard row-level locking which of two kinds, to explain its meaning.

What are the general steps 6.SQL optimization, how to see the execution plan, how to understand the meaning of each field.

7. Database deadlock it, give an example of deadlock, mysql how to resolve the deadlock.

Indexing works 8.MYsql, and what type of index, how to create a reasonable index, index of how to optimize.

9. gathered difference between index and non-clustered indexes.

What is the meaning 10.select for update, will lock the table or row locks or other.

11. Why use Btree achieve, how it was split, when to split, why is balanced.

What ACID 12. database Yes.

13. There are nearly ten million a table of data, CRUD slow, how to optimize.

14.Mysql how to optimize the table scan.

15. How to write sql can effectively use the composite index.

16.mysql and exists in the difference.

17. The database auto-increment primary keys possible problems.

18.MVCC meaning, how to achieve.

You've done projects in 19 sub-library sub-table encounter yet, how to do, it is useful to middleware, such as sharding jdbc, etc., know what their principles.

Main 20.MYSQL of how to solve the delay.

message queue

1. Message queue usage scenarios.

2. resend the message, supplementary policies.

3. How to ensure the orderly nature of the message.

4. What used MQ, and other mq compare what advantages and disadvantages, MQ connection is thread safe for you, what your company MQ service architecture.

How to ensure data is not lost 5.MQ system.

How 6.rabbitmq achieve high availability cluster.

7.kafka reason for the high throughput.

Difference 8.kafka and other message queue, kafka primary synchronization from how to achieve.

9. Using mq how to achieve eventual consistency.

10. Use kafka have not encountered any problems, how to solve.

11.MQ repeated consumption may occur, how to avoid, how to do idempotent.

12.MQ how to deal with news of the delay, the message can set an expiration time of it, how do you usually deal expired.

Cache

1. What are the common caching strategies, how to do caching (such as redis) and DB where data consistency, what you used in the project caching system, how to design.

2. How to prevent caching and avalanche breakdown.

3. How to update the cache data expired design.

List of related operations 4.redis structure.

5.Redis data structures are what.

6.Redis use to pay attention to what, talk about the advantages and disadvantages and application persistence mode, memory settings, cluster, out strategies.

The difference 7.redis2 and redis3, redis3 internal communication mechanism.

8. What are the current redis clusters play, advantages and disadvantages of each scene.

9.Memcache principle, which fit the data in the cache.

10.redis difference memory management and the memcached.

How 11.Redis concurrent competition problem solving, understanding Redis transaction CAS operate it.

12.Redis election algorithm and process is like.

13.redis persistence mechanism, the difference of aof and rdb.

14.redis cluster data how synchronized.

15. What optimize the operation redis know.

16.Reids from the main principles of replication mechanism.

What 17.Redis threading model yes.

18. Consider a program designed to control a local cache buffer size of the overall automatic adaptation.

19. How do the cache using (local cache, centralized cache), outlining the local cache and centralized caching and the advantages and disadvantages.

20. Notes the local cache when used concurrently.

search for

1.elasticsearch know how much, talk about your company es cluster architecture, the index data size, number of fragments, as well as some tuning means. What elasticsearch inverted index yes.

2.elasticsearch index data more how to do, how to tune the deployment.

3.elasticsearch is how to achieve master election.

4. Describe in detail the process Elasticsearch index of documents.

5. Describe in detail the process of Elasticsearch search.

6.Elasticsearch in the deployment, optimization methods which have set for Linux?

What 7.lucence internal structure Yes.

To organize the above questions from the network, only for your reference, oh no answer. They compare themselves how far? Thereby improving the interview success rate.

Finally, to share with a wave of my collection of learning materials, these materials need friends to join my Java Advanced Architecture Advanced (736-351-661) you can get!

Published 94 original articles · won praise 0 · Views 628

Guess you like

Origin blog.csdn.net/weixin_45602227/article/details/104278346