Kotlin Mastery
Open main menu
Home
About
Daily Quiz
Login
Loading...
Background Tasks
1
How do you decide if some task should be a Background Task? What options do you have to complete a Background Task?
2
What is an Asynchronous Work? What options do you have to achieve those?
3
What is a Background Work? What is the preferred way of doing that in Android?
4
What type of work should normally be done in the Background?
5
When is an app considered to be running in the Background?
6
Can you list some restrictions Android imposes on apps, when they are running in the background?
7
Can you explain how you would handle a task, such as a PDF generation, that is initiated by the user while the app is visible, to ensure a seamless user experience and prevent the main thread from being blocked?
8
How would you handle a heavy calculation that is part of the main flow of your application?
9
What will happen to an Asynchronous work if the app leaves foreground?
10
What are Task Scheduling API’s useful for? How do they differ from Asynchronous work?
11
Have you worked with Work Manager? What can you achieve with Work Manager?
12
You are tasked with maintaining an existing Android project that utilises the JobScheduler API for scheduling background tasks. Provide a Statement of Work (SOW) for upgrading the project to use WorkManager instead of JobScheduler. Be sure to highlight the benefits and considerations for this migration.
13
How would you schedule a task to be executed at a specific time in an Android application?
14
Can you explain the concept of a Wake Lock in Android, including its purpose and typical use cases?
15
Scenario: A user is reporting a significant delay when launching the Free to Air app, which you suspect is caused by the loading of the TV guide at startup. However, you have scheduled a background task to load the TV guide at midnight when Wi-Fi is enabled.
16
Say your Android device freezes when WiFi is reconnected. What potential reasons could cause this issue, and how would you troubleshoot it?
17
What is the difference between Async Work and Persistent work?
18
Say you need to perform a task that should start immediately and continue running even if the app is terminated? How would you achieve this in Android?
19
If your app is required to perform long-running HTTP downloads, how would you implement it?
20
If your app is required to keep synchronise data with an external server, how would you approach it?
21
How can you achieve a task that should start immediately and keep running for more than 10 mins, and resume even if the app restarts?
22
I want to execute a task every midnight, how would you go about it?
23
When would you use AlarmManager instead of Work Manager?
24
If you notice that your workers run too often or not at all, how can you troubleshoot the issue?
25
How do you write test cases for Workers?
Asynchronous Work
Background Work
Special APIs
Foreground Service