What is overdraw in Android UI and how do you reduce it?

This tests GPU fill awareness. A strong answer defines overdraw as redrawing pixels repeatedly, names Debug GPU Overdraw's color overlay, and offers fixes: remove unnecessary backgrounds and flatten hierarchies. Red flag: confusing this with CPU layout issues.
WHAT THIS TESTS: Whether you understand the GPU side of the Android rendering pipeline, specifically fill-rate bottlenecks. Overdraw is a GPU fragment-shading problem, not a CPU layout problem. The interviewer wants to know if you can distinguish pixel-level redundancy from view-measure inefficiency and if you know the exact developer tool and practical fixes.
A GOOD ANSWER COVERS: Four things in order. First, define overdraw as drawing the same pixel more than once during a single frame, which wastes GPU fill-rate and battery. Second, name the Debug GPU Overdraw tool in Developer Options and describe its color-coded overlay where blue means one overdraw, green means two, pink means three, and red means four or more. Third, give the first reduction technique which is removing unnecessary backgrounds such as eliminating a redundant window background when the activity content already covers it with an opaque color. Fourth, give the second technique which is flattening view hierarchies to reduce overlapping opaque views or using clipRect to prevent drawing regions that are hidden behind foreground content.
COMMON WRONG ANSWERS: Three patterns to avoid. First, treating overdraw as a layout or measure issue and talking about ConstraintLayout or nested weights without mentioning pixel overlap. Second, naming Profile GPU Rendering, Systrace, or the Layout Inspector as the primary way to identify overdraw instead of Debug GPU Overdraw. Third, recommending transparency, alpha animations, or complex gradients as solutions, which usually increase fragment shading rather than reduce it.
LIKELY FOLLOW-UPS: The interviewer may ask how overdraw differs from expensive layout passes, whether hardware layers help or hurt overdraw, or how Jetpack Compose changes the overdraw story. They may also ask you to estimate the impact, such as how many milliseconds per frame you saved after removing redundant backgrounds in a previous project.
ONE CONCRETE EXAMPLE: Consider a login screen with a gray window background, a full-screen ImageView with a gray placeholder, and a centered card view with its own gray background. That creates triple overdraw across most pixels. By removing the window background and the ImageView placeholder so only the card background remains visible, you drop the overdraw count from red to blue or green, which often improves frame times by one to three milliseconds on mid-range devices.
Read the original → developer.android.com
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.