Android LinkedIn Skill Assessment Answer

Rate this post

Here, We see Android LinkedIn Skill Assessment Answers. This assessment test consists 15-20 MCQs to demonstrate your knowledge in your selected skills. MCQs comes from different topics – Android System, Applications, Troubleshooting and Optimization, User Experience.

Table of Contents

Q1. To add features, components, and permissions to your Android app, which file needs to be edited?

  1. AndroidManifest.xml✔️
  2. Components.xml
  3. AppManifest.xml
  4. ComponentManifest.xml

Q2. Which XML attribute should be used to make an Image View accessible?

  1. android:talkBack
  2. android:labelFor
  3. android:hint
  4. android:contentDescription✔️

Q3. You launch your app, and when you navigate to a new screen it crashes, Which action will NOT help you diagnose the issue?

  1. Set breakpoints and then step through the code line by line
  2. Use the profiler tools in Android Studio to detect anomalies CPU, and network usage.
  3. Add a Thread.sleep()call before you start the new activity.✔️
  4. inspect the logs in Logcat.

Q4. Why might push notifications stop working?

  1. all of these answers✔️
  2. The device token is not being sent to push provider correctly.
  3. Google Play Services is not installed on the device/emulator.
  4. Battery optimization is turned on on the device.

Q5. What is the correct set of component classes needed to implement a RecycleView of items that displays a list of widgets vertically?

      RecycleView
      RecyclerView.Adapter<T extends BaseAdapter>
      RecyclerView.ViewHolder<T extends BaseViewHolder>
      LinearLayoutManager
      RecycleView
      RecyclerView.Adapter
      RecyclerView.ViewHolder<T extends BaseViewHolder>
      LinearLayoutManager
      RecycleView
      RecyclerView.Adapter
      RecyclerView.ViewHolder
      LinearLayoutManager
  1. ✔️
      RecycleView
      RecyclerView.Adapter<VH extends ViewHolder>
      RecyclerView.ViewHolder
      LinearLayoutManager

Q6. The Android system kills process when it needs to free up memory. The likelihood of the system killing a given process depends on the state of the process and the activity at the time. With combination of process and activity state is most likely to be killed?

  1. Process:In the background;Activity:Is stopped✔️
  2. Process:In the background;Activity:Is paused
  3. Process:In the foreground;Activity:Is started
  4. Process:In the foreground;Activity:Is paused

Q7. You have created a NextActivity class that relies on a string containing some data that pass inside the intent Which code snippet allows you to launch your activity?

        Intent(this, NextActivity::class.java).also { intent ->
            startActivity(intent)
        }
        Intent(this, NextActivity::class.java).apply {
            put(EXTRA_NEXT, "some data")
        }.also { intent ->
            activityStart(intent)
        }
  1. ✔️
        Intent(this, NextActivity::class.java).apply {
            putExtra(EXTRA_NEXT, "some data")
        }.also { intent ->
            startActivity(intent)
        }
        Intent(this, NextActivity::class.java).apply {
            put(EXTRA_NEXT, "some data")
        }.also { intent ->
            activityStart(intent)
        }

Q8. You want to include about and setting modules in your project. Which files accurately reflects their inclusion?

  1. in build.gradle:include ‘:app’,’:about’ ‘:settings’
  2. in settings.gradle:include ‘:app’,’:about’ ‘:settings’✔️
  3. in settings.gradle:include ‘:about’,’:settings’
  4. in gradle.properties:include ‘:app’,’:about’ ‘:settings’

Q9. What is the benefit of using @VisibleForTesting annotation?

  1. to denote that a class, method, or field has its visibility relaxed to make code testable✔️
  2. to denote that a class, method, or field is visible only in the test code
  3. to denote that a class, method, or field has its visibility increased to make code less testable
  4. to throw a run-time error if a class, method, or field with this annotation is accessed improperly

Q10. How would you specify in your build.gradle file that your app required at least API level 21 to run, but that it can be tested on API level 28?

      defaultConfig {
        ...
        minApiVersion 21
        targetApiVersion 28
      }
      defaultConfig {
        ...
        targetSdkVersion 21
        testSdkVersion 28
      }
      defaultConfig {
        ...
        minSdkVersion 21
        testApiVersion 28
      }
  1. ✔️
      defaultConfig {
        ...
      minSdkVersion 21
        targetSdkVersion 28
      }

Q11. When will an activity’s onActivityResult()be called?

  1. when calling finish()in the parent activity
  2. When placing an app into the background by switching to another app
  3. When onStop() is called in the target activity
  4. When calling finish() in the target activity✔️

For more information

Q12. You need to remove an Event based on it’s id from your API, Which code snippet defines that request in Retrofit?

  1. @DELETE(“events) fun deleteEvent(@Path(“id”) id: Long): Call<Unit>
  2. @DELETE(“events/{id}”) fun deleteEvent(@Path(“id”) id: Long): Call<Unit>✔️
  3. @REMOVE(“events/{id}”) fun deleteEvent(@Path(“id”) id: Long): Call<Unit>
  4. @DELETE(“events/{id}”) fun deleteEvent(@Path(“id”) id: Long): Call<Unit>✔️

Q13. When would you use a product flavour in your build setup?

  1. when you need to have the app’s strings present in multiple languages
  2. when you have to provide different versions of your app based on the physical device size
  3. when you want to provide different versions of your app based on the device screen density
  4. when you want to provide different version of your app with custom configuration and resources✔️

Q14. Given the fragment below, how would you get access to a TextView with an ID of text_home contained in the layout file of a Fragment class?

    private lateinit var textView: TextView
    override fun onCreateView(...): View? {
        val root = inflator.inflator(R>layout.fragment_home, container, false)
        textView = ??
        return root
    }
  1. root.getById(R.id.text_home)
  2. findViewByID(R.id.text_home)
  3. root.findViewById(R.id.text_home)✔️
  4. root.find(R.id.text_home)

Q15. Why do you use the AndroidJUnitRunner when running UI tests?

  1. The test runner facilitates loading your test package and the app under test onto a device or emulator, runs the test, and reports the results.✔️
  2. The test runner creating screenshots of each screen that displayed while tests are executed.
  3. The test runner facilitates parallelization of test classes by providing for each test class.
  4. The test runner facilitates interacting with visible elements on a device, regardless of the activity or fragment that has focus.

Q16. What allows you to properly restore a user’s state when an activity is restarted?

  1. the onSaveInstance()method✔️
  2. all of these answers
  3. persistent storage
  4. ViewModel objects

Q17. Given the definition below. how would you get access a TextView with an ID of text_home contained in the layout file of a Fragment class?

  1. root.find(R.id.text_home)
  2. findViewById(R.id.text_home)
  3. root.getById(R.id.text_home)
  4. root.findViewById(R.id.text_home)✔️

Q18. IF the main thread is blocked for too long, the system displays the _ dialog?

  1. Thread Not Responding
  2. Application Paused
  3. Application Not Responding✔️
  4. Application Blocked

Q19. How would you retrieve the value of a user’s email from SharedPreferences while ensuring that the returned value is not null?

  1. getPreferances(this).getString(Email,””)
  2. getDefaultSharedPrefarances(this).getString(EMAIL,null)
  3. getDefaultSharedPreferances(this).getString(EMAIL,””)✔️
  4. getPreferances(this).getString(EMAIL,null)

Explanation: In Method “getDefaultSharedPrefarances(this).getString()” Second parameter is passed so that it can be returned, in case key doesn’t exist. So we need to pass an empty string to be returned in case key doesn’t exist.

Q20. Why is it problematic to define sizes using pixels on Android?

  1. Although screen pixel density varies, this does not impact the use of pixels to define sizes.
  2. Large devices always have more pixels, so your UI elements will be e=affected if you define them with pixels.
  3. The same number of pixels may correspond to different physical sizes, affecting the appearance of your UI elements.
  4. Different devices have different understanding of what a pixel is , affecting the appearance of your UI elements.✔️

Q21. You need to get a list of devices that are attached to your computer with USB debugging enable. Which command would execute using the Android Debug Bridge?

  1. list devices
  2. adb devices✔️
  3. list avd
  4. dir devices

Q22. To persist a small collection of key-value data, what should you use?

  1. external file storage
  2. SharedPereferences✔️
  3. SQLite
  4. internal file storage

Q23. You need to retrieve a list of photos from an API. Which code snippet defines an HTML GET request in Retrofit?

  1. @GET(“photo/{id}”} fun listPhotos(@Path(“id”) id:Long?) : Call<Photo>
  2. @LIST(“photo”) fun listPhotos() : Call<List<Photo>>
  3. @GET(“photo”) fun listPhotos() : Call<Photo>
  4. @GET(“photo”) fun listPhotos() : Call<List<Photo>>✔️

Q24. Given the test class below, which code snippet would be a correct assertion?

  1. assertThat(resultAdd).is(2.0)
  2. assertNotNull(resultAdd)✔️
  3. assertThat(resultAdd).isWqualTo(2.0)
  4. assertThat(resultAdd)

Q25. What tag should you use to add a reusable view component to a layout file?

  1. <merge/>
  2. <include/>✔️
  3. <layout/>
  4. <add/>

Q26. You want to provide a different drawable for devices that are in landscape mode and whose language is set to French. which directory is named correctly?

  1. fr-land-drawable
  2. drawable-fr-land✔️
  3. drawable-french-land
  4. french-land-drawable

Q27. Why might you need to include the following permission to your app?

android.permission.ACCESS_NETWORK_STATE

  1. to monitor the location of the devices so that you don’t attempt to make network calls when the user is stationary
  2. to request the ability to make network calls from your app✔️
  3. to monitor the network state of the device so that you can display an in-app banner to the user
  4. to monitor the network state of the devices so that you don’t attempt to make network calls when the network is unavailable

Q28. You want to open the default Dialer app on a device. What is wrong with this code?

val dialerIntent = Intent()
val et = findViewById(R.id.some_edit_text)
dialerIntent.action = Intent.ACTION_DIAL
dialerIntent.data = Uri.parse("tel:" + et.getText()?.toString())
startActivity(dialerIntent)
  1. startActivityWithResult() should be used instead of startActivity() when using Intent.ACTION_DIAL.✔️
  2. For Intent.ACTION_DIAL, the Intent option Intent.FLAG_ACTIVITY_NEW_TASK must be added when using this dialerIntent.
  3. The dialerIntent will cause an ActivityNotFoundException to be thrown on devices that do not support Intent.ACTION_DIAL.
  4. The permission android.permission.CALL_PHONE must be requested first before Intent.ACTION_DIAL can be used.

Q29. When should you store files in the /assets directory?

  1. when you need access to the original file names and file hierarchy✔️
  2. when you need access to the file with its resource ID, like R.assets.filename
  3. when you have XML files that define tween animations
  4. when you need to access the file in its raw form using Resources.openRawResource()

Q30. You want to allow users to take pictures in your app. Which is not an advantage of creating an appropriate intent, instead of requesting the camera permission directly?

  1. Users can select their favorite photo apps to take pictures.
  2. You do not have to make a permission request in your app to take a picture.
  3. You have full control over the user experience. The app that handles the camera intent will respect your design choices.✔️
  4. You do not have to design the UI. The app that handles the camera intent will provide the UI.

Q31. When would you use the ActivityCompat.shouldShowRequestPermissionRationale() function?

  1. when a user first opens your app and you want to provide an explanation for the use of a given permission
  2. when a user has previously denied the request for a given permission and selects “Tell me more”
  3. when a user has previously denied the request for a given permission and you want to provide an explanation for its use
  4. when a user has previously denied the request for a given permission and selected “Don’t ask again,” but you need the permission for your app to function✔️

Q32. You would like to enable analytics tracking only in release builds. How can you create a new field in the generated BuildConfig class to store that value?

buildTypes {
	debug {
		buildConfig 'boolean', 'ENABLE_ANALYTICS', 'false'
	}
	release {
		buildConfig 'boolean', 'ENABLE_ANALYTICS', 'true'
	}
}
buildTypes {
	debug {
		buildConfig 'String', 'ENABLE_ANALYTICS', 'false'
	}
	release {
		buildConfig 'String', 'ENABLE_ANALYTICS', 'true'
	}
}
  1. ✔️
buildTypes {
	debug {
		buildConfigField 'boolean', 'ENABLE_ANALYTICS', 'false'
	}
	release {
		buildConfigField 'boolean', 'ENABLE_ANALYTICS', 'true'
	}
}
buildTypes {
	debug {
		buildConfigField 'boolean', 'ENABLE_ANALYTICS', 'true'
	}
	release {
		buildConfigField 'boolean', 'ENABLE_ANALYTICS', 'false'
	}
}

Q33. To optimize your APK size, what image codec should you use?

  1. JPG
  2. PNG
  3. MPEG
  4. WebP✔️

Q34. You have built code to make a network call and tested that it works in your development environment. However, when you publish it to the Play console, the networking call fails to work. What will not help you troubleshoot this issue?

  1. checking whether ProGuard -keepclassmembers have been added to the network data transfer objects (DTOs) in question
  2. using the profiler tools in Android Studio to detect anomalies in CPU, memory, and network usage✔️
  3. checking for exceptions in the server logs or server console
  4. checking that the network data transfer object has @SerializedName applied to its member properties

Q35. Which source set is _not_ available to you by default when Android Studio creates a new project?

  1. test
  2. androidTest
  3. app
  4. main✔️

Q36. Which definition will prevent other apps from accessing your Activity class via an intent?

  1. ✔️
xml
	<activity android:name=".ExampleActivity" />
xml
	<activity android:name=".ExampleActivity">
		<intent-filter>
			<action android:name="android.intent.action.SEND" />
		</intent-filter>
	</activity>
xml
	<activity android:name=".ExampleActivity">
		<intent-filter>
			<action android:name="android.intent.action.MAIN" />
			<category android:name="android.intent.category.LAUNCHER" />
		</intent-filter>
	</activity>
xml
	<activity android:name=".ExampleActivity">
		<intent-filter>
			<action android:name="android.intent.action.VIEW" />
		</intent-filter>
	</activity>

Explanation: Intent filters are used to make activities accessible to other apps using intents. So we have to choose option which have no intent filter to make sure it is not accessible by intent

Q37. To preserve on-device memory, how might you determine that the user’s device has limited storage capabilities?

  1. Use the ActivityManager.isLowRamDevice() method to find out whether a device defines itself as “low RAM.”✔️
  2. Use the Activity.islowRam() method to find out whether a device defines itself as “low RAM.”
  3. Use the ConnectivityManager.hasLowMemory() method to find out whether a device defines itself as “low RAM.”
  4. Make an image download request and check the remaining device storage usage.

Q38. What is _not_ a good way to reuse Android code?

  1. Use a common Gradle module shared by different Android projects.
  2. Prefer to build custom views or fragments over activities.
  3. Prefer to build activities instead of fragments.
  4. Break down UI layouts into common elements and use <include/> to include them in other layout XML files.✔️

Q39. Which layout is best for large, complex hierarchies?

  1. LinearLayout
  2. ConstraintLayout✔️
  3. FrameLayout
  4. RelativeLayout

Q40. You need to upgrade to the latest version of the Android Gradle plugin. Which file should you modify?

  1. root_project_dir/app/build.gradle.
  2. root_project_dir/settings.gradle.
  3. root_project_dir/build.gradle.✔️
  4. root_project_dir/app/gradle.properties.

Reference – https://developer.android.com/studio/releases/gradle-plugin#updating-plugin

Q41. Why do developers often put app initialization code in the Application class?

  1. The Application class is instantiated before any other class when the process for the application is created.✔️
  2. The Application class is instantiated after any permissions requests when the process for the application is created.
  3. The Application class is created each time a new Activity is launched, making it ideal for initialization code.
  4. The Application class is created each time a background service is called, making it ideal for initialization code.

Reference – https://developer.android.com/reference/android/app/Application

Q42. What folder should you use for your app’s launcher icons?

  1. /drawable
  2. /icon
  3. /mipmap✔️
  4. /launcher

Q43. Given this code snippey from a build.gradle file, which choice is not a possible build variant?

android {
    ...
    defaultConfig{...}

    buildTypes{
    debug{...}
    releasae{...}
}

  flavorDimensions "environment"
  productFlavors {
     producation {...}
     staging {...}
  }
}
  1. productionDebug.
  2. developmentDebug.✔️
  3. stagingDebug.
  4. stagingRelease.

Reference- https://developer.android.com/studio/build/build-variants#flavor-dimensions

Q44. When should you use the androidTest directory to store your test classes?

  1. when the tests consist only of unit tests.
  2. when the number of tests to run is large(500+).
  3. when the tests need to run on your local machine.
  4. when the tests need to run on real or virtual devices.✔️

Reference – https://developer.android.com/studio/test#test_types_and_location

Q45. Given an APK named app-internal-debug.apk produced from the build process, which statement is likely to be true?

  1. This APK is created on a developer machine from the debug product flavor.
  2. This APK is created from the internalDebug product flavor.
  3. This APK created from the debug product flavor and internal build type.✔️
  4. This APK is created from the debug build type and internal product flavor.

Q46. When attempting to build your project, what might the following error indicate?

Conversion to Dalvik format filed: Unable to execute dex: method ID not in [0, 0xffff]: 65536

  1. You have included incorect format information in your build.gradle file.
  2. You have added more than 20 dependencies to your build.gradle.
  3. You have exceeded the total number of methods that can be referenced within a single DEX file.✔️
  4. You have a NullPointerException in your code.

Q47. Which statement, in build.gradle file, correctly denotes that the corresponding module is an Android library module?

  1. apply plugin: ‘com.module.library’
  2. apply plugin: ‘com.android.library’✔️
  3. apply plugin: ‘com.module.library’
  4. include plugin: ‘com.module.library’

Q48. Given the following dimens.xml file, how would you define an ImageView with medium spacing at the bottom?

<?xml version=1.0 encoding="utf-8"?>
<resources>
    <dimen name="spacing_medium">8dp</dimen>
    <dimen name="spacing_large">12dp</dimen>
</resources>
<ImageView
   android:id=@+id/image_map_pin"
   android:layout_width="wrap_content"
   android:layout_heignt="wrap_content"
   android:src=@drawable/map_pin />
   android:id=@+id/image_map_pin"
   android:layout_width="wrap_content"
   android:layout_heignt="wrap_content"
   androi:layout_botttom="@dimen/spacing_medium"
   android:src=@drawable/map_pin />
<ImageView
   android:id=@+id/image_map_pin"
   android:layout_width="wrap_content"
   android:layout_heignt="wrap_content"
   android:layout_marginBottom="@resources/spacing_medium"
   android:src=@drawable/map_pin />
  1. ✔️
<ImageView
   android:id=@+id/image_map_pin"
   android:layout_width="wrap_content"
   android:layout_heignt="wrap_content"
   android:layout_marginBottom="@dimen/spacing_medium"
   android:src=@drawable/map_pin />

Q49. what is not a benefit of externalizing app resources such as image and string from a code?

  1. It allows Android to choose the appropriate resource based on the current configuration during runtime.✔️
  2. It allows you to have more performant applications because the code and resources are separated.
  3. It allows you to provide a different UI experience based on the user’s language settings.
  4. It allows you to provide a different UI experience based on the user’s device size.

Q50. What is the chief purpose of line five in this code snippet?

override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_post_create)

	if (savedInstanceState != null) return

	val fragment = CreatePostFragment()
		supportFragmentManager
		.beginTransaction()
		.add(R.id. fragment_container, fragment)
		.commit()

}
  1. to make sure that the activity finishes when the savedInstanceState is not null
  2. to make sure that the activity creates a new fragment each time it is restored from a previous state✔️
  3. to prevent the display of two fragments side by side in cases where the activity is restored from a previous state
  4. to prevent the creation of overlapping fragments in cases where the activity is restored from a previous state

Q51. Which component is not an entry point through which the system or a user can enter your app?

  1. activity
  2. content provider
  3. fragment✔️
  4. service

Q52. What should you use to display a large, scrolling list of elements?

  1. ListView
  2. Recycler View✔️
  3. LinearLayout
  4. Scrollview

Q53. You have created an AboutActivity class that displays details about your app. Which code snippet allows you to launch your activity?

  1. Intent(this, AboutActivity::class).also { intent -> startService(intent) }
  2. Intent(this, AboutActivity::class.java).also { intent -> startActivity(intent) }
  3. Intent(this, AboutActivity::class).also { intent -> activity(intent) }
  4. Intent(this, AboutActivity::class).also { intent -> startActivity(intent) }✔️

Q54. What is the use of AndroidManifest.xml file?

  1. It describes the component ofthe application
  2. It declares the minimum level of the android API that the application requires
  3. It facilitates to provide a uinque name for the application by specifying package name
  4. All of the above✔️

Q55. Which attribute of the element <uses-sdk> is used to specify the minimum API Level required for the application to run?

  1. android:targetSdkVersion
  2. android:minSdkVersion✔️
  3. android:maxSdkVersion
  4. None of the above

Q56. To shrink your code in release builds, what tool does Android Studio use?

  1. R8✔️
  2. ProGuard
  3. Shrinker
  4. D8

Leave a Comment

5 + eighteen =

CRICKET LIVE STREAMING