Android on ARM Developer Practice Exam Questions, Exams of Technology

Practice exam questions for android developers focusing on arm architecture. It covers topics such as abi compilation, jni, ndk, memory management, and performance optimization. Each question is followed by a correct answer and a detailed explanation, making it a valuable resource for exam preparation and understanding android development on arm platforms. The questions cover a range of topics, including abi compilation, jni, ndk, memory management, and performance optimization. This practice exam is designed to help developers test their knowledge and prepare for certification or job interviews. It provides a comprehensive overview of key concepts and best practices in android development on arm platforms.

Typology: Exams

2025/2026

Available from 12/10/2025

shilpi-jain-1
shilpi-jain-1 🇮🇳

4.2

(5)

29K documents

1 / 114

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
AA Android on ARM Developer AAAoAD Practice Exam
**Question 1. Which Android ABI is compiled for 64bit ARM processors?**
A) armeabi
B) armeabiv7a
C) arm64v8a
D) x86_64
Answer: C
Explanation: The **arm64v8a** ABI targets the AArch64 instruction set used by
64bit ARM CPUs, providing 64bit registers and address space.
**Question 2. What is the primary advantage of shipping an APK that includes the
arm64v8a ABI in addition to armeabiv7a?**
A) Smaller APK size
B) Faster Java bytecode execution
C) Access to larger address space and improved performance on modern devices
D) Compatibility with iOS devices
Answer: C
Explanation: Including **arm64v8a** lets the app run natively on 64bit devices,
leveraging larger registers, more registers, and better performance, while still
supporting 32bit devices via armeabiv7a.
**Question 3. Which ARM feature is specifically designed for parallel processing of
vector data?**
A) TrustZone
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Android on ARM Developer Practice Exam Questions and more Exams Technology in PDF only on Docsity!

Question 1. Which Android ABI is compiled for 64‑bit ARM processors? A) armeabi B) armeabi‑v7a C) arm64‑v8a D) x86_ Answer: C Explanation: The arm64‑v8a ABI targets the AArch64 instruction set used by 64 ‑bit ARM CPUs, providing 64‑bit registers and address space. Question 2. What is the primary advantage of shipping an APK that includes the arm64‑v8a ABI in addition to armeabi‑v7a? A) Smaller APK size B) Faster Java bytecode execution C) Access to larger address space and improved performance on modern devices D) Compatibility with iOS devices Answer: C Explanation: Including arm64‑v8a lets the app run natively on 64‑bit devices, leveraging larger registers, more registers, and better performance, while still supporting 32‑bit devices via armeabi‑v7a. Question 3. Which ARM feature is specifically designed for parallel processing of vector data? A) TrustZone

B) NEON

C) Thumb‑ 2 D) VFPv Answer: B Explanation: NEON is the SIMD (Single Instruction, Multiple Data) extension in ARM CPUs, enabling parallel operations on vectors of data. Question 4. In JNI, which of the following correctly maps a Java int to a native type? A) jlong B) jint C) jshort D) jbyte Answer: B Explanation: The JNI type jint corresponds directly to Java’s 32‑bit int. Question 5. When using JNI, what is the difference between a local and a global reference? A) Local references are automatically freed when the native method returns; global references persist until explicitly deleted. B) Global references are faster to access than local references. C) Local references can be used across threads; global references cannot. D) There is no difference; they are interchangeable.

Explanation: APP_PLATFORM specifies the lowest Android API level the compiled native library can run on, influencing available system headers and symbols. Question 8. Which CMake variable is used to set the target ABI for an NDK build? A) ANDROID_ABI B) NDK_TOOLCHAIN_VERSION C) CMAKE_BUILD_TYPE D) ANDROID_PLATFORM Answer: A Explanation: ANDROID_ABI tells CMake which ABI (e.g., arm64‑v8a, armeabi‑v7a) to build for. Question 9. In an Android.mk file, which directive adds a prebuilt .so library to the link line? A) LOCAL_MODULE := libfoo B) LOCAL_SRC_FILES := libfoo.so C) LOCAL_PREBUILT_SHARED_LIBRARY := libfoo.so D) LOCAL_STATIC_LIBRARIES := libfoo.so Answer: C Explanation: LOCAL_PREBUILT_SHARED_LIBRARY declares an existing shared object that should be linked without recompilation.

Question 10. Which standard C++ library does the NDK recommend for new projects? A) gnustl_static B) stlport_static C) libc++_static D) libstdc++_static Answer: C Explanation: libc++ (LLVM’s libc++) is the modern, actively maintained C++ standard library in the NDK. Question 11. When compiling with the NDK, which flag enables NEON intrinsics for ARMv7? A) - mfpu=neon B) - march=armv8-a C) - mthumb D) - fno-exceptions Answer: A Explanation: -mfpu=neon tells the compiler to generate code that can use NEON SIMD instructions on ARMv7 CPUs. Question 12. What does the -flto compiler flag enable?

C) L2 unified cache D) L3 cache Answer: B Explanation: ARM CPUs often have a separate instruction cache that is not automatically coherent with the data cache; explicit cache maintenance may be required after self‑modifying code. Question 15. Which technique improves cache locality for a matrix multiplication implementation on ARM? A) Using recursion instead of loops B) Blocking (tiling) the matrices to work on sub‑blocks that fit in L1 cache C) Storing matrices in column‑major order only D) Performing all calculations in double precision Answer: B Explanation: Blocking (or tiling) reduces cache misses by keeping active data within the cache hierarchy, improving locality. Question 16. What is the purpose of the android:extractNativeLibs="false" manifest attribute? A) Prevents the system from extracting native libraries to the filesystem, allowing direct loading from the APK. B) Disables loading of native libraries altogether. C) Forces all native libraries to be loaded in debug mode.

D) Enables automatic translation of ARM code to x86. Answer: A Explanation: Setting extractNativeLibs to false tells Android to load native libraries directly from the APK’s lib/ directory, reducing install size and startup time. Question 17. Which Android API allows querying the current thermal status? A) PowerManager.isDeviceIdleMode() B) BatteryManager.getIntProperty(BATTERY_PROPERTY_TEMPERATURE) C) ThermalManager.getCurrentThermalStatus() D) ActivityManager.getMemoryInfo() Answer: C Explanation: ThermalManager.getCurrentThermalStatus() (available from API

  1. returns the device’s current thermal state. Question 18. Which of the following statements about the Android ART runtime and native code is true? A) ART directly executes ARM machine code without any translation. B) ART uses Just‑In‑Time (JIT) compilation for native libraries. C) ART only runs Java bytecode; native code is loaded as shared libraries via the linker. D) ART converts native code to Dalvik bytecode at install time. Answer: C

Question 21. What does the -fno-rtti compiler flag disable? A) Runtime Type Information, preventing dynamic_cast and typeid usage. B) Run‑time thread inspection. C) Register Transfer Interface. D) Fast runtime tracing. Answer: A Explanation: -fno-rtti removes support for C++ Runtime Type Information, reducing binary size but disabling dynamic_cast and typeid. Question 22. Which of the following is a valid way to load a native library from Java? A) System.loadLibrary("mylib"); B) Runtime.getRuntime().exec("load mylib"); C) Class.forName("mylib"); D) Native.load("mylib"); Answer: A Explanation: System.loadLibrary loads a shared library (libmylib.so) from the appropriate lib/ directory. Question 23. Which Android NDK API provides low‑latency audio streams? A) OpenSL ES B) MediaPlayer

C) AAudio (or Oboe) D) AudioTrack (Java) Answer: C Explanation: AAudio (and the higher‑level Oboe wrapper) offers low‑latency, high‑performance audio I/O directly from native code. Question 24. When using ANativeWindow, which function acquires a buffer for rendering? A) ANativeWindow_lock B) ANativeWindow_acquire C) ANativeWindow_dequeueBuffer D) ANativeWindow_setBuffersGeometry Answer: C Explanation: ANativeWindow_dequeueBuffer obtains a buffer from the window’s queue that the app can render into. Question 25. In a multi‑ABI APK, how does the Android Package Manager decide which native library to load? A) It always loads the first library listed in the manifest. B) It selects the library that matches the device’s primary CPU ABI. C) It randomly picks an ABI at install time. D) It loads all ABIs simultaneously. Answer: B

Question 28. Which of the following is a recommended practice when passing a large Java byte[] to native code? A) Use GetByteArrayElements and copy the data to a native buffer, then release with ReleaseByteArrayElements. B) Directly cast the jbyteArray to a native pointer. C) Use NewDirectByteBuffer on the Java side and pass the buffer object. D) Convert the array to a String before passing. Answer: A Explanation: GetByteArrayElements provides a pointer (potentially a copy); after native processing, ReleaseByteArrayElements must be called to sync changes and free any temporary buffer. Question 29. Which Android API level introduced support for the arm64‑v8a ABI? A) API 16 B) API 21 C) API 23 D) API 24 Answer: B Explanation: API 21 (Lollipop) added official support for 64‑bit ARM (arm64‑v8a) in the NDK. Question 30. Which of the following is true about the -march=armv8-a+crypto compiler flag?

A) Enables ARMv8 Crypto extensions such as AES and SHA instructions. B) Disables all SIMD instructions. C) Forces the compiler to generate only 32‑bit code. D) Generates code for the x86 architecture. Answer: A Explanation: -march=armv8-a+crypto tells the compiler to target ARMv8‑A with Crypto extensions, allowing use of hardware‑accelerated AES, SHA, etc. Question 31. What does the android:debuggable="false" manifest attribute affect? A) Whether the app can be debugged with LLDB or JDWP at runtime. B) Whether native libraries are stripped of symbols. C) Whether the app can access the camera. D) Whether the app runs in 64‑bit mode. Answer: A Explanation: Setting debuggable="false prevents the system from allowing a debugger to attach to the process. Question 32. When profiling native code with Simpleperf, which command collects a call‑graph? A) simpleperf record - g B) simpleperf stat C) simpleperf report - p

Explanation: A fat APK bundles .so files for several ABIs (e.g., armeabi‑v7a, arm64‑v8a) in one package, increasing size but simplifying distribution. Question 35. Which tool can be used to inspect the symbol table of an Android shared library? A) ndk-stack B) readelf C) aapt D) sqlite Answer: B Explanation: readelf (part of binutils) can display ELF headers, sections, and symbol tables of .so files. Question 36. What is the effect of the -O3 optimization flag in an NDK build? A) Enables highest level of optimization, potentially increasing code size and compilation time. B) Disables all optimizations. C) Generates debug symbols only. D) Forces the compiler to use only NEON intrinsics. Answer: A Explanation: -O3 activates aggressive optimizations (inline, vectorization, loop unrolling) for maximum performance, at the cost of larger binaries and longer compile times.

Question 37. Which of the following best describes the purpose of ANativeActivity_onCreate? A) Entry point for a pure native Android activity, analogous to onCreate in Java. B) Callback for surface destruction. C) Method to load Java classes from native code. D) Function to initialize the OpenGL ES context. Answer: A Explanation: ANativeActivity_onCreate is called by the framework when a native‑only activity starts, allowing the developer to set up the activity lifecycle in C/C++. Question 38. Which NDK API provides access to device sensors such as accelerometer from native code? A) AAudio B) AHardwareBuffer C) ASensorManager D) AImageReader Answer: C Explanation: ASensorManager (and related ASensor APIs) allow native code to enumerate and receive data from hardware sensors.

A) OpenGL ES (via EGL) B) MediaCodec C) RenderScript D) JavaVM Answer: A Explanation: OpenGL ES (accessed through EGL) provides the native API for GPU‑accelerated graphics rendering. Question 42. What does the -fsanitize=undefined flag detect? A) Undefined behavior such as integer overflow, shift overflow, and invalid pointer use. B) Memory leaks only. C) Data races only. D) Uninitialized variable reads only. Answer: A Explanation: -fsanitize=undefined (UBSan) instruments code to catch various forms of undefined behavior at runtime. Question 43. Which of the following is a correct way to declare a native method in Java that returns a long and takes a float argument? A) private native long nativeCompute(float value); B) private native long nativeCompute(int value); C) private native int nativeCompute(float value);

D) private native void nativeCompute(float value); Answer: A Explanation: The method signature matches the desired return type (long) and parameter (float). Question 44. In ARM assembly, which instruction is typically used for a conditional branch if the zero flag is set? A) BNE B) BEQ C) BL D) BGT Answer: B Explanation: BEQ (Branch if Equal) branches when the Zero flag (Z) is set, indicating a previous comparison resulted in equality. Question 45. Which of the following Android APIs allows a native app to query the size of the device’s display? A) ANativeWindow_getWidth / ANativeWindow_getHeight B) AAudio_getDeviceCount C) AImageReader_getWidth D) ASensor_getResolution Answer: A