`
包su
  • 浏览: 31155 次
  • 来自: 南京
社区版块
存档分类
最新评论

interview result

 
阅读更多
----------------------------------------基础知识部分(共4题,正确4题)

android有几大组件
正确
答案:activity, service, contentprovider, broadcasereceiver

broadcastreciever有几种注册方式:
正确
答案:在manifest.xml中配置,和,在程序中注册

intent分为哪几类
正确
答案:显式的,和,隐式的

为什么需要隐式的intent
答案:将自身的程序和其他第三方的程序连接起来(你并不知道物理上的component name,但是知道逻辑上的action/category等)

----------------------------------------content provider部分(共8题,正确4题,不那么正确3题,不正确1题)

contentprovider的底层数据存储可以有哪些
不是那么正确
答案:可以使用db, file, sharedpreference等一切适合当前项目的存储方式
LM:db。他指出了android当中可以使用file, db, shardpreference等来存储内容,但是没有指出这些方式和contentprovider的关系

如何监听一个contentprovider
正确
答案:使用contentresolver来注册监听器contentobserver;在数据发生改变时,contentresolver.notifychange

contentprovider是由什么标示的
正确
答案:uri中的authorities part

如何将数据写入到文件的末尾,而不是覆盖整个文件内容
正确
答案:fileoutputstream(filepath, append_is_true)

我的app在默认情况下可以访问哪些文件
不是那么正确
答案:默认情况下只能访问/data/data/{package_name}/files/下的文件
LM:提到了只能访问自身应用所对应的文件,但是说app会自动生成一个叫package_name的文件,该说法是错误的

android能否监听一个文件的改变,如:重命名,内容发生变化,删除,等
不正确
答案:可以,通过fileobserver
LM:不知

sqliteopenhelper的oncreate在什么情况下被调用
正确
答案:在数据还未创建,且客户要获取数据库实例时(sqliteopenhelper.getwritabledatabase)

sqliteopenhelper的onupgrade在什么情况下被调用
不是那么正确
答案:在数据库已存在,但是版本号发生改变的情况下(sqliteopenhelper的构造函数中指定了版本号)
LM:大体思路正确,但是询问怎么知道版本号发生改变了,答:未知,因不常用

----------------------------------------service/ipc部分(共3题,不正确3题)

ipc依赖于android四大组件中的哪一个
不正确
答案:service
LM:不知

ipc的内部原理是什么
不正确
答案:客户端bindservice,在连接建立后,获取ibinder,通过ibinder.transact来调用remote method;服务器binder.ontransact会被调用,进而调用local method(其内写入业务逻辑)
LM:不知

ipc的local method执行在哪个线程上
不正确
答案:service专门维护的线程池中的线程
LM:不知

----------------------------------------activity/UI部分(共12题,正确5题,不那么正确3题,不正确4题)

我的app启动一个非UI线程来下载一个视频,当下载结束后,需要更新UI上的textview的内容为"download finish",如何实现这种更新
正确
答案:在UI线程上实例化handler,并传递该handler给非UI线程,非UI线程下载完毕后,通过该handler发送下载完成的消息,handler处理该消息来更新UI

举出你常见的layout
正确
答案:linearlayout, relativelayout, framelayout等

padding和layout_margin的区别
不那么正确
答案:padding和layout_margin虽然都代表边界,但是padding算入view的区域;而layout_margin并不算入view的区域,它只是告诉parent view:为我保留一些边界
LM:padding和layout_margin都代表边界。padding不算入view的区域,layout_margin算入view的区域,而这与答案恰好相反

在android,可以使用哪个类来方便的得到一个layout.xml的root view
不正确
答案:使用layoutinflater
LM:他答出了使用dom, sax来解析xml,但是并不知道layoutinflater(layoutinflater往往使用在 “listview的item view的构造” 中,说明baseadpater运用的不够熟练)

canvas, paint, drawable之间有什么的关系
不那么正确
答案:canvas提供了绘制的操作,底层的数据存储到关联的bitmap上;paint设置了绘制时用的画笔,如颜色,粗细等;drawable为一切可以被画到canvas上的东西
LM:他只提到了drawable和bitmap之间的转换

listview/gridview依赖于哪个类为其item提供view
正确
答案:baseadapter等

当listview的底层数据发生改变时,怎么通知UI进行更新
正确
答案:baseadapter.notifydatasetchanged

android有哪几类menu
正确
答案:optionmenu, contextmenu

如何完成一个contextmenu和一个view的关联
不正确
答案:activity.registerforcontextmenu,或者,view.setoncreatecontextmenulistener
LM:未知

如何自定义view
不那么正确
答案:继承相应view(widget/layout),有选择的复写回调方法(如onlayout, onmeasure, ondraw等)
LM:回答有些含糊

surfaceview和view的区别
不正确
答案:
surfaceview的绘制可以在非UI线程上;view的绘制必须在回调方法ondraw中,且由android框架调用
surfaceview更适用于需要实时绘制(主动绘制)的应用中;而view更适用于非实时绘制(被动绘制)的应用中
LM:没使用过surfaceview

android有哪几类动画,分别都怎么启动
不正确
答案:
tweened animationm(translate, rotate, scale, alpha), frame animation
启动:
tweened animationm:加载动画,startanimation
frame animation:animationdrawable.start
LM:未知

----------------------------------------其他知识部分(共4题,正确2题,不那么正确2题)

我的app需要联网,需要在manifest.xml中使用permission,还是usepermission,来声明所需权限?
正确
答案:使用usepermission

列出你是如何访问网络的
正确:
答案:通过httpconnection的方式建立连接,然后读取数据从inputstream,写入数据到outputstream

activitymanager的用途是什么
不是那么正确
答案:获取app运行时的信息,如:当前正在运行的component有哪些
LM:管理activity等

packagemanager的用途是什么
不是那么正确
答案:获取package的信息,如:app的label等
LM:获取包名,杀死进程

----------------------------------------设计模式部分

说出你常用的设计模式
LM:
单例模式,提到了两种方式,但是在说到lazy init的方式时,getinstance方法并不需要进行同步判断。这点是错误的
适配器模式,比较正确的说出了基本原理


----------------------------------------面试情况

共31题,正确15题,不那么正确8题,不正确8题


----------------------------------------QL的评价

根据上述面试的回答情况:
我认为LM是可以的
他对于android的基本知识还是熟悉的
在android的某些特定方面,他还需要加强。为什么不熟悉的原因,为:不常使用,或者,没有对该知识点进行深入分析
因为android的技能是比较集中的,经过一段时间的技能补强后,能得到比较大的提升
分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

    Cracking the Coding Interview 6th 第6版 高清完整版PDF

    Cracking the Coding Interview(6th) 英文扫描版 <br/>Cracking the Coding Interview, 6th Edition is here to help you through this process, teaching you what you need to know and enabling you to ...

    Java.Interview.Bootcamp

    As a result I wrote Java Interview Bootcamp- this is my guide on how to ace Java interviews based on my experience from both sides of the desk. If you have any questions then feel free to email me ...

    Cracking the Coding Interview(6th).pdf

    Cracking the Coding Interview(6th).pdf 程序员面试经典书籍 <br/>Cracking the Coding Interview, 6th Edition is here to help you through this process, teaching you what you need to know and enabling ...

    Cracking the Coding Interview(6th)-非扫描版

    <br/>Cracking the Coding Interview, 6th Edition is here to help you through this process, teaching you what you need to know and enabling you to perform at your very best. I've coached and ...

    Grokking-the-Coding-Interview-Patterns

    摸索编码面试方式模式1:滑动窗口查找子阵列的平均值蛮力function find_averages_of_subarrays(K, arr) { //brute force let result = [] for(let i = 0; i < arr.length-K+1; i++){ //find sum of next k ...

    C# 面试指南:通过数百个秘密面试问题的答案来增强您的信心

    C# Interview Guide: Boost your confidence with answers to hundreds of secret interview questions| 540 / 5,000 Translation results Translation result 你将学到什么: 为有影响力的工作申请制作引人注目的...

    DevOps-Interview

    - Replace the first occurrence of a regular expression in each line of a file, and print the result: sed ' s/{{regex}}/{{replace}}/ ' {{filename}} - Replace all occurrences of an extended regular ...

    javasnmp源码-DevOps-Interview:DevOps-面试

    result: sed ' s/{{regex}}/{{replace}}/ ' {{filename}} - Replace all occurrences of an extended regular expression in a file, and print the result: sed -r ' s/{{regex}}/{{replace}}/g ' {{filename}} - ...

    字符串整数的余数leetcode-google-interview-questions:谷歌面试问题

    result.empty() 并从下一个索引重复上述算法。 重新排列字符串,相同的字符出现至少 d 距离。 技巧:按频率排序(use heap, have to remain sorted at all times) 。 保留一组中的最后d字符。 始终打印不在集合中的最...

Global site tag (gtag.js) - Google Analytics