April 2016 Sina Weibo interview questions and interview process.

Static inner class, inner class, anonymous inner class. Why does an inner class hold a reference to an outer class? The reference held is this? Or something else?

  • Static inner class: An inner class decorated static
  • Anonymous inner class: Inner class generated using new
  • Because the generation of the inner class depends on the outer class, the reference held is the class name.this.

What are the main differences between an ArrayList and a Vector?

ArrayList was introduced in Java1.2 to replace Vector

Vector:

  • Thread synchronization
  • When an element in a Vector exceeds its initial size, the Vector doubles its capacity

ArrayList:

  • Threads are out of sync, but the performance is good
  • When an element in an ArrayList exceeds its initial size, the ArrayList increases in size by only 50%

Java collection class framework

The order in which try Catch finally is executed in Java

If an exception occurs ina try, catch must be executed, and finally must be executed

Can switch work on byte, can switch work on long, and can switch work on String?

The switch supports the byte type, but not the long type. String was introduced in java1.7

What are the Activity and Fragment life cycles?

  • Activity — onCreate – > onStart – > onResume – > onPause – > onStop – > onDestroy
  • Fragments – onAttach – > onCreate – > onCreateView – > onActivityCreated – > onStart – > onResume – > onPause – > onStop – > onDestroyView – > onDest roy->onDetach

Is onInterceptTouchEvent() different from onTouchEvent()?

OnInterceptTouchEvent () is used to intercept touch events. OnTouchEvent () is used to handle touch events

What functions RemoteView is used in

APPwidget and Notification

What’s the difference between a SurfaceView and a View?

The SurfaceView uses a double cache technique, updating the interface in a separate thread. The View updates the interface in the UI thread

What is the priority of processes in Android?

  • Foreground process
  • Visible process
  • Service process
  • Background processes
  • An empty process

Code check error, didn’t write down

Tips: Static classes holding Activity references can cause memory leaks

One side

  • Service life cycle, can time-consuming operations be performed?
  • JNI development process
  • Java thread pool, thread synchronization
  • Design your own image loading framework
  • Custom View related methods
  • http ResponseCode
  • Plug-in, dynamic loading
  • Performance optimization, MAT
  • AsyncTask principle
  • 65 k limit
  • The Serializable and Parcelable
  • Which is more efficient, file or database
  • Breakpoint continuingly
  • The WebView and JS

Android Basic — Service Android basic — IntentService Android development guide — Service Android development guide — Binding Service Android development guide — Interprocess communication AIDL

Android Interview Basics (1)

Android Interview — APP Performance Optimization

Second interview

  • The implementation principle of the open source framework used, source code
  • No, it passed
  • Before going to the interview to use the open source framework source analysis must look ah

Note: Please bring a copy of your resume, a pen and a bottle of water. Make sure you bring water.