Home Common Problem Common multiple choice Android interview questions [with answers]

Common multiple choice Android interview questions [with answers]

Jul 31, 2020 pm 02:17 PM

Recommended: "2020 Android interview questions summary [Collection]"

The following interviews I have encountered this question more than once in interviews. Although it is just a simple multiple-choice question in the written test, it may also be the first level of your interview and pave the way for your subsequent performance!

1.Which of the following statements about memory recycling are correct? (b)
A, The programmer must create a thread to release the memory
B, The memory recycling program is responsible for releasing useless memory
C, The memory recycling program allows the programmer to directly release the memory
D、The memory recycling program can release the memory object at the specified time
2.The following exception belongs to Runtime Exception (abcd )(Multiple selection)
AArithmeticException
B IllegalArgumentException
CNullPointerException
DBufferUnderflowException
3.Math.round(11.5)is equal to how many(). Math.round(-11.5) is equal to how much(c).
A11 ,-11 B11 ,-12 C12 ,-11 D12 ,-12
Explanation: The rounding algorithm in java is to add 0.5 to the original value, and then Take the closest value to it.

4.The output result of the following program segment is:(b)

1. "font-size:18px;">void complicatedexpression_r(){

2. int x=20, y=30;

3. boolean b;

4. b=x>50&&y>60||x>50&&y<-60||x<-50&&y>60||x<-50&&y<-60; (b);

6. }

Atrue Bfalse C1 D011.activity
5.To save some resources and status operations, it is best to save them in which function of the life cycle(d)
AonPause() BonCreate()ConResume()DonStart()

6.IntentWhen passing data, which of the following data types can be passed (abcd)(Multiple choices)
ASerializable BcharsequenceCParcelableDBundle

7. In android , the following functions belonging to Intent are (c)
A, realizing inter-application communication Data sharing
B is a program with a long life cycle and no user interface. It can keep the application running in the background without disappearing due to switching pages
C, It can realize switching between interfaces, can contain actions and action data, connect the four major components
D, and handle the overall work of an application

8.The following are the advantages of SAXparsing xml files(b)
A. Store the entire document tree in memory for easy operation. It supports deletion, modification, rearrangement and other functions.
B. There is no need to load the entire document in advance, and it takes up less resources.
C. The entire document is transferred into the memory, which wastes time and space.
D. It does not reside in the memory for a long time, and the data is not persistent. After the event, if the data is not saved, the data will Disappear

9.The correct way to customize the style below is (a

A

<resources>
<style name="myStyle">
<item name="android:layout_width">fill_parent</item>
</style>
</resources>

B

<style name="myStyle">
<itemname="android:layout_width">fill_parent</item>
</style>

C

<resources>
<itemname="android:layout_width">fill_parent</item>
</resources>

D

<resources>
<stylename="android:layout_width">fill_parent</style>
</resources>

10.The methods that may need to be rewritten when using Menu in android are (ac). (Multiple selection)

AonCreateOptionsMenu()

BonCreateMenu()

ConOptionsItemSelected()

DonItemSelected()

11.SQL ServerManagement Studio中运行下列T-SQL语句,其输出值(c)。

SELECT @@IDENTITY

A、可能为0.1

B、可能为3

C、不可能为-100

D、肯定为0

12.SQL Server2005中运行如下T-SQL语句,假定SALES表中有多行数据,执行查询之 后的结果是(d)。

BEGIN TRANSACTION A
Update SALES Set qty=30 WHERE qty<30
BEGIN TRANSACTION B
Update SALES Set qty=40 WHEREqty<40
Update SALES Set qty=50 WHEREqty<50
Update SALES Set qty=60 WHEREqty<60
COMMIT
TRANSACTION B
COMMIT TRANSACTION A

ASALES表中qty列最小值大于等于30

BSALES表中qty列最小值大于等于40

CSALES表中qty列的数据全部为50

DSALES表中qty列最小值大于等于60

13.android中使用SQLiteOpenHelper这个辅助类时,可以生成一个数据库,并可以对数据库版本进行管理的方法可以是(ab)

AgetWriteableDatabase()

BgetReadableDatabase()

CgetDatabase()

DgetAbleDatabase()

14.android 关于service生命周期的onCreate()onStart()说法正确的是(ad)(多选题)

A、当第一次启动的时候先后调用onCreate()onStart()方法

B、当第一次启动的时候只会调用onCreate()方法

C、如果service已经启动,将先后调用onCreate()onStart()方法

D、如果service已经启动,只会执行onStart()方法,不在执行onCreate()方法

15.下面是属于GLSurFaceView特性的是(abc)(多选)

A、管理一个surface,这个surface就是一块特殊的内存,能直接排版到android的视图view上。

B、管理一个EGL display,它能让opengl把内容渲染到上述的surface上。

C、让渲染器在独立的线程里运作,和UI线程分离。

D、可以直接从内存或者DMA等硬件接口取得图像数据

16.下面在AndroidManifest.xml文件中注册BroadcastReceiver方式正确的(a)

A

<receiver android:name="NewBroad">
<intent-filter>
<action android:name="android.provider.action.NewBroad"/>
<action>
</intent-filter>
</receiver>

B

<receiver android:name="NewBroad">
<intent-filter>
android:name="android.provider.action.NewBroad"/>
</intent-filter>
</receiver>

C

<receiver android:name="NewBroad">
<action android:name="android.provider.action.NewBroad"/>
<action></receiver>

D

<intent-filter>
<receiver android:name="NewBroad">
<action> android:name="android.provider.action.NewBroad"/>
<action>
</receiver>
</intent-filter>

17.关于ContenValues类说法正确的是(a)
A、他和Hashtable比较类似,也是负责存储一些名值对,但是他存储的名值对当中的
名是String类型,而值都是基本类型
B、他和Hashtable比较类似,也是负责存储一些名值对,但是他存储的名值对当中的
名是任意类型,而值都是基本类型
C、他和Hashtable比较类似,也是负责存储一些名值对,但是他存储的名值对当中的
名,可以为空,而值都是String类型 
D、他和Hashtable比较类似,也是负责存储一些名值对,但是他存储的名值对当中
的名是String类型,而值也是String类型

18.我们都知道Hanlder是线程与Activity通信的桥梁,如果线程处理不当,你的机器就会变得越慢,那么线程销毁的方法是(a)
AonDestroy()
BonClear()
ConFinish()
DonStop()

19.下面退出Activity错误的方法是(c
Afinish()
B、抛异常强制退出
CSystem.exit()
DonStop()

20.下面属于android的动画分类的有(ab)(多项)
ATween BFrame CDraw DAnimation

21.The following is about the process of Androiddvm and the process of Linux,The correct statement of the process of the application is (d)
A, DVM refers to dalivk's virtual machine.Every Android application runs in its own process, does not necessarily have an independent The Dalvik virtual machine instance. and each DVM is in# A process in ##Linux,so it can be considered as the same concept. B
, DVM refers to the virtual machine of dalivk.eachAndroidApplications run in its own process, does not necessarily have an independent DalvikVirtual machine instance.And every DVM is not necessarily in Linux## A process in #,, so it is not a concept.C
DVM refers to the virtual machine of dalivk.each AndroidThe application runs in its own process,has an independentDalvikvirtual machine instance.And every DVM is not necessarily a process in Linux,So it’s not a concept.D, DVM refers to the virtual machine of dalivk.eachAndroidThe application runs in its own process,has an independentDalvik Virtual machine instance. And each DVM is in Linux## A process in #,, so it can be considered as the same concept.

22.Android

project engineering What is the function of the following assets(b)A
, to place the image resources applied to it. B
, mainly place multimedia and other data filesC
, place strings, colors, arrays and other constant dataD
, place some and UIThe corresponding layout files are all xml files

23.

Aboutres/rawThe correct directory statement is (a)A
. The files here are stored intact on the device. It will be converted to binary format B
. The files here are stored intact on the device and will be converted to binary format C
. The files here are finally converted to binary format. The format is stored in the specified packageD
. The files here will not be ultimately stored in the binary format in the specified package

Note : In Android, you cannot directly open the database file in the res aw directory, but you need to copy the file to the phone memory or SD card when the program is started for the first time. directory, and then open the database file. The basic method of copying is to use the getResources().openRawResource method to obtain Get the InputStream

24 of the resource in the res aw directory.

The following is the correct understanding of android NDK (abcd )A
, NDK is a collection of a series of tools B
, NDK provides a stable, limited-function API header file declaration. C
, so that the development method of "Java C" is finally corrected and becomes an officially supported development Method D
, NDK will be Android Platform SupportC The beginning of development

The above are some simple questions. Some of them can be remembered after reading them once. If you don’t understand some of them, you should check them online and add your impressions!

The above is the detailed content of Common multiple choice Android interview questions [with answers]. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Can I uninstall Microsoft Edge Can I uninstall Microsoft Edge Jul 02, 2025 am 12:13 AM

Microsoft Edge can be uninstalled, but because it is a Windows system component, it cannot be uninstalled directly through the control panel like ordinary software. 1. Use a command prompt (administrator permissions) to uninstall the Edge installation package; 2. You can disable or replace Edge with the help of third-party tools; 3. Enterprise users can manage through Group Policy. Even if uninstalled, it may still be redeployed when the system is updated. Alternatives include: setting other browsers as default, manually removing the Edge icon, and hiding Edge using scripts. Users suitable for uninstallation include system geeks, enterprise unified management needs, and low-end device users who want to release resources. Ordinary users only need to change the default browser to avoid interference.

How to create a system restore point How to create a system restore point Jul 07, 2025 am 12:17 AM

System restore point setting methods include manual creation, dependency automatic creation, and management of storage space. 1. Manual creation requires system protection to enable in "Create Restore Point", allocate 5% disk space and click "Create" to name the restore point; 2. The system will automatically create restore points when installing updates or changing settings, but do not guarantee comprehensiveness; 3. The restore point occupies no more than 5% of the system disk space by default, and the old version will be automatically cleaned, and storage can be managed by adjusting the upper limit.

How to turn off wifi on my router remotely How to turn off wifi on my router remotely Jul 05, 2025 am 12:28 AM

If you want to remotely turn off the router Wi-Fi, you must first confirm whether the router supports remote management; if it does not support it, it can be achieved through a smart socket power outage; advanced users can also consider flashing in custom firmware. The specific steps are as follows: 1. Check whether the router has remote management functions, such as the manufacturer's supporting app or cloud management functions; 2. If it is not supported, purchase and set up a smart socket and remotely cut off power through its app; 3. For technical users, you can install firmware such as DD-WRT or OpenWRT to obtain remote control permissions. Different methods have their own advantages and disadvantages. Please weigh them according to your own needs when choosing.

What is a firewall and how does it work What is a firewall and how does it work Jul 08, 2025 am 12:11 AM

A firewall is a network security system that monitors and controls network traffic through predefined rules to protect computers or networks from unauthorized access. Its core functions include: 1. Check the source, destination address, port and protocol of the data packet; 2. Determine whether to allow connections based on trust; 3. Block suspicious or malicious behavior; 4. Support different types such as packet filtering firewalls, status detection firewalls, application layer firewalls and next-generation firewalls; 5. Users can enable built-in firewalls through operating system settings, such as Windows Security Center or macOS system preferences; 6. The firewall should be used in combination with other security measures such as strong passwords and update software to enhance protection.

How to fix VIDEO_TDR_FAILURE (nvlddmkm.sys) How to fix VIDEO_TDR_FAILURE (nvlddmkm.sys) Jul 16, 2025 am 12:08 AM

When encountering the blue screen error VIDEO_TDR_FAILURE(nvlddmkm.sys), priority should be given to troubleshooting graphics card driver or hardware problems. 1. Update or rollback the graphics card driver: automatically search and update through the device manager, manually install or roll back to the old stable driver using NVIDIA official website tools; 2. Adjust the TDR mechanism: Modify the TdrDelay value in the registry to extend the system waiting time; 3. Check the graphics card hardware status: monitor the temperature, power supply, interface connection and memory module; 4. Check system interference factors: run sfc/scannow to repair system files, uninstall conflicting software, and try safe mode startup to confirm the root cause of the problem. In most cases, the driver problem is first handled. If it occurs repeatedly, it needs to be further deepened.

How to stop a program from connecting to the internet How to stop a program from connecting to the internet Jul 07, 2025 am 12:12 AM

To prevent specific programs from being connected to the network can be achieved through system firewalls or third-party tools. 1. Windows users can use their own firewall, create new rules in the "outbound rules" to select the program path and set "block connection"; 2. Third-party tools such as GlassWire or NetBalancer provide graphical interfaces that are more convenient to operate, but pay attention to source reliability and performance impact; 3. Mac users can control networking permissions through the command line with pfctl or using LittleSnitch and other tools; 4. A more thorough way is to use the network outage policy. The whitelisting policy prohibits all programs from being connected to the network by default and only allows trusted programs to access. Although the operation modes of different systems are different, the core logic is consistent, and attention should be paid to the details of the path and scope of the rules taking effect.

How to fix high CPU usage from a background process How to fix high CPU usage from a background process Jul 03, 2025 am 12:01 AM

First, confirm the high CPU occupancy process, open the task manager to view the "CPU" tab; secondly, search the process name to determine whether it is a system or a third-party program; try to end non-critical processes, close unnecessary browser tags or plug-ins; update drivers and system patches; close unnecessary startup items; use professional tools to further analyze. The above steps can usually effectively solve the problem of computer lag.

Why do I get a User Account Control (UAC) prompt every time Why do I get a User Account Control (UAC) prompt every time Jul 13, 2025 am 12:12 AM

UAC frequently pops up because the running program requires administrator permissions or the system setting level is too high. Common reasons include installation of software, modifying system settings, running third-party tools and other operation triggers. If using an administrator account, UAC only confirms the operation and not blocks. The methods for reducing prompts include: canceling the program to run as an administrator, lowering the UAC notification level, using a standard user account, and starting the program through the task planner. It is not recommended to turn off UAC completely because it can effectively prevent malicious programs from tampering with the system. You can set the UAC to "notify only when the program changes the computer" to balance security and experience.