OneTimeWorkRequest vs PeriodicWorkRequest and minimum repeat interval

Tests WorkManager scheduling constraints and battery tradeoffs. Contrast one-shot chaining with non-chained periodic work, cite the 15-minute minimum, and tie it to system batching under Doze and App Standby. Red flag: claiming exact intervals or no minimum.
What's really being asked
This question tests whether you understand the architectural split between one-shot and repeating background work in WorkManager, the API constraints that enforce battery-friendly behavior, and the platform philosophy behind minimum intervals. Interviewers want to see that you know when to use each request type and that you can explain why Android imposes hard limits rather than leaving scheduling entirely to the app.
The full answer
OneTimeWorkRequest represents a single unit of work that runs exactly once. It supports input and output Data objects, exponential and linear backoff retry policies, and can be composed into chains and graphs of dependent work where the output of one worker feeds into the next. PeriodicWorkRequest represents work that repeats on a fixed cycle. Because the repeating nature means there is no single terminal completion point that can trigger downstream work, PeriodicWorkRequest cannot be chained or used as a prerequisite for other requests. The minimum repeat interval for PeriodicWorkRequest is 15 minutes. The API enforces this floor and will raise or clamp any shorter duration to 15 minutes. The reason for the limit is battery preservation and system-wide batching. Android uses Doze mode and App Standby to defer background activity until maintenance windows. A 15-minute floor allows the OS to align work from many apps into shared wakeups, reducing radio and CPU usage rather than honoring exact per-app alarm-style timing.
The mistakes people make
A common wrong answer is stating that PeriodicWorkRequest supports chaining or dependent work. Another red flag is claiming the minimum interval is one minute, five minutes, or that there is no enforced floor. Candidates who describe WorkManager as suitable for exact real-time scheduling or who confuse it with AlarmManager for precise repeating alarms also miss the point. Saying the limit exists only to restrict developers rather than to preserve battery is a signal of shallow platform understanding.
What usually comes next
An interviewer might ask how flex intervals affect periodic work execution windows, how to enforce unique work policies with existing periodic requests, or when to prefer AlarmManager plus a broadcast receiver instead. They may also ask about expedited work and how it interacts with periodic constraints, or how to test WorkManager behavior with a custom test driver and mock clock.
A concrete example
If you need to sync user notes to a backend every hour, you would use PeriodicWorkRequest with a one-hour repeat interval. The system schedules this within a flexible window and guarantees it runs at most once per interval, but it may defer execution to batch with other apps during a maintenance window. If you need to upload a single photo with post-processing and then send a notification, you would use a OneTimeWorkRequest chain: an upload worker, then a filter worker, then a notification worker. The chain completes once and releases resources.
Interview question
Which accurately describes a WorkManager limitation designed to preserve battery?
- a.PeriodicWorkRequest supports exact timing but defers execution during Doze mode.
- b.OneTimeWorkRequest batches its execution with other apps to reduce radio usage.
- c.OneTimeWorkRequest requires a 15-minute cooldown between retries.
- d.PeriodicWorkRequest cannot be chained and enforces a 15-minute minimum repeat interval.Correct
Why? this is the answer
PeriodicWorkRequest cannot be chained because repeating work has no single completion point, and the 15-minute floor lets Android batch wakeups across apps during maintenance windows to save battery. Distractor B is wrong because WorkManager is explicitly not designed for exact alarm-style timing; it defers work flexibly rather than honoring precise intervals.
Just read this? Test yourself on what you have been reading.
Read the original → developer.android.com
- #android
- #workmanager
- #background-work
- #battery-optimization
- #jetpack
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on android — each one lists the topics its interview covers.
See open roles