Immediately into the gold nine silver ten, it is time to see some interview questions to goose factory, next I will share some interview questions, sum up a little bit every day, I hope to help you!

ListView is different from RecyclerView

Reference links:

Blog.csdn.net/shu_lance/a…

Since RecyclerView can replace ListView in many ways, why didn’t Google make ListView obsolete?

Answer: It can be answered along the recycling mechanism. ListView adopts RecyclerBin recycling mechanism, which is more efficient when some lightweight lists are displayed

You’ve used the difference between MVP and MVVM

Reference links:

www.cnblogs.com/dubo-/p/561…

How does HashMap work internally?

  • 1) HashMap can accept null keys and values, but HashTable cannot. HashMap is non-synchronized; It stores key-value pairs.

  • 2) HashMap is based on hashing. We use PUT (key,value) to store objects in HashMap, and use get(key) to retrieve objects from HashMap. When we pass keys and values to put, we call hashCode() on the keys. The hashCode returned is used to find the bucket location to store the key and value objects as map.entry.

  • 3) If two objects have the same hashCode:

    When stored: They will find the same bucket location and collide, because HashMap uses a linked list to store objects (each map.entry has a next pointer), and this Entry will be stored in the list.

    When retrieved: The bucket location is found using hashCode, and the key.equals() method is called to find the correct node in the linked list. Finally find the value object you are looking for.

    Reduce collisions: Using final or immutable objects as keys, using wrapper classes such as (Integer, String) (which are immutable and final and have overridden equals and hashCode methods) as keys is a good idea. A: Sure, as long as it complies with the equals and hashCode method definition rules and does not change when the object is inserted into the Map.)

  • 4) The load factor of the HashMap is 0.75 by default, which is configurable. When 75% of the map is filled, an array of buckets twice the size of the original HashMap will be created to resize the map. And put the original object into the new bucket array. This process is called rehashing, because it calls the hash method to find the new bucket location.

  • 5) Resize map may cause race problems: If both threads find that the HashMap needs to be resized, they will both try to resize it. In the resize, the order of the elements stored in the list is reversed, because the HashMap does not place the elements at the end of the list, but at the head, to avoid tail traversal. If conditional competition occurs, it’s an endless loop.

Have you ever used AsyncTask? What is the internal implementation of AsyncTask?

Reference links:

www.cnblogs.com/absfree/p/5…

AsyncTask maintains a thread pool internally. Is it serial or parallel?

serial

Reference links:

www.cnblogs.com/absfree/p/5…

Can you name the four initializations for a thread pool?

You’ve used MD, do you know how to define a Behavior?

Reference links:

www.jianshu.com/p/82d18b0d1…

RecyclerView drag how to achieve?

Reference links:

Blog.csdn.net/aiynmimi/ar…

What are the three conditions to pay attention to when writing a simple profit model?

There is a static public function that creates or retrieves its own static private object. Thread synchronization is a secondary concern!

An array in ascending order good int [] ‘arry = {5, 1,0,5,9,11,13,15,22,35,46}, enter an x, int x = 31, find out in the data and the two Numbers for x, 9 + 22 = 31, for example, require the time complexity of the algorithm is O (n);

How do I randomly insert 10000 entries into A table of int type A, B, C, D? How to extract the top 10 numbers in column A in ascending order?

What is the difference between the two startup modes of service?

Reference links:

Blog.csdn.net/siwen1234/a…

What about the three-level caching and Handler mechanism?

Reference links:

Blog.csdn.net/wenzhi20102…

Handler mechanism

www.cnblogs.com/dendai-05/p…

alibaba

  • LRUCache principle
  • Picture loading principle
  • Modular implementation (benefits, reasons)
  • JVM
  • Video encryption transmission
  • Statistics startup time, standard
  • How to maintain the stability of the application
  • ThreadLocal principle
  • Talk about this
  • Dynamic layout
  • Hot repair, plug-in
  • HashMap source code,SpareArray principle
  • Performance optimization, how to ensure that the application startup does not lag
  • How to remove duplicate code
  • Is SP process synchronized? Is there any way to synchronize
  • Introduce SurfView
  • Implementation principles of HashMap and ConcurrentHashMap
  • BroadcastReceiver, LocalBroadcastReceiver
  • Bundle mechanism
  • Handler mechanism
  • Android event passing mechanism
  • Interthread operation List
  • The App startup process starts from clicking on the desktop
  • Dynamic loading
  • Class loader
  • OSGI
  • Https request slow solution, DNS, carry data, direct access IP
  • GC collection strategy
  • Draw the big picture of Android
  • Describe what happens when you click the Build button in Android Studio, and generally what happens when an application is installed on the phone.
  • Basic understanding of Dalvik and ART virtual machine;
  • How inter-process-Communication works on Android;
  • How and why apps are sandboxed;
  • Permissions management system (how the underlying permissions are granted)
  • Process and Application lifecycle;
  • System startup process Zygote process > SystemServer process > Various system services > Application process
  • Recycleview ListView distinction, performance
  • Sort, the implementation of quick sort
  • Trees: An introduction to B trees
  • Figure: An interpretation of directed acyclic graphs
  • The difference between TCP/UDP
  • The difference between synchronized and Lock
  • volatile
  • Java thread pool
  • The life cycle of objects in Java
  • Class loading mechanism
  • Parental delegation model
  • Android event distribution mechanism
  • The MVP pattern
  • RxJava
  • The difference between abstract classes and interfaces
  • How does the Set implement Hash prevent collisions
  • JVM memory area open threads affect which memory block
  • Garbage collection object creation, New generation and old generation
  • Binary tree depth traversal and breadth traversal
  • B tree, B tree
  • Message mechanism
  • Process scheduling
  • Processes and threads
  • A deadlock
  • Process status
  • JVM memory model
  • Concurrent collections know what
  • ConCurrentHashMap implementation
  • The CAS is introduced
  • There are three ways to start a thread. The run() and start() methods are different
  • The thread pool
  • Introduction to common data structures
  • Judgment ring (guess should be linked list ring)
  • Sort, heap sort implementation
  • List inversion
  • Dynamic permission adaptation scheme, concept of permission group
  • How does OKHTTP handle network caching
  • How does bitmap handle large images, such as a 30M large image, and how to pre-oom proof
  • Process to keep alive
  • Listview picture loading disorder principle and solution
  • How do I verify the validity of certificates? Where is symmetric encryption used in HTTPS and where is asymmetric encryption used? Do I know encryption algorithms (such as RSA)

drops

  • MVP

  • Broadcast (dynamic registration and static registration difference, ordered broadcast and standard broadcast)

  • Service Life cycle

  • Handler implementation mechanism (many details need to be paid attention to: how threads create and exit message loops, etc.)

  • Multithreading (Reflections on AsyncTask defects)

  • Database data migration problems

  • Design pattern correlation (e.g. where observer pattern is used in Android, singleton pattern correlation)

  • X apples, one, two, or three apples per day, ask how many days to eat them all

  • The difference between TCP and UDP and the application (three-way handshake and four-way wave) involves some details (for example, how does the client determine that the message it sends is received by the server)

  • Are you familiar with Android JNI development and how jNI calls Java layer code

  • The way in which processes communicate

  • Java annotations

  • Calculates the nesting hierarchy of a view

  • Understanding of project componentization

  • Principle of multi-thread breakpoint continuation

  • Why does Android design contentProviders, process sharing, and thread safety

  • The JVM related

  • Android related optimization (such as memory optimization, network optimization, layout optimization, battery optimization, business optimization)

  • Implementation principle of EventBus

Meituan

  • Static synchronized method multithread access and function, the same class in two synchronized methods, two threads access problems

  • Inner classes and static inner classes and anonymous inner classes, as well as applications in projects

  • How does looper start when handler sends a message to the child thread

  • View Event passing

  • The activity stack

  • How do you know the size of a view when you’re encapsulating it

  • Differences between ArrayList and LinkedList, and application scenarios

  • How do WE start a service and how do services and activities interact with each other

  • Does the drop-down status bar affect the activity life cycle? If a network request is made during onStop, how does it resume during onResume

  • The view to render

Today’s headline

  • The concept of heap in data structure, heap sort

  • The concept of deadlocks, how do you avoid deadlocks

  • ReentrantLock, synchronized, and Volatile (N-side)

  • HashMap

  • SingleTask Startup mode

  • Use of some open source framework, introduced a read source code, internal implementation process.

  • Message mechanism implementation

  • An internal implementation of ReentrantLock

  • App startup crash exception capture

  • Introduction to the event passing mechanism

  • The optimization of ListView

  • Binary tree, give the root node and the target node, find the path from the root node to the target node

  • Model MVP, MVC introduction

  • The implementation of breakpoint continuation

  • Collection of interfaces and concrete implementation classes, introduced

  • TreeMap concrete implementation

  • Synchronized with already

  • Handwritten producer/consumer model

  • Logical address vs. physical address. Why use logical address

  • An unordered, non-repeating array outputs N elements such that the sum of N elements adds up to M, giving time complexity, space complexity. The handwriting algorithms

  • Android process classification

  • The foreground switches to the background, and then back to the foreground, the Activity lifecycle callback method. Pop-up Dialog, lifecycle callback method.

  • The startup mode of the Activity

iQIYI

  • RxJava functions and principles to achieve

  • Use of RecycleView, principle, RecycleView optimization

  • The reason of ANR

  • Four major components

  • Service startup mode

  • How an Activity communicates with a Service

  • How activities communicate with each other

  • Implementation of HashMap, different from HashSet

  • JVM memory model, memory region

  • Java synchronization used keywords, deadlock

  • The MVP pattern

  • Java design pattern, Observer pattern

  • Compare the life cycle between activities and Fragments

  • Broadcast usage scenarios

baidu

  • What should I notice when using Bitmap?

  • Is it possible to try catch in Oom?

  • How do memory leaks occur?

  • What are the similarities and differences between adapter patterns, decorator patterns, and appearance patterns?

  • How is ANR generated?

  • What is the difference between String Buffer and String Builder?

  • How to keep thread safe?

  • Referenced in Java 4

  • Has Jni used it?

  • Have you seen multi-process scenarios before?

  • So handler, what thread is new handler under anywhere

  • Sqlite update to add field statements

  • Bitmap recycler related

  • Will strong references be reclaimed if they are set to NULL?

  • What cache does Glide use?

  • How does Glide memory cache size control?

  • How to ensure the security of multithreading read and write files?

ctrip

  • Activity Start mode

  • The way broadcast is used, the scene

  • The implementation of waking up other processes in App

  • The role and understanding of AndroidManifest

  • The difference between the List, Set, Map

  • How to determine whether a HashSet or HashMap has identical elements

  • Memory regions and garbage collection mechanisms in Java

  • EventBus function, implementation method, method to replace EventBus

  • The main steps of enabling the camera in Android

netease

  • concurrenthashmap

  • volatile

  • Synchronized with the Lock

  • Java thread pool

  • wait/notify

  • NIO

  • Garbage collector

  • Activity Lifecycle

  • AlertDialog popupWindow, Activity

millet

  • Why is String designed to be immutable?

  • Fragment life cycle in various cases

  • The life cycle of the Activity when the home button is pressed while there is a Dialog on the Activity

  • The life cycle of the Activity in various situations when switching between horizontal and vertical screens

  • The difference between the Application and Activity context objects

  • The role of serialization, and the differences between Android and serialization.

  • Lists and maps are implemented and stored.

  • Static inner class design intent.

  • How can threads be shut down, and how can memory leaks be prevented

360

  • Soft reference and weak reference difference

  • The garbage collection

  • Multithreading: how to use, what problems to pay attention to; Android thread has no upper limit and then mentions the upper limit of the thread pool

  • JVM

  • The lock

  • OOM, memory leak

  • How to analyze and solve ANR

  • LinearLayout, RelativeLayout, FrameLayout features, use scenarios

  • How to implement sliding Fragment

  • How can ViewPager initialize only the current Fragment each time and leave the rest uninitialized

  • What does ListView reuse

  • Mechanisms for interprocess communication

  • AIDL mechanism

  • AsyncTask mechanism

  • How do I cancel AsyncTask

  • serialization

  • Why did Android introduce Parcelable

  • Have you tried to simplify the use of Parcelable

  • AIDL mechanism

  • Project: How to pull live

  • Application Installation Process

  • An overseas live broadcasting company

  • What’s the difference between thread and process?

  • Why have threads instead of just processes?

  • Algorithm to determine whether a single linked list is looped?

  • How to implement thread synchronization?

  • Hashmap data structure?

  • Arraylist and LinkedList?

  • Object equal and hashCode methods overwritten. Why?

  • How does a Hashmap put data?

  • Briefly describes the IPC?

  • How data is passed between fragments?

  • TCP wave four times

  • Threadlocal principle

  • Possible causes of memory leaks?

  • How do I analyze memory leaks with an IDE?

  • Possible reasons for OOM?

  • Four conditions for thread deadlocks?

  • Differentiator & estimator

  • Describe the message mechanism

  • Interprocess communication?

  • Binder?

  • Distribution of touch events?

  • Describe the entire process of starting an Activity.

  • Okhttp source?

  • RxJava introduction and source code interpretation?

  • How does performance optimization analyze Systrace?

  • Classification of broadcast?

  • Click event is blocked, but passed to the view below, how to operate?

  • Glide source?

  • ActicityThread related?

  • The principle of volatile

  • The principle of the synchronize

  • Principle of the lock

  • Flip a single necklace watch

  • string to integer

  • Merge multiple singly ordered lists (assuming they are all incremental)

  • Data storage in Android

  • The realization of wechat home page

  • The principle of small red dots on wechat messages

  • Find the common element of two sets of non-repeating arrays.

  • Last question extension, massive data, not put in memory, how to figure out.

  • Java String understanding.

  • ArrayList is different from LinkedList

  • Heap sorting process, time complexity, space complexity

  • Time complexity of quicksort, space complexity

  • The use of RxJava, compared to the usual use of asynchronous operations, advantages

  • Principle of Android message mechanism

  • Introduction to Binder mechanism

  • Why can’t I update the UI on a child thread

  • JVM memory model

  • Android process memory allocation, can allocate their own quota of memory

  • Garbage collection is different from calling System.gc()

  • Android event distribution mechanism

  • The implementation of breakpoint continuation

  • What RxJava does, pros and cons

To read more

Share my three summary of learning Java background

Four front-end interview experiences for a young white guy

(Android) Interview Questions

Persistence: I learned that in the first phase of learning the Java backend

Believe in yourself, there is nothing impossible, only unexpected

It’s not just technology that’s gained here! In addition, I have a technical number: Terminal RESEARCH and development Department. Welcome to study together

Android