WorksheetsAndroid 4
Total questions: 15
Worksheet time: 15mins
Name
Class
Date
1.
What are the worst case and best case time complexity of bubble sort consequently?
a)
O(n), O(n2)
b)
O(n2), O(n3)
c)
O(n), O(n3)
d)
None of the above
2.
Each Android application runs in its own process and with its own instance of ART on devices running Android version 8.0 (API Level 26) or higher.
a)
True
b)
False
3.
If you are developing more than one application that is signed with the same certificate, and you want these applications to share access to each other’s data and run in the same process, you need to give them the same ………………
a)
user ID (sharedUserId).
b)
user name and password.
c)
app description.
d)
Ad unit ID
4.
Which of these are not one of the three main components of the APK?
a)
Dalvik Executable
b)
Resources
c)
Native Libraries
d)
Webkit
5.
Broadcast receivers are Android's implementation of a system-wide publish/subscribe mechanism, or more precisely, what design pattern?
a)
Observer
b)
Façade
c)
Mediator
d)
Command
6.
What are the same between Façade, Proxy and Adapter pattern?
a)
Structural group
b)
Play an intermediary role
c)
Convert Source code
d)
All of above
7.
"Without violating encapsulation, capture and externalize an object’s internal state so that the object can be restored to this state later."
Which design pattern is mentioned above?
a)
State
b)
Memento
c)
Prototype
d)
Composite
8.
What is D stands for in SOLID principles?
a)
Dependency Invertion
b)
Database Inversion
c)
Dependency Invertion
d)
Database Inversion
9.
Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.
a)
Interpreter
b)
Visitor
c)
Iterator
d)
Composite
10.
"What happens when you run the following code?
int i = 0;
while(true) {
i++;
Log.d(""Test"",""i = ""+i);
}"
a)
A crash occurred
b)
An ANR occured
c)
Code runs normally
d)
A&B
11.
How many String objects are created in the following code?
String s1="Hello";
String s2="Hello";
String s3="World";
a)
2
b)
3
c)
4
12.
How to share viewmodel between fragment-fragment, activity-fragments?
a)
Init view model using "by viewmodels()" function of fragment-ktx
b)
Init view model using "by activityViewModels()"" function of fragment-ktx
c)
Init view mode by using "ViewModelProvider(fragment context).get"
d)
Init view model by using "ViewModelProvider(activity context).get"
13.
What is the purpose of adding the following permission tag to your app’s AndroidManifest.xml file?
<uses-permission android:name="android.permission.INTERNET" />
a)
Permission to connect the app to internet.
b)
Permission to enable cookies’ files on your app.
c)
Permission to configure Chrome as default web browser.
d)
Permission to open hidden internet connection.
14.
Fill input text: This sequence is .... diagram for demonstrate scenarios which user interacts.
a)
Usecase
b)
Sequence Diagram
c)
Class Diagram
d)
Model
15.
Which annotation below is NOT used to provide data for parameter of ParameteredTest annotation in Junit?
a)
@NetworkSource
b)
@MethodSource
c)
@CsvSource
d)
@CsvFileSource
100 %
