Android interview notes at station B

origin

Seeing that my classmates have been submitting resumes everywhere recently, I thought I would also submit them to see the market, so on 2022-02-28 , I sent my first resume to station B. To be honest, I just wanted to practice my skills. , I didn't expect that I finally took the offer from station B, which is also a good luck.

one side

Technical aspects, about 45 minutes, basically revolving around the highlights written on your resume and your work experience

  • Self introduction

  • what are you responsible for in the project

  • What design patterns have you used, or design patterns that Androidyou often encounter in

    Singleton mode, strategy mode, chain of responsibility mode (asked about usage scenarios), factory mode, etc.

    AndroidObserver pattern, Adapter pattern etc in

  • Have you done any more difficult modules?

    camera2, custom photo cropView

  • ViewWhat do you know about customization

    Answered some Pathdrawing and handling of touch events

  • Androidanimation

    property animation,ObjectAnimator

  • Multi-threaded concurrency (locks, semaphores, syncnorized), syncnorizedwhat is the difference between objects and classes

  • ConcurrentHashMapThe principle of thread safety

    The segmented lock used before 1.8 and used after 1.8 synchronized. As for the specific details, I have not answered it, because I have not seen the source code here.

  • jni, how to locate jnithe crash

    What I answered at the time was to log, because jnithere are not many places used in the project, of course, it jnican also be debugged by breakpoints

  • Are your applications multi-process? how processes communicate

    I only answered this at the time mmap, and I talked a little about the mmapprinciple and binderperformance comparison. Later, I recalled that I did not answer the communication used in the Broadcastproject aidl binder.

  • Webviewhow to nativeinteract

    • onUrlLoadinginterceptSchema

    • register js method ( addJavascriptInterface)

  • AndroidCompilation and packaging process

    aapt -> class -> dex -> signature

  • Instrumentation

    ASM instrumentation, bytecode manipulation

  • 性能监控

    因为我之前做过一个性能监控库,cpumem使用TOP命令解析,Anr通过给MainLooper设置Printer

  • LeakCanary原理

    WeakReference + ReferenceQueue,加了一些改进点:new一个弱引用的Object,等这个Object确认被回收后再确认Activity是否正常被回收

  • Jetpack Compose

    稍微谈了一下看法,是否在项目中用过

  • 算法题:最长公共前缀

    LeetCode 14题,easy难度:leetcode-cn.com/problems/lo…

二面

一面结束后5min左右,B站HR就给我打电话过来约了二面

二面也是技术面,20min左右,因为是晚上8点面的,估计人家急着想下班(笑)

  • 自我介绍

  • 工作职责

  • 工作中有什么亮点

    • 拍照裁剪业务

    • 单元测试库

    • 性能监控

    • 内存泄漏检测

  • 单元测试的库是怎么做的

    基于MockitoRobolectric:

    1. 封装了一个反射库用来方便测试
    2. 做了一个AutoCloser类用来自动关闭释放mock的资源,这里提到了使用MockedStatic,如果在使用完后没有释放,那在下一次使用到同一个类的MockedStatic的时候会报错,这里我自定义了一个注解@MockedStatic用来自动mock和释放资源
    3. 针对kotlin做了一些mock工具,比如说顶层函数的mock(这个在我以前的文章Android-Kotlin单元测试之 如何配合Mockito模拟顶层函数中介绍过)
  • 开发模式(流程规范):

    开发规范参考了阿里的Java规范和Android规范,选取了一些比较重要的条例和一些自己长时间开发的经验做成了一篇文档

  • 崩溃率的优化,做了哪些事情

    感觉这里没答好,有点答非所问的意思,我就说了说目前处理bug的一个流程,没有谈到怎么解决一个bug

  • 数据打点是怎么做的

    我们用的是神策第三方服务

  • 内存泄漏工具是怎么做的

    这部分同一面LeakCanary原理

  • 看你之前做过一个MQTT协议的客户端,是出于个人兴趣吗

    是的,当时是想要做一个IM应用

  • 在项目中有遇到需要3D渲染展示的内容吗

    目前没有

  • 两个Activity跳转时方法执行的顺序

    一个Activity创建是:onCreate -> onStart -> onResume(之后便在屏幕上显示了)

    假设从A Activity跳转到B Activity:A.onPause -> B.onCreate -> B.onStart -> B.onResume -> A.onStop

    B返回到A:B.onPause -> A.onRestart -> A.onResume -> B.onStop -> B.onDestory

  • 两个Activity传递数据可以通过什么方式

    • Intent

    • 如果是同一个进程的话,可以用全局变量或者单例等

    • SharedPreference

    • 文件

  • 什么时候使用Service

    后台任务,比如说后台播放音乐等,这里提了一下IntentService是开了一个子线程的

  • Service怎么启动,怎么停止

    • startService <---> stopService

    • bindService <---> unbindService

  • 包体积优化

    清理资源(字体、图片、代码等)

HR面

二面结束后过了2-3天,HR发微信过来恭喜我进入下一轮面试,我问她接下来是还有三面和HR面吗,她回答我说后面就直接是HR面了,说实话我还是挺惊讶的

HR面15min左右,大概就问了一下,为什么要从上家公司离职,我们是一个新部门,处于项目初期,有什么看法之类的,然后问了一下目前的薪资和期望薪资,over~

总结

说实话感觉这次面试太简单了,有点白瞎了我准备了那么多,还做了查漏补缺 ㄟ( ▔, ▔ )ㄏ ,最后祝大家都能找到心仪的工作 (๑•̀ㅂ•́)و✧

Guess you like

Origin juejin.im/post/7077879634326454280