The Comprehensive Guide to Acing the Android Developer
Intern Interview
Introduction
The global demand for skilled mobile developers continues to grow, and the Android
ecosystem remains a vibrant and essential part of this landscape. For aspiring interns,
securing a position is the first critical step into a rewarding career. This guide is
designed to be an exhaustive resource, meticulously prepared to equip candidates for
the challenges and opportunities of the Android Developer Intern interview process.
An interview is more than a test of rote memorization; it is an assessment of
foundational knowledge, logical problem-solving abilities, communication skills, and a
demonstrated passion for learning and building.
Successfully navigating this process requires a multi-faceted preparation strategy.
Technical proficiency in core Android concepts, Kotlin, and modern development
practices is paramount. However, equally important is the ability to articulate this
knowledge clearly, structure answers to behavioral questions effectively, and present
oneself with professionalism and cultural awareness. The interviewers are not just
hiring a coder; they are investing in a future team member who can learn, adapt, and
contribute to the team's collective success.
This report provides a structured pathway to comprehensive preparation. Part I
establishes the non-technical groundwork, focusing on interview etiquette,
professional conduct with specific considerations for the Indian job market, and a
mastery of the STAR method for answering behavioral questions. Part II forms the
core of the technical preparation, presenting 100 detailed questions and answers
covering everything from Android fundamentals and UI development to advanced
architecture and networking. Part III offers a self-assessment challenge with 100
multiple-choice questions to reinforce learning. Finally, Part IV covers the essential
toolkit of a modern developer, providing a primer on the version control and build
systems that are indispensable in a professional environment. By leveraging each
section, an aspiring intern can build not just knowledge, but the confidence needed to
excel.
Part I: Mastering the Interview Fundamentals
Chapter 1: Professional Conduct and Interview Etiquette
Success in an interview begins long before the first technical question is asked. It is
founded on a bedrock of professionalism that communicates respect, seriousness,
and a candidate's suitability for a corporate environment. This chapter details the
universal standards of interview etiquette and provides specific context for navigating
the cultural nuances of the Indian tech industry.
Universal Etiquette: The Foundations of Professionalism
Certain principles of professional conduct are globally recognized and form the
baseline expectation for any candidate. Adhering to these demonstrates maturity and
respect for the interviewer's time and process.1
Punctuality, Politeness, and Preparation
● Punctuality: Arriving on time is non-negotiable. For in-person interviews, plan
the route in advance to account for potential delays. For virtual interviews, log in
at least 10-15 minutes early to ensure all equipment is working correctly.2
Punctuality is a direct indicator of reliability and respect.1
● Politeness: Professional courtesy should extend to every person encountered
during the interview process, from the security guard at the entrance to the
scheduling assistant and the reception staff. Many companies solicit feedback
from these individuals, and any inconsistency in demeanor can be a significant
red flag.4 Greet everyone warmly and respectfully.1
● Preparation: Thorough research is a hallmark of a serious candidate. Before the
interview, invest time to understand the company's mission, values, products, and
recent achievements. Review the job description to align personal skills and
projects with the role's requirements.5 This preparation enables a candidate to
ask informed, insightful questions, leaving a strong, positive impression.1
Virtual Interview Best Practices
In an era of remote work, virtual interviews are standard. A candidate's ability to
manage this format professionally is a direct reflection of their potential to work
effectively in a remote or hybrid setting.
● Background and Environment: Choose a quiet, well-lit location with a neutral,
non-distracting background. Ensure the space is free of any material that could
be considered unprofessional or offensive.3 Inform others in the vicinity to avoid
interruptions.1
● Camera and Technology: Position the camera at eye level so that the entire face
and neck are clearly visible. Using a laptop is preferable to a phone, as it provides
a more stable and professional camera angle. Test the camera, microphone, and
internet connection thoroughly before the interview begins.5
● Attire and Presentation: Dress in professional business attire, just as one would
for an in-person interview. A dark jacket over a light-colored shirt is a safe and
appropriate choice.5 This applies even if only the upper body is visible; dressing
the part contributes to a professional mindset.
Body Language
Non-verbal cues are a powerful form of communication that can convey confidence,
engagement, or, conversely, nervousness and disinterest.7
● Posture: Sit up straight with shoulders relaxed. Leaning slightly forward can
signal engagement and interest, while slouching may be interpreted as laziness or
a lack of respect. Avoid crossing arms, which can appear defensive.1
● Eye Contact: Maintain steady, natural eye contact. In a virtual setting, this means
looking directly into the camera lens when speaking, which creates a sense of
connection with the interviewer. When listening, it is acceptable to look at the
interviewer's image on the screen.1
● Gestures and Habits: Use natural, controlled hand gestures to emphasize points,
but avoid wild or excessive movements. Keep hands visible and avoid fidgeting
with pens, jewelry, or hair, as these are common signs of anxiety.7 A genuine,
occasional smile can create a warm and positive atmosphere.8
Navigating the Indian Interview Context
While the fundamentals of etiquette are universal, understanding cultural nuances can
provide a significant advantage, particularly in the diverse and dynamic Indian job
market. The experience can differ based on whether the company is a multinational
corporation (MNC) with a Westernized culture or a more traditional Indian firm.10
● Formality and Hierarchy: Traditional Indian business culture often exhibits a high
"power distance," meaning there is a strong respect for authority and seniority.10
This can manifest in a more formal interview style. Interviewers may be addressed
as 'Sir' or 'Madam,' and a similar level of formal respect is often expected in
return.13 The interview may feel less like a conversation and more like a direct,
question-and-answer session, sometimes described as a "viva".14 A candidate
should not misinterpret this formality as disinterest or coldness; it is often a
cultural norm reflecting a professional hierarchy.10
● Communication Style: The communication style can be indirect, with a cultural
tendency to avoid direct conflict or saying "no".11 This is sometimes referred to as
a "Yes Culture," where a candidate might agree to a proposition to avoid
confrontation or "losing face," even if they are not fully confident.12 Therefore, it is
crucial for a candidate to be clear, honest, and forthright about their skills and
limitations, while remaining polite and respectful.1
● Body Language Nuances: Certain non-verbal cues carry specific meanings. For
instance, the common Indian side-to-side head tilt is generally a sign of active
listening and acknowledgement, not necessarily disagreement or uncertainty.15
Understanding such nuances can prevent misinterpretation and foster better
rapport.
Chapter 2: The Art of Answering: Behavioral and Situational Questions
Interviewers, especially for intern roles, are keenly interested in a candidate's
potential, which they assess by understanding past actions and predicting future
behavior. Behavioral questions (e.g., "Tell me about a time when...") and situational
questions (e.g., "What would you do if...") are primary tools for this assessment.16
Mastering a structured answering technique is crucial for providing clear, compelling,
and relevant responses.
The STAR Method Explained
The STAR method is a widely endorsed framework for structuring answers to
behavioral questions. It provides a simple narrative arc that makes responses easy to
follow and ensures all critical information is included.2 The acronym stands for:
● S - Situation (10% of answer): Briefly describe the context. Set the scene by
explaining the project, course, or situation you were in. This should be a concise
introduction to ground the story.16
○ Example: "In my final-year software engineering course, our team was tasked
with developing a mobile application from scratch."
● T - Task (10% of answer): Explain your specific role, responsibility, or the goal
you were assigned. What was the objective you needed to accomplish?.16
○ Example: "I was personally responsible for designing and implementing the
user authentication module, which needed to support both email/password
and Google sign-in."
● A - Action (60% of answer): This is the most important part of the response.
Detail the specific, individual actions you took to address the task. Use "I"
statements to demonstrate ownership and initiative.16 Describe your thought
process, the tools you used, and the steps you followed.
○ Example: "First, I researched Android's best practices for security and
decided to use Firebase Authentication due to its robust features and clear
documentation. I designed the UI screens in XML using ConstraintLayout for
flexibility. Then, I wrote the Kotlin logic to handle user input, validate
credentials, and communicate with the Firebase backend. When I
encountered an issue with the asynchronous nature of the API calls, I
implemented Kotlin coroutines to manage the background tasks and ensure
the UI remained responsive."
● R - Result (20% of answer): Conclude by explaining the outcome of your
actions. Whenever possible, quantify the result. For an intern, the result is often
about learning and growth, not just business metrics.16
○ Example: "As a result, we had a fully functional and secure authentication
system that was successfully integrated into the main app. The module
handled user registration, login, and session management correctly. This
experience taught me invaluable lessons about working with third-party APIs
and managing asynchronous code, skills which I was able to apply to
subsequent projects."
Adapting STAR for Interns
Candidates for intern positions are not expected to have extensive corporate
experience. Interviewers understand this and are looking for potential,
problem-solving skills, and a willingness to learn.20 Therefore, it is perfectly acceptable
and expected to draw examples from:
● Academic Projects: University coursework, especially capstone or team-based
projects, are excellent sources of examples.
● Personal Projects: Apps you have built on your own time demonstrate passion
and initiative.
● Internships or Part-Time Jobs: Any prior work experience, even if not directly in
Android development, can be used to demonstrate soft skills like teamwork and
communication.
● Hackathons or Competitions: These are high-pressure environments that are
perfect for showcasing problem-solving and collaboration skills.
When answering a question like "Tell me about a time you failed," the "Result" for an
intern should not be about a catastrophic business failure but about the learning that
came from a mistake. A powerful answer would frame the failure as a learning
opportunity, concluding with how that lesson was applied to achieve success later.22
For example, a failed project could lead to the result of learning the importance of
version control with Git, which became a critical skill in the next project. This
demonstrates maturity, self-awareness, and a growth mindset—qualities highly valued
in an intern.
Handling Situational Questions
Situational questions ask how a candidate would handle a hypothetical future
scenario.23 While they are forward-looking, the strongest answers are still grounded in
past behavior and a logical, structured thought process.
● Question: "What would you do if you were assigned a task with a technology
you've never used before?"
● Structured Answer:
1. Acknowledge and Embrace: "First, I would embrace the opportunity to learn
something new. I'm passionate about technology and always eager to expand
my skillset."
2. Break Down the Problem: "Next, I would break down the task into smaller
pieces. I'd start by understanding the core requirements of what needs to be
built."
3. Formulate a Learning Plan: "I would then create a quick learning plan. This
would involve consulting the official documentation, looking for high-quality
tutorials or codelabs, and building a small 'hello world' style proof-of-concept
to understand the basics."
4. Seek Guidance (If Necessary): "If I encountered a blocker after my initial
research, I would formulate a specific, well-researched question and seek
guidance from my mentor or a senior developer on the team, showing them
what I've already tried."
5. Relate to Past Experience: "This approach is similar to when I had to learn
Retrofit for a personal project. By following the documentation and building a
small sample app first, I was able to quickly get up to speed and integrate it
successfully."
This approach shows the interviewer a mature, proactive, and efficient
problem-solving methodology, which is exactly what they are looking for in an intern.
Part II: The Android Developer Intern Interview: 100 Questions &
Answers
This section provides a comprehensive list of 100 questions specifically tailored for an
Android Developer Intern interview. The questions are categorized to cover behavioral,
foundational, UI-specific, and architectural topics. Each answer is designed to be
concise for direct recall, followed by a "Deeper Dive" section that offers a more
detailed explanation, allowing a candidate to demonstrate a more profound
understanding where appropriate.
Chapter 3: Foundational & Behavioral Questions (25 Questions)
These questions assess a candidate's personality, motivation, self-awareness, and
ability to function within a team. Answers should be honest, positive, and aligned with
the role and company culture.
1. Tell me about yourself.
● Concise Answer: "I am a final-year Computer Science student at with a strong
passion for mobile development. I've focused my studies and personal projects
on Android, building several apps using Kotlin, Jetpack Compose, and the MVVM
architecture. I'm eager to apply my academic knowledge in a professional setting
and contribute to a real-world product as an intern at [Company Name]."
● Deeper Dive: This question is an invitation to deliver a well-rehearsed,
90-second "elevator pitch".25 The goal is not to recite your life story but to
connect your past (education, projects), present (skills, passion), and future
(desire to work at this specific company) into a compelling narrative.25 Mention
1-2 key projects and the technologies used (e.g., "I developed a
task-management app using Room for local storage and LiveData to create a
reactive UI"). Conclude by expressing specific interest in the company, showing
you've done your research (e.g., "I'm particularly excited about your work in
[mention a specific area, like fintech or health tech] and would love to learn from
your team").
2. What are your greatest strengths?
● Concise Answer: "My greatest strengths are my ability to learn quickly and my
strong problem-solving skills. For example, in my projects, I've consistently been
able to pick up new libraries like Retrofit or technologies like Jetpack Compose by
studying the documentation and applying them to solve specific problems."
● Deeper Dive: Choose 2-3 strengths that are directly relevant to a software
development intern role.25 Avoid generic terms. Instead of "hard worker," provide
an example. Back up each strength with a brief story or evidence from your
experience.25 Other strong examples for an intern include: "strong analytical
skills" (from coursework), "collaborative team player" (from group projects), and
"proactive initiative" (from starting a personal project).
3. What is your greatest weakness?
● Concise Answer: "One area I'm actively working on is my tendency to want to
solve every problem from scratch. I've learned that leveraging existing libraries
and frameworks is often more efficient, so I'm focusing on better researching
established solutions before building my own. This has helped me become more
productive in my recent projects."
● Deeper Dive: The key is to be honest but strategic.2 Choose a real weakness that
is not a critical flaw for the role. Never use a "fake weakness" like "I'm a
perfectionist" or "I work too hard".26 The most important part of the answer is to
show self-awareness and describe the concrete steps you are taking to improve.25
Another good example could be, "I sometimes get too focused on the technical
details and need to make a conscious effort to step back and communicate the
bigger picture to my team members during project updates."
4. Why do you want to work for our company?
● Concise Answer: "I've been following [Company Name] for a while and I'm very
impressed with your [mention a specific product, technology, or company value].
Your commitment to [e.g., innovation, user experience, open-source] aligns with
my own interests, and I believe my skills in Kotlin and modern Android
development would allow me to start contributing to your team while learning a
great deal."
● Deeper Dive: This question tests whether you are genuinely interested in this
specific opportunity or just looking for any job.25 Your answer must demonstrate
that you have done your research.26 Mention specific aspects of the company
that excite you: their products, their tech stack (if known), their company culture,
recent news or achievements, or their mission.25 Connect these points back to
your own skills and career goals.
5. Where do you see yourself in 5 years?
● Concise Answer: "In five years, I hope to have grown into a proficient mid-level
or senior Android Engineer. I aim to have a deep understanding of the entire
mobile development lifecycle and be capable of taking ownership of significant
features. I'm looking for a company where I can build a long-term career, and I'm
excited by the growth opportunities here."
● Deeper Dive: Interviewers ask this to gauge your ambition, career goals, and
whether you see a future with their company.25 Your answer should be realistic
and focused on growth and learning. Talk about the skills you want to master and
the level of responsibility you hope to achieve, rather than a specific job title.27
Emphasize your desire to contribute to the company's success over the long
term.
6. Tell me about a time you faced a significant challenge or failed.
● Concise Answer: "In a team project, we faced a major challenge when our initial
database design proved too slow for our app's needs. We had to refactor our
code just two weeks before the deadline. I took the lead on researching and
implementing a more efficient solution using the Room persistence library, which
ultimately solved the performance issue and we delivered the project on time."
● Deeper Dive: Use the STAR method for this answer.29 When discussing a failure,
own it, but focus on the lesson learned.22 For example: "I failed to properly
manage my time on an early solo project and missed my personal deadline. I
learned the importance of breaking large tasks into smaller, manageable chunks
and tracking my progress. I implemented this system in all my subsequent
projects and have been much more effective since." This shows maturity and a
growth mindset.
7. Describe a time you had to work with a difficult team member.
● Concise Answer: "On a university project, I worked with a team member who had
a very different communication style and was often unresponsive. I initiated a
one-on-one conversation to understand their perspective and we agreed on a
clearer communication plan using a shared Slack channel and weekly check-ins.
This improved our collaboration and we successfully completed our part of the
project."
● Deeper Dive: The goal is to demonstrate professionalism, empathy, and a focus
on resolution, not blame.23 Focus on the actions you took to improve the situation.
Did you try to understand their point of view? Did you focus on the shared goal
rather than the personal conflict? The ideal outcome is a positive resolution
where the team's objective was met.
8. How do you handle pressure or stressful situations?
● Concise Answer: "I handle pressure by staying organized and focusing on what I
can control. I break down large tasks into a prioritized list and tackle them one by
one. I also believe in clear communication; if a deadline seems unrealistic, I would
raise the concern early with my team lead to find a solution together."
● Deeper Dive: Provide a specific example.18 "During final exams week, I had two
major project deadlines in the same week. I created a detailed schedule,
allocating specific time blocks for each task and ensuring I took short breaks to
stay focused. By managing my time effectively and staying calm, I was able to
complete both projects to a high standard without feeling overwhelmed." This
shows maturity and practical coping strategies.
9. Give an example of a time you took initiative.
● Concise Answer: "In my last group project, I noticed our team didn't have a
formal way of tracking bugs. I took the initiative to set up a simple project board
on Trello. I created columns for 'To Do', 'In Progress', and 'Done', which helped us
visualize our work and ensure no issues were forgotten. The team found it very
helpful and adopted it for the rest of the project."
● Deeper Dive: Initiative is a highly sought-after trait in interns.29 Your example
should show you identifying a problem or opportunity and taking action without
being asked. This could be learning a new technology for a project, improving a
process, or helping a teammate who was struggling. The result should highlight
the positive impact of your action.
10. Are you a team player?
● Concise Answer: "Yes, absolutely. I enjoy collaborating with others and believe
the best results come from combining different skills and perspectives. In my
academic projects, I've always taken on roles from coding specific features to
helping with testing and documentation to ensure the team's overall success."
● Deeper Dive: This is a "yes" or "no" question that requires a "yes," but you must
back it up with evidence.20 Use a brief example. "For instance, in our capstone
project, our UI designer was falling behind. I volunteered to help them implement
some of the simpler XML layouts based on their mockups, which freed them up to
focus on the more complex design work and helped us meet our sprint goal."
11. What motivates you?
● Concise Answer: "I'm motivated by solving challenging problems and learning
new things. I love the feeling of finally figuring out a complex bug or successfully
implementing a new feature. I'm also motivated by seeing people use and enjoy
the software I've helped build."
● Deeper Dive: Connect your motivation to the core activities of a software
developer.25 Mentioning challenges, learning, and creating tangible products are
all strong motivators. You can also mention collaboration and contributing to a
team's goals. Avoid mentioning only money or job titles as your primary
motivation.26
12. How has your education prepared you for this role?
● Concise Answer: "My computer science degree has given me a strong
foundation in core principles like data structures, algorithms, and object-oriented
programming. Specifically, my courses in software engineering and mobile
development have provided me with hands-on experience in building, testing, and
debugging applications, which I'm confident will allow me to quickly get up to
speed in this internship."
● Deeper Dive: Go beyond just listing your degree.20 Connect specific coursework
or projects to the requirements of the job description. For example, "My data
structures course was critical in helping me understand the performance
trade-offs between different collections, which is directly applicable to optimizing
app performance. My software engineering project taught me the importance of
the agile methodology and version control using Git, which I know are used here."
13. What do you think it takes to be successful in this career?
● Concise Answer: "I believe success in software engineering requires a
combination of strong technical skills, a continuous desire to learn, and excellent
communication. Technology is always evolving, so being adaptable and always
learning is crucial. And since software is built by teams, being able to collaborate
and communicate effectively is just as important as writing good code."
● Deeper Dive: This question assesses your understanding of the profession. Your
answer should show maturity and a long-term perspective. Mentioning both hard
skills (coding, architecture) and soft skills (communication, teamwork,
adaptability) demonstrates a well-rounded view. You can add that a passion for
creating great user experiences is also key for an Android developer.
14. Why did you choose a career in Android development?
● Concise Answer: "I chose Android development because I'm fascinated by the
impact mobile technology has on our daily lives. I love the challenge of building
intuitive and useful applications that can run on billions of devices worldwide. The
open-source nature of the platform and the vibrant developer community also
really appeal to me."
● Deeper Dive: Show genuine passion and a thoughtful reason for your choice.20
You can tell a personal story. "My interest started when I got my first smartphone
and was amazed by the apps I could use. I wanted to understand how they were
made, so I took an online course in Android development. I built my first simple
app and was immediately hooked on the process of turning an idea into a
functional product that I could hold in my hand."
15. How do you stay current with the latest trends in Android development?
● Concise Answer: "I actively follow the official Android Developers blog and
YouTube channel. I also read articles on platforms like Medium from prominent
Android developers, and I'm a member of several Android development
subreddits and online communities to see what challenges other developers are
facing and how they are solving them."
● Deeper Dive: This demonstrates your proactivity and passion for the field.18
Mentioning specific resources shows that your answer is genuine. You could also
mention following key figures from the Google Android team on social media,
listening to podcasts (like "Android Developers Backstage"), or contributing to or
studying open-source projects on GitHub.
16. Describe a project you are most proud of.
● Concise Answer: "I'm most proud of a personal project I built—a note-taking app
that syncs with a Firebase backend. I'm proud of it because I designed it from the
ground up, learning and implementing Jetpack Compose for the UI, MVVM
architecture, and coroutines for asynchronous operations. It was a huge learning
experience and resulted in a polished, functional app."
● Deeper Dive: Use the STAR method, even if it's not explicitly asked for. Focus on
a project that showcases relevant skills.24 Explain
why you are proud of it. Was it technically challenging? Did you learn a lot? Did
you overcome a significant obstacle? The "why" is more important than the
"what." Walk the interviewer through the architecture and the key technical
decisions you made.
17. Have you ever had a conflict with a supervisor or professor? How did you
resolve it?
● Concise Answer: "I haven't had a major conflict, but I did have a disagreement
with a professor over the scope of a project. I felt the requirements were too
broad for the given timeline. I scheduled a meeting, respectfully presented my
concerns with a detailed breakdown of the estimated time for each feature, and
proposed a more focused set of core features. He appreciated the analysis and
agreed to adjust the scope, which allowed our team to deliver a high-quality
project."
● Deeper Dive: The key here is to show that you can handle disagreements
professionally and constructively.20 Never speak negatively about a former boss
or professor. Frame the situation as a professional disagreement on an issue, not
a personal conflict. The ideal story ends with a positive, collaborative resolution.
18. What kind of work environment do you prefer?
● Concise Answer: "I thrive in a collaborative and supportive work environment
where I can learn from my peers and mentors. I enjoy being part of a team that is
passionate about building great products and is open to sharing knowledge and
providing constructive feedback."
● Deeper Dive: Your answer should align with what you know about the company's
culture.27 If they are a fast-paced startup, you might mention you enjoy dynamic
environments. If they are a large, established company, you might mention you
appreciate structured mentorship programs. The goal is to show that you would
be a good cultural fit.
19. Tell me about a time you had to learn a new skill quickly.
● Concise Answer: "For a recent hackathon, my team decided to build an app that
required real-time data updates. I had never used WebSockets before, so I spent
the first few hours of the event studying documentation and tutorials to learn the
Ktor client library for WebSockets. I was able to build a working prototype by the
end of the day, which was crucial for our project."
● Deeper Dive: This question assesses your adaptability and learning ability.29 Use
the STAR method. Detail the process you followed to learn the new skill. Did you
read docs? Watch videos? Build a small test project? Your process reveals how
you approach learning. The result should show that you successfully applied the
new skill to solve a problem.
20. How do you handle constructive criticism?
● Concise Answer: "I welcome constructive criticism as an opportunity to grow. I
listen carefully to the feedback, ask clarifying questions to make sure I
understand, and thank the person for their input. I then focus on incorporating
that feedback to improve my work. I believe feedback is essential for becoming a
better developer."
● Deeper Dive: Show that you are mature and not defensive.17 You can provide a
brief example. "During a code review on a project, a peer pointed out that my
variable names were not very descriptive. I initially thought they were clear
enough, but I listened to their reasoning, realized they were right, and went back
to refactor the code. It made the code much more readable, and it's a practice
I've followed ever since."
21. What are your salary expectations?
● Concise Answer: "Based on my research for Android Developer Intern roles in
this area and for a company of this size, I've seen ranges between. I am flexible
and more focused on the learning opportunity and experience I will gain from this
role."
● Deeper Dive: This can be a tricky question, especially for an intern.27 It is best to
do research beforehand on sites like Glassdoor or LinkedIn to find a typical range
for the role and location. Providing a range rather than a single number shows
flexibility. It's also wise to deflect by emphasizing that the experience and learning
opportunity are your primary motivators.5
22. Are you applying for other positions?
● Concise Answer: "Yes, I am actively exploring several opportunities in Android
development to find the best fit for my skills and career goals. However, this role
at [Company Name] is one of my top choices because of [mention a specific
reason, e.g., your innovative products or strong engineering culture]."
● Deeper Dive: It is perfectly fine and expected that you are applying for other
jobs.18 Honesty is the best policy. Answering "no" can seem untruthful or suggest
a lack of demand for your skills. Answering "yes" shows you are a serious
candidate exploring your options. Reaffirming your strong interest in
this specific role is a great way to end the answer.
23. What would your previous manager or professors say about you?
● Concise Answer: "I believe my professors would say that I am a curious and
engaged student who actively participates in discussions and is always willing to
help my peers. My manager from my part-time job would likely describe me as
reliable, responsible, and a quick learner who can be trusted to get tasks done
independently."
● Deeper Dive: This question is a way to gauge your self-awareness and how you
are perceived by others in a professional or academic context.20 Frame your
answer around positive attributes that are relevant to the job, such as work ethic,
curiosity, reliability, and teamwork. If possible, link it to specific feedback you've
received.
24. Describe a time you had to manage multiple priorities.
● Concise Answer: "During my last semester, I was juggling my final year project,
studying for exams, and a part-time job. I used a digital calendar and a to-do list
app to prioritize my tasks daily based on deadlines and importance. This
organization was key to successfully submitting my project on time, passing all my
exams, and fulfilling my work responsibilities."
● Deeper Dive: Use the STAR method to structure your answer.29 The key is to
demonstrate your organizational and time-management skills. Explain the system
you used to prioritize tasks. Did you use a specific methodology, like the
Eisenhower Matrix (urgent/important)? How did you ensure you met all your
commitments? This shows you can handle the demands of a professional work
environment.
25. Do you have any questions for us?
● Concise Answer: "Yes, I do. Could you describe what a typical day or week looks
like for an intern on this team? Also, what are the biggest challenges the team is
currently facing? And finally, what are the most important qualities for someone
to succeed in this role?"
● Deeper Dive: Always have questions prepared. Asking thoughtful questions
shows your genuine interest in the role and the company.25 Do not ask about
salary or benefits unless an offer has been made.5 Good questions to ask revolve
around:
○ The team and culture: "How does the team collaborate on projects?" "What is
the mentorship structure for interns?"
○ The role and expectations: "What would be the key goals for me to achieve in
the first 30 or 90 days?" "What does the onboarding process look like?"
○ The technology and challenges: "What is the current tech stack for the
Android app?" "What are some of the long-term goals for the product?"
Chapter 4: Core Android Concepts (35 Questions)
This chapter tests the fundamental knowledge that every Android developer, including
an intern, must possess. These concepts form the backbone of the Android
framework.
26. What are the four main components of an Android application?
● Concise Answer: The four main components are Activities, Services, Broadcast
Receivers, and Content Providers.
● Deeper Dive:
○ Activities: Represent a single screen with a user interface. For example, a
login screen or a settings screen would each be an Activity.30
○ Services: Perform long-running operations in the background without a UI.
For example, playing music or downloading a file while the user is in another
app.30
○ Broadcast Receivers: Respond to system-wide broadcast announcements.
They allow an app to react to events like the system booting up or the device
being plugged into power.30
○ Content Providers: Manage a shared set of app data. They provide a way to
share data between different applications, like a contacts app providing
contact information to other apps.32
27. Explain the Android Activity lifecycle methods and their order of execution.
● Concise Answer: The key lifecycle methods in order are: onCreate(), onStart(),
onResume(), onPause(), onStop(), and onDestroy(). When an activity is returning
to the foreground, onRestart() is called before onStart().
● Deeper Dive:
○ onCreate(): Called once when the activity is first created. This is where you
perform essential setup like inflating the layout and initializing variables.34
○ onStart(): Called when the activity becomes visible to the user. Can be called
multiple times.35
○ onResume(): Called when the activity is in the foreground and the user can
interact with it. The activity stays in this state until something takes focus
away, like an incoming phone call.34
○ onPause(): Called when the activity is partially obscured (e.g., by a dialog) but
still visible. This is the first indication that the user is leaving the activity. It's a
good place to save any unsaved data.34
○ onStop(): Called when the activity is no longer visible to the user, either
because another activity has covered it or it's being destroyed.34
○ onDestroy(): Called just before the activity is destroyed. This is the final
chance to release all resources to avoid memory leaks.36
○ onRestart(): Called when an activity that was stopped is about to be started
again.36
28. What is the difference between onCreate() and onStart()?
● Concise Answer: onCreate() is called only once during the activity's lifetime to
do initial setup. onStart() is called whenever the activity becomes visible to the
user, which can happen multiple times, such as when navigating back to the
activity.
● Deeper Dive: onCreate() is for one-time initializations that should not be
repeated, like setting the content view (setContentView()) or initializing a
ViewModel. onStart() is for tasks that need to happen every time the activity
comes on screen, like registering a Broadcast Receiver that should only be active
while the UI is visible. The sequence is always onCreate() -> onStart() the first
time, and onRestart() -> onStart() on subsequent returns to the activity from a
stopped state.35
29. What happens when you rotate the screen? Which lifecycle methods are
called?
● Concise Answer: When the screen is rotated, it's a configuration change. The
system destroys the current activity and recreates it. The lifecycle methods called
are onPause(), onStop(), onSaveInstanceState(), onDestroy(), followed by
onCreate(), onStart(), and onResume() for the new activity instance.
● Deeper Dive: This process ensures that the app can adapt to the new
configuration (e.g., loading a different layout for landscape mode). However, it
means any local state in the activity (like a counter value) will be lost unless it is
explicitly saved. The onSaveInstanceState() method is called before onStop() to
allow you to save small amounts of data in a Bundle. This Bundle is then passed to
the onCreate() method of the new activity instance, allowing you to restore the
state.34 This is a key reason why modern architecture components like
ViewModel, which survive configuration changes, are so important.
30. How do you save and restore an Activity's state?
● Concise Answer: You can save an activity's state by overriding the
onSaveInstanceState() method and adding data to the Bundle object it provides.
You can then restore this state in either onCreate() or onRestoreInstanceState(),
which receive the same Bundle.
● Deeper Dive: onSaveInstanceState() is designed for saving small, transient UI
state, not for persistent data storage.34 For example, you would save the text in an
EditText or the current scroll position. For persistent data, you should use other
mechanisms like SharedPreferences or a Room database. It's important to note
that many UI widgets, like EditText, automatically save and restore their own state
if they have a unique ID assigned in the layout file.34 Using a
ViewModel is the modern, recommended approach to handle UI state, as it
survives configuration changes automatically without the need for manual saving
and restoring in a Bundle.37
31. What are the key differences between an Activity and a Fragment?
● Concise Answer: An Activity is a standalone application component that
represents a single screen. A Fragment is a reusable portion of a UI that must be
hosted within an Activity. A single Activity can host multiple Fragments, allowing
for more modular and flexible UI designs, especially for different screen sizes like
tablets.
● Deeper Dive: This is a critical concept for an intern to understand. The key
differences can be summarized in a table.
Feature Activity Fragment
Definition A standalone component A modular section of an
representing a single screen. Activity's UI.
Dependency Independent. Can exist on its Dependent. Must be hosted
own. by an Activity.
Lifecycle Has its own complete lifecycle Has its own lifecycle, but it is
managed by the OS. tied to and affected by the
host Activity's lifecycle.
Manifest Must be declared in the Does not need to be declared
[Link] file. in the manifest.
UI Modularity Less modular. Difficult to Highly modular. Can be
reuse UI logic across different reused across multiple
screens. Activities, enabling multi-pane
layouts.
Weight Considered a heavier Considered a lightweight
component. component.
Source: 31
32. Explain the Fragment lifecycle and its relationship to the Activity lifecycle.
● Concise Answer: A Fragment's lifecycle is closely tied to its host Activity's
lifecycle. It has additional states like onAttach(), onCreateView(),
onViewCreated(), and onDestroyView(). For every lifecycle callback in the Activity
(e.g., onStart()), the corresponding callback is also triggered in the hosted
Fragment.
● Deeper Dive: The Fragment lifecycle is more complex because it has to manage
its own state as well as its relationship with the Activity and its own UI view.30
○ onAttach(): Called when the fragment is associated with an Activity.
○ onCreate(): Called to do initial fragment creation.
○ onCreateView(): Called to inflate the fragment's UI layout. This is where you
return the fragment's view.
○ onViewCreated(): Called after onCreateView() when the view hierarchy has
been created.
○ onStart(), onResume(), onPause(), onStop(): These mirror the Activity's
callbacks.
○ onDestroyView(): Called when the fragment's view is being destroyed. This is
where you should clean up resources tied to the view.
○ onDestroy(): Called to do final cleanup of the fragment's state.
○ onDetach(): Called when the fragment is disassociated from the Activity.
The key takeaway is that the Activity's lifecycle events drive the Fragment's
lifecycle events.38 For example, when the Activity's
onPause() is called, the Fragment's onPause() is also called.
33. What is a Context in Android and why is it important?
● Concise Answer: A Context is an object that provides access to global
information about an application's environment. It's used for a wide range of
operations, such as accessing resources, starting activities, and creating views.
● Deeper Dive: The Context is one of the most fundamental parts of the Android
framework.30 It's the "context" in which the application is currently running. It
allows you to:
○ Access Resources: Get strings, drawables, colors, and other resources using
methods like getString() or getDrawable().
○ Start Components: Launch Activities, start Services, and send Broadcasts
using methods like startActivity() and startService().
○ Access System Services: Get access to system-level services like the
LayoutInflater, NotificationManager, or ConnectivityManager.
○ Get File System Access: Access application-specific directories for internal
storage or cache.
There are different types of Context (e.g., Application Context vs. Activity
Context), and using the wrong one can lead to memory leaks.
34. What is the difference between Application Context and Activity Context?
● Concise Answer: An Activity Context is tied to the lifecycle of an Activity, while
an Application Context is tied to the lifecycle of the entire application. You should
use the Application Context for long-lived objects that need a context that
outlives an Activity, to prevent memory leaks.
● Deeper Dive: If you pass an Activity Context to an object that has a longer
lifecycle than the Activity itself (like a singleton or a ViewModel), that object will
hold a reference to the Activity, preventing it from being garbage collected after
it's destroyed. This is a classic memory leak. Therefore, the rule of thumb is: use
the Activity Context for operations that are scoped to the UI (like creating a dialog
or inflating a layout). Use the Application Context
([Link]()) for any operation that needs a context that
lives beyond a single screen.
35. What is an Intent?
● Concise Answer: An Intent is a messaging object used to request an action from
another app component. It can be used to start an Activity, a Service, or deliver a
broadcast.
● Deeper Dive: Intents are the primary mechanism for inter-component
communication in Android.30 They bind individual components to each other at
runtime. An
Intent object contains information that the Android system uses to determine
which component to start, such as the action to be performed and the data to act
upon. There are two main types of intents.33
36. What is the difference between an explicit and an implicit Intent?
● Concise Answer: An explicit Intent specifies the exact component to start by
name (e.g., [Link]). An implicit Intent does not name a specific
component, but instead declares a general action to perform, allowing a
component from another app to handle it.
● Deeper Dive:
○ Explicit Intent: Used for communication within your own application. You
know exactly which Activity or Service you want to launch. Example:
Intent(this, DetailActivity::[Link]).
○ Implicit Intent: Used to request an action from any application on the device
that can handle it. The system resolves the intent by matching it against the
Intent Filters declared by other apps in their manifest files. Example: Creating
an intent with ACTION_VIEW and a URL Uri to open a web page in a browser,
or ACTION_SEND to share content.30
37. What is an IntentFilter?
● Concise Answer: An IntentFilter is an expression in an app's [Link]
file that specifies the type of intents that a component (like an Activity, Service, or
Broadcast Receiver) is able to receive.
● Deeper Dive: When an implicit intent is sent, the Android system searches all app
manifests for an IntentFilter that matches the intent's action, data (URI type), and
category. If a match is found, the system starts that component and delivers the
Intent object to it. This mechanism is what allows your app to respond to requests
from other apps, for example, to open a specific type of file or handle a custom
URL scheme.30
38. What are the three types of Android Services and their use cases?
● Concise Answer: The three types are Foreground, Background, and Bound
services. Foreground services are for tasks the user is actively aware of, like music
playback. Background services are for deferrable work when the app isn't visible.
Bound services provide a client-server interface for components to interact with
the service.
● Deeper Dive:
○ Foreground Service: Performs an operation that is noticeable to the user. It
must display a persistent notification in the status bar. This type of service
continues to run even when the user isn't directly interacting with the app.
Use cases include a music player app, a fitness tracking app recording a
workout, or a file download manager.32
○ Background Service: Performs an operation that isn't directly noticed by the
user. These services have restrictions, especially on modern Android versions,
and are intended for work that can be deferred. For most background tasks,
modern solutions like WorkManager are now recommended. A classic use
case would be syncing data periodically.32
○ Bound Service: Offers a client-server interface that allows components (like
Activities) to bind to the service, send requests, get results, and even do so
across processes with Inter-Process Communication (IPC). The service runs
only as long as another application component is bound to it. A use case is a
real-time data provider that an Activity connects to for live updates.32
39. What is the difference between startService() and bindService()?
● Concise Answer: startService() starts a service that runs indefinitely in the
background, even if the component that started it is destroyed. bindService()
creates a connection to a service, which only runs as long as the client
component is bound to it. startService() is for "fire and forget" operations, while
bindService() is for interactive, client-server style communication.
● Deeper Dive: A service can be both started and bound. When a service is started
with startService(), it has a lifecycle independent of the component that started
it; it must explicitly stop itself with stopSelf() or be stopped by another
component calling stopService(). When a service is started with bindService(), the
system calls its onBind() method, which returns an IBinder for interaction. The
service is destroyed when all clients unbind from it. startService() triggers the
onStartCommand() lifecycle method, whereas bindService() triggers onBind().39
40. What is a BroadcastReceiver?
● Concise Answer: A BroadcastReceiver is an application component that allows
you to register for and respond to system-wide or application-specific broadcast
messages (Intents).
● Deeper Dive: Broadcasts are messages sent by the system or other apps when
an event of interest occurs, such as the battery level being low, the screen turning
on, or a picture being captured.33 A
BroadcastReceiver is a dormant component that is activated by the system when
a matching intent is broadcast. It's a powerful way to make your app reactive to
the device's state, but its use is restricted in modern Android versions to conserve
battery, especially for receivers declared in the manifest.41
41. What is the difference between a static and a dynamic BroadcastReceiver?
● Concise Answer: A static receiver is declared in the [Link] and can
receive broadcasts even when the app is not running. A dynamic receiver is
registered in code using registerReceiver() and is tied to the lifecycle of the
component that registered it, only receiving broadcasts while that component is
active.
● Deeper Dive:
○ Static Registration (Manifest-declared): Best for system-level broadcasts
that the app must respond to regardless of its state, like BOOT_COMPLETED.
However, since Android 8.0 (API 26), most implicit broadcasts can no longer
be registered statically to prevent apps from draining the battery by waking up
too often.40
○ Dynamic Registration (Context-registered): Best for broadcasts that are
only relevant while the app is in the foreground, such as listening for
connectivity changes to update the UI. It's crucial to unregister the receiver
(e.g., in onPause() or onDestroy()) to prevent memory leaks.40
42. What is ANR? How can you prevent it?
● Concise Answer: ANR stands for "Application Not Responding." It's a dialog
shown by the system when the application's main UI thread has been blocked for
too long (typically 5 seconds) and cannot process user input. To prevent ANRs,
you must perform all long-running operations, like network requests or database
access, on a background thread.
● Deeper Dive: The main thread, or UI thread, is responsible for handling all user
interaction and drawing the UI. If you perform a slow operation on this thread, the
app will freeze, leading to a poor user experience and eventually an ANR dialog.
The primary way to prevent ANRs is to ensure the main thread is never blocked.
Modern solutions for this include:
○ Kotlin Coroutines: The recommended way to manage asynchronous
operations in modern Android.
○ RxJava: A powerful library for reactive programming.
○ Traditional Threads/Executors: Using Java's built-in threading mechanisms.
43. What is the [Link] file?
● Concise Answer: The [Link] file is a required file at the root of the
project source set. It describes essential information about the application to the
Android build tools, the Android operating system, and Google Play.
● Deeper Dive: The manifest file is the control center of the app. It declares 24:
○ The app's package name, which serves as a unique identifier.
○ The application components (Activities, Services, Broadcast Receivers,
Content Providers).
○ The permissions the app requires, such as INTERNET or
ACCESS_FINE_LOCATION.
○ The hardware and software features the app requires, which can be used to
filter the app on Google Play.
○ Intent Filters, which declare the capabilities of the app's components.
44. What is the difference between px, dp, and sp?
● Concise Answer: px (pixels) are absolute pixels on the screen. dp
(density-independent pixels) is an abstract unit that scales with screen density,
ensuring UI elements appear the same physical size on different screens. sp
(scale-independent pixels) is similar to dp but also scales based on the user's
font size preference in the system settings.
● Deeper Dive:
○ px: Should almost never be used for layout dimensions, as a 100px wide
button will look tiny on a high-density screen and huge on a low-density one.
○ dp (or dip): This is the standard unit for layout dimensions. Android converts
dp values to the appropriate number of pixels at runtime based on the
screen's density (e.g., mdpi, hdpi, xhdpi). This ensures consistent physical size
across devices.
○ sp: This is the standard unit for font sizes. It provides consistency like dp but
also respects the user's accessibility settings, making the app more
user-friendly.
45. What is the Dalvik Virtual Machine (DVM)?
● Concise Answer: Dalvik was the virtual machine used by Android until version
4.4. It was an interpreter that executed files in the Dalvik Executable (.dex) format,
which were optimized for mobile devices with limited memory and battery life.
● Deeper Dive: DVM was a Just-In-Time (JIT) compiler, meaning it compiled
bytecode into native machine code every time the app was launched. This was
less efficient than the modern alternative, ART. DVM was designed to run multiple
VM instances efficiently on a single device, which was crucial for multitasking on
early Android versions.30
46. What is ART, and how is it different from DVM?
● Concise Answer: ART, or Android Runtime, replaced DVM as the standard virtual
machine in Android 5.0. The main difference is that ART uses Ahead-Of-Time
(AOT) compilation, compiling the app's bytecode into native machine code at the
time of installation, not every time the app is run.
● Deeper Dive: The AOT compilation in ART leads to significant performance
improvements.30
○ Faster App Execution: Since the code is already native, apps launch and run
faster.
○ Improved Battery Life: The CPU does less work during app execution, which
conserves battery.
○ Slower Installation Time: The AOT compilation step makes the initial app
installation take longer.
○ Larger App Size: The pre-compiled native code (OAT file) takes up more
storage space than the .dex file used by DVM.
Overall, the trade-offs made by ART are considered highly beneficial for the
end-user experience.
47. What is a Bundle in Android?
● Concise Answer: A Bundle is a data structure used for passing data between
Android components. It maps String keys to various primitive and parcelable data
types.
● Deeper Dive: Bundle is most commonly used to pass data between Activities via
Intents (using [Link]()) and to save and restore UI state during
configuration changes (in onSaveInstanceState()). It's optimized for the
lightweight Inter-Process Communication (IPC) that Android uses. It can hold
primitives, Strings, and objects that implement the Parcelable or Serializable
interfaces.33
48. What is the difference between Serializable and Parcelable?
● Concise Answer: Both are interfaces that allow objects to be passed between
components. Parcelable is an Android-specific interface that is much faster and
more efficient than Java's standard Serializable interface. For Android
development, Parcelable is almost always the better choice.
● Deeper Dive: Serializable uses reflection, which is a slow process, to serialize an
object into a stream of bytes. It's easy to implement (just add implements
Serializable), but it creates a lot of temporary objects and is not performant.
Parcelable requires you to manually write the code to serialize (or "marshall") the
object's fields. This is more boilerplate code, but it avoids reflection and is
significantly faster. In Kotlin, the @Parcelize annotation can automatically
generate the Parcelable implementation for data classes, making it just as easy to
use as Serializable while retaining the performance benefits.
49. What is the Android Application Architecture?
● Concise Answer: The Android architecture is a software stack composed of
several layers. From the bottom up, they are: the Linux Kernel, the Hardware
Abstraction Layer (HAL), Android Runtime (ART) and native C/C++ libraries, the
Java API Framework, and finally the System Apps layer.
● Deeper Dive:
○ Linux Kernel: At the base, the Linux kernel handles core system services like
memory management, process management, networking, and device
drivers.24
○ HAL: The Hardware Abstraction Layer provides a standard interface that
exposes device hardware capabilities to the higher-level Java API framework.
○ Android Runtime (ART) & Native Libraries: This layer includes ART for
running app code and a set of native C/C++ libraries for core functionalities
like SQLite (for databases), OpenGL|ES (for graphics), and WebKit (for web
rendering).24
○ Java API Framework: This layer provides the high-level APIs that developers
use to build apps. It includes the building blocks like the Activity Manager,
View System, and Content Providers.24
○ System Apps: The top layer consists of the core applications that ship with
the device, such as the Phone, Contacts, and Browser, which developers can
also access via intents.
50. What is a Toast?
● Concise Answer: A Toast is a small pop-up message that appears on the screen
for a short period of time to provide simple feedback to the user. It automatically
fades in and out and does not block user interaction.
● Deeper Dive: Toasts are created and shown using the static [Link]()
method, which takes a Context, the message text, and the duration
(Toast.LENGTH_SHORT or Toast.LENGTH_LONG) as parameters. It's useful for
providing quick, non-intrusive notifications, like "Message sent" or "Profile
saved".30 For more complex notifications that require user interaction, a
Snackbar or a Dialog would be more appropriate.
51. What is a Thread and why is it important in Android?
● Concise Answer: A Thread is a single sequential flow of control within a program.
In Android, it's crucial because all UI operations must happen on a single,
dedicated "main thread." Any long-running operations must be moved to a
separate "background thread" to avoid blocking the UI and causing ANRs.
● Deeper Dive: The single-threaded UI model in Android simplifies UI
programming, as you don't have to worry about synchronization issues when
updating views. However, this rule—never block the main thread—is the most
important performance principle in Android. Any task that might take more than a
few milliseconds (like network calls, disk I/O, or complex calculations) must be
executed asynchronously on a background thread.
52. What is ProGuard / R8?
● Concise Answer: R8 (which has replaced ProGuard as the default) is a tool that
shrinks, obfuscates, and optimizes your application code. It removes unused
classes and methods, shortens the names of remaining classes and fields, and
performs other optimizations to make the final APK smaller and more efficient.
● Deeper Dive:
○ Shrinking (or Tree Shaking): R8 analyzes your code and its dependencies
and removes any code that is not reachable, significantly reducing the size of
the app.
○ Obfuscation: It renames classes, fields, and methods to short, meaningless
names (e.g., a, b, c). This makes the app much harder to reverse-engineer.
○ Optimization: It inspects and rewrites the code to further reduce its size and
improve its performance.
R8 is enabled in the module-level [Link] file for release builds
(minifyEnabled true). You must provide configuration rules to tell R8 which
code to keep (e.g., classes accessed via reflection) to prevent it from being
incorrectly removed.44
53. What is a ContentProvider?
● Concise Answer: A ContentProvider is a component that manages access to a
central repository of data. It acts as an abstraction layer, allowing other
applications to securely query or modify the data, subject to the permissions it
defines.
● Deeper Dive: The primary purpose of a ContentProvider is to enable data sharing
between applications.32 For example, the Android system provides a
ContentProvider for user contacts. Any app with the proper permissions can
query this provider to get a list of contacts. You would implement your own
ContentProvider if you want to expose your app's data to other apps. Interaction
with a ContentProvider is done through a ContentResolver object using a URI that
identifies the data.
54. What is the difference between onPause() and onStop()?
● Concise Answer: onPause() is called when the activity is still partially visible but
has lost focus, like when a transparent dialog appears. onStop() is called when
the activity is completely hidden and no longer visible to the user.
● Deeper Dive: Because onPause() execution is very brief and blocks other
components from displaying, you should not perform CPU-intensive work in it. It's
meant for committing unsaved changes or stopping animations. More intensive
shutdown operations, like releasing resources or saving to a database, should be
done in onStop(), as the UI is no longer visible at this point.34
55. How can you launch an activity for a result?
● Concise Answer: You can use the Activity Result APIs. You register a callback
using registerForActivityResult with a specific contract (like
[Link]). You then launch the activity using
the launcher returned by this registration. The result is delivered back to your
callback.
● Deeper Dive: The older startActivityForResult() and onActivityResult() methods
are now deprecated. The modern approach with registerForActivityResult is
preferred because it is more type-safe and separates the result handling logic
from the activity launching code. It decouples the result callback from the
request code, making the code cleaner and less prone to errors. This API is also
lifecycle-aware, handling the delivery of the result more safely.
56. What are launch modes in Android?
● Concise Answer: Launch modes are attributes in the [Link] that
define how a new instance of an activity should be associated with the current
task when it is launched. The main modes are standard, singleTop, singleTask, and
singleInstance.
● Deeper Dive:
○ standard: This is the default mode. A new instance of the activity is created in
the target task every time there's a new intent.
○ singleTop: If an instance of the activity already exists at the top of the current
task's back stack, the system routes the intent to that instance through a call
to its onNewIntent() method, instead of creating a new instance.
○ singleTask: The system creates the activity at the root of a new task or places
it in an existing task with the same affinity. If an instance of the activity already
exists anywhere in the system, the system routes the intent to that existing
instance through onNewIntent(), clearing all other activities that were on top
of it in its task.
○ singleInstance: Same as singleTask, except that the system doesn't launch
any other activities into the task holding the instance. The activity is always
the single and only member of its task.
57. What is a PendingIntent?
● Concise Answer: A PendingIntent is a token that you give to another application
(e.g., NotificationManager, AlarmManager) which allows that application to
execute a piece of your app's code with your app's permissions at a later time, as
if it were your app making the call.
● Deeper Dive: This is a crucial security mechanism. If you just passed a regular
Intent to another app, it would execute it with its own permissions, which might
not be what you want. A PendingIntent wraps an Intent and grants the foreign app
the right to perform the action specified in the intent on your app's behalf. This is
most commonly used for notifications; when the user taps a notification, the
NotificationManager (part of the system) uses the PendingIntent you provided to
launch an activity in your app.
58. What is ADB?
● Concise Answer: ADB stands for Android Debug Bridge. It's a command-line tool
that lets you communicate with a connected Android device or emulator.
● Deeper Dive: ADB is an essential tool for development and debugging. It has a
client-server architecture. The client runs on your development machine, the
daemon (adbd) runs as a background process on the device/emulator, and a
server manages communication between the two. Common ADB commands
include:
○ adb devices: Lists connected devices.
○ adb install <apk_path>: Installs an APK.
○ adb uninstall <package_name>: Uninstalls an app.
○ adb logcat: Displays the device log.
○ adb shell: Starts a remote shell on the device.
59. What is a Handler in Android?
● Concise Answer: A Handler is a class used to schedule and run code on a
specific thread. It's most commonly used to post actions from a background
thread to be executed on the main UI thread, which is necessary for updating the
UI.
● Deeper Dive: A Handler is associated with a specific thread's Looper and
MessageQueue. When you create a Handler on the main thread, it can receive
Message or Runnable objects from other threads and enqueue them in the main
thread's MessageQueue. The main thread's Looper then processes these
messages one by one, allowing for safe UI updates from background threads.
While Handler is a fundamental concept, modern concurrency patterns like Kotlin
Coroutines with [Link] provide a much simpler and safer way to
achieve the same result.
60. What is StrictMode?
● Concise Answer: StrictMode is a developer tool used to detect accidental,
long-running operations (like disk or network access) on the main thread. When
enabled, it can make the screen flash or log warnings to Logcat when a policy
violation is detected.
● Deeper Dive: StrictMode is a powerful debugging aid for catching performance
problems during development. It doesn't fix the problems, but it makes you aware
of them. You can configure different policies, such as detectDiskReads(),
detectDiskWrites(), and detectNetwork(), and define the penalty, like penaltyLog()
or penaltyDeath() (which crashes the app). It should only ever be enabled in
debug builds, never in a release build.
Chapter 5: UI and Modern Android Development (20 Questions)
This chapter focuses on building user interfaces, contrasting legacy approaches with
the modern declarative paradigm of Jetpack Compose.
61. What is the difference between a View and a ViewGroup?
● Concise Answer: A View is a basic UI building block that draws something on the
screen and handles user events (e.g., Button, TextView). A ViewGroup is a special
type of View that acts as an invisible container to hold and organize other Views
and ViewGroups (e.g., LinearLayout, ConstraintLayout).
● Deeper Dive: The entire UI of an Android app is a hierarchy of View and
ViewGroup objects. The root of this hierarchy is a ViewGroup. A ViewGroup is
responsible for measuring and laying out its children. For example, a LinearLayout
arranges its children in a single row or column, while a ConstraintLayout arranges
them based on constraints to sibling views and the parent layout.30
62. When should you use ConstraintLayout versus LinearLayout?
● Concise Answer: You should prefer ConstraintLayout for complex, non-linear UIs
because it allows you to create a flat view hierarchy, which is better for
performance. LinearLayout is suitable for simple, linear UIs where views are
arranged in a single row or column.
● Deeper Dive: The main advantage of ConstraintLayout is its ability to reduce
nested layouts. A deep view hierarchy with many nested LinearLayouts or
RelativeLayouts can lead to poor performance because the system has to
perform multiple measurement and layout passes to render the screen.45
ConstraintLayout is more powerful and flexible, allowing you to define complex
relationships between widgets without nesting, resulting in a flatter and more
performant UI.45 However, for a very simple list of items in a row, a
LinearLayout can be simpler to write and understand.47
63. What is the main advantage of ConstraintLayout over RelativeLayout?
● Concise Answer: ConstraintLayout is more powerful and generally more
performant than RelativeLayout. It helps create flat view hierarchies and avoids
the performance issues of nested layouts that are often required with
RelativeLayout for complex UIs.
● Deeper Dive: Both layouts allow you to position views relative to each other.
However, RelativeLayout can sometimes require multiple measure/layout passes
to resolve all the view positions, especially in nested scenarios. ConstraintLayout
was designed to solve this. Its advanced constraint-solving engine is more
efficient and can handle complex relationships in a single pass. It also offers more
powerful tools like guidelines, barriers, and chains, which are not available in
RelativeLayout.45
64. What are the main advantages of RecyclerView over ListView?
● Concise Answer: RecyclerView is more efficient and flexible than ListView. Its key
advantages are the mandatory ViewHolder pattern for view recycling, a flexible
LayoutManager that supports vertical, horizontal, and grid layouts, and built-in
support for item animations.
● Deeper Dive: RecyclerView was introduced as a successor to ListView to address
its performance and flexibility limitations.
Feature ListView RecyclerView
Performance Less efficient for long lists as Highly efficient. Recycles
it doesn't enforce view views that scroll off-screen,
recycling properly. saving memory and CPU.
ViewHolder Pattern Recommended for Mandatory. The
performance, but optional and [Link] forces
must be manually the use of the ViewHolder
implemented. pattern.
Layout Manager Only supports vertical Pluggable LayoutManager
scrolling lists. allows for vertical, horizontal,
grid, and staggered grid
layouts.
Item Animator No built-in support for Built-in ItemAnimator API
animations. Animating item makes it easy to animate item
additions/removals is changes.
complex.
Item Decoration Adding dividers or Simple ItemDecoration API
decorations is difficult. allows for custom dividers,
offsets, and more.
Source: 43
65. What is the role of the ViewHolder pattern in RecyclerView?
● Concise Answer: The ViewHolder pattern's role is to cache references to the
views within an item layout. This avoids the expensive findViewById() calls every
time an item is scrolled onto the screen, significantly improving performance.
● Deeper Dive: In a RecyclerView, when a view scrolls off-screen, it is not
destroyed. Instead, it is "recycled" and reused for a new item that is about to
scroll on-screen. The ViewHolder object holds the references to the sub-views
(like TextViews and ImageViews) of that recycled layout. When the Adapter needs
to display new data in that recycled view, it retrieves the ViewHolder and can
directly set the data on the cached views without needing to look them up again
with findViewById(). This recycling and caching mechanism is the core reason for
RecyclerView's high performance.48
66. What is a LayoutManager in RecyclerView?
● Concise Answer: A LayoutManager is responsible for measuring and positioning
item views within a RecyclerView, as well as determining the policy for when to
recycle item views that are no longer visible to the user.
● Deeper Dive: The LayoutManager is what gives RecyclerView its flexibility. Unlike
ListView, which was hardcoded for vertical lists, RecyclerView delegates the
entire layout logic to its LayoutManager. Android provides several pre-built layout
managers 48:
○ LinearLayoutManager: Arranges items in a vertical or horizontal list.
○ GridLayoutManager: Arranges items in a grid.
○ StaggeredGridLayoutManager: Arranges items in a staggered grid, like in
Pinterest.
You can also create your own custom LayoutManager for completely unique
layouts.
67. What is a [Link]?
● Concise Answer: The Adapter is the component that connects the data set (e.g.,
a list of objects) to the RecyclerView. It is responsible for creating ViewHolders
and binding data to them as they are displayed on the screen.
● Deeper Dive: The Adapter has three primary methods you must override:
○ onCreateViewHolder(): Called by the RecyclerView when it needs a new
ViewHolder of a given type to represent an item. This is where you inflate the
item layout and create the ViewHolder.
○ onBindViewHolder(): Called by the RecyclerView to display the data at the
specified position. This method takes the ViewHolder and the position, and
you use this information to fetch the correct data from your data set and
populate the ViewHolder's views.
○ getItemCount(): Returns the total number of items in the data set.
68. What is DiffUtil?
● Concise Answer: DiffUtil is a utility class that can calculate the difference
between two lists and output a list of update operations that converts the first list
into the second one. It's used with a [Link] to efficiently update
the list with minimal changes, enabling nice animations.
● Deeper Dive: When the data in your RecyclerView changes, you could call
notifyDataSetChanged(), but this is inefficient as it redraws the entire list. DiffUtil
provides a better way. It runs on a background thread to compare the old list and
the new list, finds the minimal number of operations (additions, removals, moves,
changes) needed to transform the old list to the new, and then dispatches these
specific updates to the adapter (e.g., notifyItemInserted(), notifyItemRemoved()).
This results in much better performance and enables default item animations for
the changes.49
69. What is Jetpack Compose?
● Concise Answer: Jetpack Compose is Android's modern, declarative UI toolkit
for building native user interfaces. Instead of designing layouts in XML, you
describe your UI by calling composable functions in Kotlin code.
● Deeper Dive: Compose represents a fundamental shift from the traditional
imperative (XML-based) UI model to a declarative one.50
○ Imperative (XML): You create a tree of widgets and then manually update
them later using methods like [Link](). You are responsible for how
to change the UI.
○ Declarative (Compose): You describe what the UI should look like for a given
state. When the state changes, the Compose framework automatically and
intelligently re-executes the relevant parts of your UI code (a process called
recomposition) to reflect the new state. You are responsible for what the UI is,
not how to update it.51
70. What is a @Composable function?
● Concise Answer: A @Composable function is a regular Kotlin function annotated
with @Composable. It's the fundamental building block of a Compose UI. It
describes a piece of your UI and can call other composable functions to build a UI
hierarchy.
● Deeper Dive: The @Composable annotation tells the Compose compiler that this
function is intended to convert data into UI. The compiler adds special support to
these functions, allowing the framework to track their execution, manage their
state, and re-run them when their inputs change (recomposition). Composable
functions must be called from other composable functions. They should be
side-effect-free, idempotent (calling them multiple times with the same input
produces the same UI), and fast.50
71. What is State in Jetpack Compose?
● Concise Answer: In Compose, State is a value holder that, when its value
changes, schedules a "recomposition" of any composable functions that read
that value. It's how you make your UI dynamic and reactive.
● Deeper Dive: You create a State object using delegates like remember {
mutableStateOf(...) }. The mutableStateOf creates an observable MutableState<T>
object. The remember call ensures that this state is preserved across
recompositions. When you update the .value property of this state object,
Compose detects the change and redraws only the composables that depend on
that state, making the UI update process highly efficient.
72. What is the role of Modifier in Compose?
● Concise Answer: A Modifier is an ordered, immutable collection of elements that
decorate or add behavior to a composable. You use modifiers to change a
composable's size, layout, appearance, or add interactions like click handlers.
● Deeper Dive: Modifiers are a powerful and core concept in Compose. They are
passed as arguments to composables and allow for extensive customization.
Because they are standard Kotlin objects, you can chain them together (e.g.,
[Link]([Link]).background([Link])). This is the standard way to
handle styling and layout properties that would have been XML attributes in the
traditional View system. It's a best practice for reusable composables to accept a
Modifier parameter and pass it to their child composable, allowing the caller to
customize them.
73. What is "recomposition" in Compose?
● Concise Answer: Recomposition is the process of Compose re-running your
composable functions when their input state changes. This is how Compose
updates the UI to reflect the new state.
● Deeper Dive: Compose is intelligent about recomposition. It doesn't re-run all
your composables every time one piece of state changes. It only re-runs the
specific composables that read the State object that was modified. This makes
the process very efficient. To ensure this works correctly, your composable
functions should be "skippable"—meaning if their inputs haven't changed,
Compose can skip re-executing them entirely.
74. What is the difference between a Column and a Row in Compose?
● Concise Answer: Column and Row are standard layout composables. Column
arranges its children in a vertical sequence, one below the other. Row arranges its
children in a horizontal sequence, one next to the other.
● Deeper Dive: These are the direct declarative equivalents of a LinearLayout with
a vertical or horizontal orientation, respectively. They take a modifier parameter
for styling and arrangement/alignment parameters to control how their children
are positioned within them (e.g., verticalArrangement for a Column,
horizontalArrangement for a Row).
75. How do you handle user clicks in Compose?
● Concise Answer: You use the clickable modifier. For example, you can add
[Link] { /* action to perform on click */ } to any composable to make it
respond to user taps.
● Deeper Dive: Many built-in Material Design composables, like Button or Card,
have a dedicated onClick lambda parameter that is the idiomatic way to handle
clicks for those components. For more general-purpose composables like Text or
Box, the clickable modifier is the standard approach. This modifier provides not
only the click listener but also accessibility semantics and ripple effects to
indicate the clickable area.
76. What is a Surface in Compose?
● Concise Answer: A Surface is a Material Design concept that represents a piece
of "material" on which other composables are drawn. It's primarily used to control
the background color, elevation (for shadows), and shape of a UI element.
● Deeper Dive: Surface is a core building block for creating UIs that follow Material
Design principles. It's the composable you would use to create cards, sheets, or
the main background of your screen. It draws from the app's MaterialTheme to
get its default colors and shapes, ensuring a consistent look and feel throughout
the app.50
77. How does theming work in Jetpack Compose?
● Concise Answer: Theming in Compose is handled by the MaterialTheme
composable. It provides styling information—colors, typography, and
shapes—down the composable tree. You can access these theme values in any
child composable to ensure a consistent design.
● Deeper Dive: When you create a new Compose project, a [Link] file is
generated with definitions for your app's color palette (e.g., primary, secondary,
background), typography styles (e.g., h1, body1), and shape schemes. The
MaterialTheme composable reads these definitions and makes them available via
the MaterialTheme object (e.g., [Link],
[Link]). This system makes it easy to implement
features like a dark theme by simply providing a different set of colors.51
78. What is XML and why is it used for layouts in traditional Android
development?
● Concise Answer: XML stands for Extensible Markup Language. It's a markup
language used to describe data. In traditional Android, it's used to define the UI
layout because it provides a human-readable, structured way to declare the
hierarchy of UI widgets and their attributes, separating the UI's structure from the
application's logic.
● Deeper Dive: Android uses XML for UI development for several reasons 30:
○ Separation of Concerns: It separates the presentation layer (the layout) from
the application logic (the Kotlin/Java code), which makes the code cleaner
and easier to maintain.
○ Readability: The hierarchical structure of XML is a natural fit for representing
a tree of UI views.
○ Tooling Support: Android Studio provides a powerful visual Layout Editor that
reads and writes XML, allowing for drag-and-drop UI design.
○ Flexibility: XML supports nested layouts, making it possible to design
complex UIs.
79. What is a Drawable in Android?
● Concise Answer: A Drawable is a general abstraction for "something that can be
drawn." It can be a bitmap image (like a PNG or JPG), a solid color, a shape
defined in XML, or a complex state list that changes its appearance based on the
view's state (e.g., pressed, focused).
● Deeper Dive: Drawables are a versatile resource type. They are commonly used
for backgrounds of views, icons on buttons, or images in an ImageView. Using
XML drawables (like ShapeDrawable or StateListDrawable) is often more efficient
than using bitmap images, as they are rendered at runtime and can scale without
losing quality, resulting in a smaller APK size.
80. How do you support different screen sizes and densities?
● Concise Answer: You support different screen sizes and densities by using
density-independent pixels (dp) for layouts, scale-independent pixels (sp) for
text, and providing alternative resources (layouts and drawables) in specifically
named resource directories.
● Deeper Dive: The Android resource system is designed to handle this.
○ For Densities: Provide different versions of your bitmap drawables in
density-specific folders (e.g., drawable-mdpi, drawable-hdpi,
drawable-xxhdpi). The system will automatically pick the correct one at
runtime.
○ For Screen Sizes/Layouts: You can provide different layout files for different
screen sizes or aspect ratios in folders like layout-sw600dp (for tablets) or
layout-land (for landscape orientation).
○ Flexible Layouts: Use ConstraintLayout to create adaptive UIs that can
stretch and rearrange themselves gracefully on different screen sizes. Avoid
hardcoding dimensions whenever possible.
Chapter 6: Architecture, Data, and Networking (20 Questions)
This final technical chapter assesses the candidate's understanding of how to build
robust, maintainable, and scalable Android applications.
81. What is MVVM and why is it a popular architecture pattern for Android?
● Concise Answer: MVVM stands for Model-View-ViewModel. It's an architectural
pattern that separates the UI (View) from the business logic and data (Model)
using a ViewModel. It's popular for Android because it works very well with
lifecycle-aware components like LiveData and ViewModel from Jetpack, helping
to solve common problems like surviving configuration changes.
● Deeper Dive:
○ Model: Represents the data and business logic of the application (e.g.,
fetching data from a network or database). It is completely independent of the
UI.
○ View: The UI layer (Activity or Fragment). Its only job is to observe the
ViewModel for data changes and display them. It forwards user events to the
ViewModel but contains no business logic itself.
○ ViewModel: Acts as a bridge between the Model and the View. It holds and
prepares UI-related data for the View. It exposes this data through observable
streams (like LiveData or StateFlow). The ViewModel knows nothing about the
View, which makes it highly testable and reusable.30 This separation makes the
code cleaner, more modular, and easier to maintain and test compared to
older patterns like MVC or MVP.52
82. What are the key benefits of using ViewModel from the Jetpack library?
● Concise Answer: The primary benefit of the Jetpack ViewModel is that it is
lifecycle-aware and survives configuration changes. This means it can hold
UI-related data without it being lost when an activity is destroyed and recreated,
for example, during a screen rotation.
● Deeper Dive: Using a ViewModel provides several advantages 37:
○ Persistence: It automatically retains its state during configuration changes,
preventing the need to re-fetch data from a network or database. This is its
most significant benefit.37
○ Lifecycle Scoping: A ViewModel is scoped to a lifecycle owner (like an
Activity or Fragment) and is only destroyed when that owner is permanently
gone (e.g., the activity finishes), not just recreated.
○ Separation of Concerns: It separates data-holding and preparation logic
from the UI controller (Activity/Fragment), leading to cleaner, more testable
code. The UI controller is only responsible for displaying data and forwarding
user events.
○ Data Sharing: A ViewModel can be scoped to a navigation graph or an
activity, allowing it to be easily shared between multiple fragments.
83. What is LiveData and what are its advantages?
● Concise Answer: LiveData is a lifecycle-aware, observable data holder class. Its
main advantages are that it automatically updates the UI when data changes, and
because it's lifecycle-aware, it only updates observers when they are in an active
state, preventing memory leaks and crashes.
● Deeper Dive: LiveData is a cornerstone of modern Android architecture 54:
○ Lifecycle-Awareness: LiveData knows the lifecycle state of its observers
(Activities/Fragments). It will only push updates to them if they are in an active
state (STARTED or RESUMED). It automatically cleans up its observers when
their lifecycle is destroyed, preventing memory leaks.55
○ No Manual Lifecycle Handling: Developers don't need to manually check if
the view is available before updating it, which simplifies the code and
eliminates a common source of NullPointerExceptions.
○ Automatic UI Updates: It follows the observer pattern. The UI observes the
LiveData in the ViewModel, and whenever the data changes, the observer's
onChanged() method is triggered, where the UI can be updated.
○ Proper Configuration Change Handling: When an activity is recreated, it
immediately receives the last known value from the LiveData object, ensuring
the UI is restored to its previous state instantly.54
84. What is the difference between LiveData and MutableLiveData?
● Concise Answer: LiveData is immutable (read-only). MutableLiveData is a
subclass of LiveData that is mutable, meaning you can change its value using the
setValue() (on the main thread) or postValue() (on a background thread)
methods.
● Deeper Dive: The common pattern in MVVM is to use a MutableLiveData inside
the ViewModel as a private field. This allows the ViewModel to update the data.
The ViewModel then exposes this data to the View (Activity/Fragment) as a public,
immutable LiveData object. This prevents the View from being able to modify the
data directly, enforcing a clean, unidirectional data flow and ensuring that only
the ViewModel is responsible for state changes.53
85. What is Room? What are its main components?
● Concise Answer: Room is a persistence library from Jetpack that provides an
abstraction layer over SQLite to allow for more robust database access. Its three
main components are the Database class, the Entity, and the DAO (Data Access
Object).
● Deeper Dive: Room is the recommended way to handle local data storage in
Android.56
○ Entity: A class annotated with @Entity that represents a table in the
database. Each instance of the entity represents a row in the table, and its
fields represent the columns.57
○ DAO (Data Access Object): An interface annotated with @Dao. This is where
you define your database operations (queries, inserts, updates, deletes) using
annotations like @Query, @Insert, @Update, and @Delete. Room generates
the implementation for you at compile time.57
○ Database: An abstract class that extends RoomDatabase and is annotated
with @Database. It serves as the main access point to the database, lists all
the entities, and provides access to the DAOs.56
86. Why is Room preferred over using raw SQLite APIs?
● Concise Answer: Room is preferred because it provides compile-time
verification of SQL queries, which prevents runtime crashes due to SQL errors. It
also reduces a significant amount of boilerplate code with its use of annotations.
● Deeper Dive: While SQLite is powerful, using the SQLiteOpenHelper APIs directly
is verbose and error-prone. Room solves these problems 56:
○ Compile-Time Safety: Room validates all your SQL queries written in the DAO
at compile time. If there's a syntax error in your query, your app won't even
build, saving you from runtime crashes.
○ Boilerplate Reduction: Room handles the conversion of database query
results into your Kotlin/Java data objects automatically. You don't need to
manually iterate through Cursor objects.
○ Integration with Architecture Components: Room integrates seamlessly
with LiveData and Flow, allowing you to create observable queries that
automatically update the UI when the underlying data changes.
○ Migration Handling: Room provides a much simpler and more robust
mechanism for handling database schema migrations as your app evolves.
87. When would you use SharedPreferences versus a Room database?
● Concise Answer: You should use SharedPreferences for storing small amounts of
simple key-value data, like user settings or flags. You should use a Room database
for storing large amounts of structured, relational data that you need to query,
such as a list of user contacts or cached articles.
● Deeper Dive: This table provides a clear decision framework:
Feature SharedPreferences Room Database
Data Type Simple key-value pairs Complex, structured,
(booleans, strings, integers). relational data.
Use Case User preferences, settings, Caching large datasets,
simple flags. managing complex objects,
data that needs to be queried
or sorted.
API Simple get/put API. Powerful SQL-based query
API via DAO.
Example Storing a "dark mode" setting. Storing a list of to-do items
with due dates and priorities.
Source: 58
88. How do you use SharedPreferences to save and retrieve a simple value?
● Concise Answer: To save a value, you get a SharedPreferences instance, get its
Editor, use a put method (e.g., putBoolean), and then call apply(). To retrieve it,
you get the SharedPreferences instance and use a get method (e.g., getBoolean),
providing a key and a default value.
● Deeper Dive:
○ Saving Data:
1. val prefs = getSharedPreferences("my_app_prefs",
Context.MODE_PRIVATE)
2. val editor = [Link]()
3. [Link]("is_dark_mode_enabled", true)
4. [Link]() // apply() is asynchronous and preferred over the
synchronous commit().
○ Retrieving Data:
1. val prefs = getSharedPreferences("my_app_prefs",
Context.MODE_PRIVATE)
2. val isDarkMode = [Link]("is_dark_mode_enabled", false) // The
second parameter is the default value if the key is not found.
Source: 58
89. What is Retrofit and what is it used for?
● Concise Answer: Retrofit is a type-safe HTTP client for Android and Java,
developed by Square. It is used to simplify the process of making network
requests to a REST API by turning the API into a Kotlin/Java interface.
● Deeper Dive: Retrofit makes it easy to consume JSON or other structured data
from a web service and parse it into Plain Old Java Objects (POJOs) or Kotlin data
classes.60 It uses annotations to describe the HTTP requests (e.g.,
@GET, @POST, @Path, @Query). It can be configured with different converters
(like GsonConverterFactory for JSON) to handle data serialization and
deserialization automatically. This makes networking code much cleaner, more
organized, and less error-prone than using lower-level APIs like
HttpURLConnection.61
90. What are the key steps to implement Retrofit for network requests?
● Concise Answer: The key steps are: 1) Add Retrofit and a converter (like Gson)
dependencies to Gradle. 2) Create a data class to model the API response. 3)
Create an interface where you define the API endpoints using annotations. 4)
Build a Retrofit instance with the base URL and converter. 5) Use the Retrofit
instance to create an implementation of your API interface and make the network
call.
● Deeper Dive:
1. Add Dependencies: In [Link], add implementation
'[Link].retrofit2:retrofit:...' and implementation
'[Link].retrofit2:converter-gson:...'.60
2. Add Internet Permission: Add <uses-permission
android:name="[Link]"/> to [Link].60
3. Create Model Class: data class User(val id: Int, val name: String)
4. Create API Interface:
Kotlin
interface ApiService {
@GET("users/{id}")
fun getUser(@Path("id") userId: Int): Call<User>
}
5. Build Retrofit Instance:
Kotlin
val retrofit = [Link]()
.baseUrl("[Link]
.addConverterFactory([Link]())
.build()
6. Make the Call:
Kotlin
val apiService = [Link](ApiService::[Link])
val call = [Link](1)
[Link](...) // Use enqueue for asynchronous calls
Source: 60
91. What is the purpose of the Android Navigation Component?
● Concise Answer: The Navigation Component is a Jetpack library that simplifies
the implementation of navigation in an Android app. It provides a visual editor to
define navigation paths (the "navigation graph") and handles fragment
transactions, up/back button behavior, and passing arguments between
destinations.
● Deeper Dive: The Navigation Component aims to provide a single, consistent
framework for in-app navigation.62 Its benefits include:
○ Visual Graph: A single XML file defines all navigation paths, making it easy to
visualize and manage the app's flow.
○ Fragment Transactions: It handles all the complexity of FragmentManager
and FragmentTransactions for you.
○ Type-Safe Arguments: It uses a plugin to generate type-safe classes for
passing data between destinations, preventing runtime errors.
○ Deep Linking: It simplifies the creation and handling of deep links that take
users directly to a specific screen.
○ Animations: Provides a simple way to define custom animations for
transitions between screens.
○ Standardized Up/Back Navigation: It ensures that the "Up" button in the
app bar and the system "Back" button behave consistently and predictably.
92. Explain Kotlin's null safety features.
● Concise Answer: Kotlin's type system is designed to eliminate
NullPointerExceptions. It distinguishes between non-nullable types (which cannot
hold null) and nullable types (declared with a ?). It provides special operators like
the safe call (?.), the Elvis operator (?:), and the not-null assertion (!!) to handle
nullable values safely.
● Deeper Dive:
○ Nullable (?) vs. Non-Nullable Types: By default, variables in Kotlin are
non-nullable. var name: String = "Test" cannot be assigned null. To allow nulls,
you must declare the type as nullable: var name: String? = "Test". The
compiler will then force you to handle the potential null case.63
○ Safe Call Operator (?.): This lets you call a method or access a property on a
nullable object safely. If the object is not null, the call proceeds. If it is null, the
expression evaluates to null without throwing an exception. Example:
name?.length.
○ Elvis Operator (?:): This provides a default value when a nullable expression
is null. Example: val length = name?.length?: 0. If name is null, length will be 0.
○ Not-Null Assertion Operator (!!): This operator converts any value to a non-null
type and throws a NullPointerException if the value is null. It should be used
with extreme caution, only when you are 100% certain the value will not be
null. Example: name!!.length.
Source: 63
93. What are coroutines in Kotlin and why are they useful for Android
development?
● Concise Answer: Coroutines are a Kotlin feature for writing asynchronous code
in a sequential, non-blocking way. They are like lightweight threads. They are
useful in Android because they simplify background work, preventing ANRs by
making it easy to move long-running tasks off the main thread without the
complexity of traditional threading or callbacks.
● Deeper Dive: Android applications are single-threaded by default, and blocking
the main thread leads to a frozen UI and ANRs. Coroutines solve this problem
elegantly.63 They allow you to write asynchronous code that looks synchronous.
For example, you can launch a coroutine to make a network request,
suspend its execution while waiting for the response without blocking any
threads, and then resume it on the main thread to update the UI once the data is
available. This avoids "callback hell" and makes asynchronous logic much easier
to read, write, and reason about.63
94. What is a suspend function in Kotlin?
● Concise Answer: A suspend function is a function that can be paused and
resumed at a later time. They are the building blocks of coroutines. A suspend
function can only be called from another suspend function or from within a
coroutine builder like launch or async.
● Deeper Dive: The suspend keyword is a marker for the compiler. It doesn't cause
the function to run on a background thread by itself. It simply gives the function
the ability to call other suspend functions (like delay() or network calls from
libraries like Ktor or Retrofit). The actual thread on which the code runs is
determined by the CoroutineDispatcher (e.g., [Link] for I/O operations,
[Link] for UI updates) provided when the coroutine is launched.
95. What is the difference between launch and async in Kotlin Coroutines?
● Concise Answer: Both launch and async are coroutine builders. launch is used
for "fire and forget" tasks that don't return a result. async is used when you need
to perform a task that returns a result, which you can then retrieve later by calling
.await() on the Deferred object it returns.
● Deeper Dive:
○ launch: Returns a Job object, which represents the coroutine. You can use
this Job to cancel the coroutine or wait for it to complete ([Link]()), but it
doesn't carry a return value. It's suitable for tasks like updating a database or
sending a log to a server.63
○ async: Returns a Deferred<T> object, which is a type of Job that also holds a
future result of type T. You call await() on the Deferred object to get the result.
await() is a suspend function, so it will pause the coroutine until the result is
ready. async is ideal for performing multiple independent background tasks in
parallel and then combining their results.
96. What are Kotlin data classes?
● Concise Answer: A data class is a class in Kotlin declared with the data keyword.
The compiler automatically generates useful standard methods for it, such as
equals(), hashCode(), toString(), and copy().
● Deeper Dive: Data classes are designed for classes whose primary purpose is to
hold data. By simply adding the data keyword, you get a lot of functionality for
free that you would have to write manually in Java.63 This makes them perfect for
creating model classes for API responses (like with Retrofit) or for representing
entities in a Room database. The
copy() method is particularly useful for creating a new instance of the class with
some properties modified, which is a common pattern in functional programming
and for updating state in Compose.
97. What is the difference between val and var in Kotlin?
● Concise Answer: val is used to declare an immutable (read-only) variable, similar
to final in Java. Once a value is assigned to a val, it cannot be changed. var is
used to declare a mutable (read-write) variable, whose value can be reassigned.
● Deeper Dive: It is a best practice in Kotlin to prefer val over var whenever
possible.63 Using immutable variables makes the code safer and easier to reason
about, as you can be sure that the variable's state won't change unexpectedly
after it's initialized. This is a core principle of functional programming and helps to
reduce bugs.
98. What are extension functions in Kotlin?
● Concise Answer: An extension function is a feature that allows you to add new
functions to an existing class without having to inherit from it or modify its source
code.
● Deeper Dive: Extension functions are a powerful tool for making your code more
readable and concise. For example, you could add a function to the String class
to validate if it's a valid email address. You declare it by prefixing the function
name with the type you are extending (e.g., fun [Link](): Boolean {...
}). You can then call this new function on any String instance as if it were a
member of the class ("test@[Link]".isValidEmail()). The Android KTX
libraries make extensive use of extension functions to add helpful, idiomatic Kotlin
APIs to existing Android framework classes.63
99. What are higher-order functions in Kotlin?
● Concise Answer: A higher-order function is a function that takes another
function as a parameter, returns a function, or both.
● Deeper Dive: Kotlin treats functions as first-class citizens, meaning they can be
stored in variables, passed as arguments, and returned from other functions. This
enables powerful programming patterns. A common example in Android is setting
a click listener: [Link] { /* this is a lambda, a function passed
as an argument */ }. Here, setOnClickListener is a higher-order function because
it takes a function (the lambda) as its parameter. This makes the code more
concise and expressive compared to using anonymous inner classes in Java.
100. What is the role of [Link] files in an Android project?
● Concise Answer: [Link] files are scripts used by the Gradle build system to
define how the application is built. The project-level file configures settings for all
modules, while the module-level file specifies dependencies, SDK versions, and
build configurations for a specific app or library module.
● Deeper Dive: Gradle is the build automation tool that compiles your source code,
packages resources, and generates the final APK or AAB file.42
○ Project-level [Link]: Defines repositories (like google() and
mavenCentral()) where dependencies are located and configures build-wide
plugins.44
○ Module-level [Link] (e.g., app/[Link]): This is where most of
the configuration happens. It includes the applicationId, minSdk, targetSdk,
versionCode, and versionName. The dependencies block is where you add
libraries like Retrofit, Room, or Compose. The buildTypes block allows you to
configure different settings for debug and release builds, such as enabling
code shrinking with R8.44
Part III: The Android Developer Intern MCQ Challenge
Chapter 7: 100 Multiple-Choice Questions with Answers & Explanations
This chapter provides a series of 100 multiple-choice questions designed to test and
reinforce the technical concepts covered in Part II. Each question is followed by the
correct answer and a brief explanation.
1. Which component is considered the entry point for user interaction in an Android
app?
A) Service
B) Activity
C) BroadcastReceiver
D) ContentProvider
Answer: B) Activity. Explanation: An Activity provides the window in which the app
draws its UI, representing a single screen the user can interact with.31
2. Which Activity lifecycle method is called only once when the activity is first
created?
A) onStart()
B) onResume()
C) onCreate()
D) onRestart()
Answer: C) onCreate(). Explanation: onCreate() is where you should perform all
basic application startup logic that should happen only once for the entire life of
the activity.35
3. To save a small amount of UI state during a configuration change like screen
rotation, which method should you override?
A) onPause()
B) onDestroy()
C) onSaveInstanceState()
D) onStop()
Answer: C) onSaveInstanceState(). Explanation: onSaveInstanceState() is called
by the system before an activity is killed, allowing you to save transient state in a
Bundle that is passed to the new instance's onCreate().34
4. A Fragment's lifecycle is directly tied to the lifecycle of its host _____.
A) Service
B) Application
C) View
D) Activity
Answer: D) Activity. Explanation: A Fragment cannot exist on its own and its
lifecycle callbacks are triggered in response to the lifecycle changes of its host
Activity.31
5. Which Intent type is used to start a specific component by its class name?
A) Implicit Intent
B) Explicit Intent
C) Pending Intent
D) Broadcast Intent
Answer: B) Explicit Intent. Explanation: An explicit intent is used for internal app
navigation when you know the exact class of the component you want to start.33
6. Which Android component is best suited for performing a long-running task like
downloading a large file in the background?
A) Activity
B) Thread
C) Service
D) AsyncTask
Answer: C) Service. Explanation: A Service is an application component designed
for long-running operations in the background, independent of the UI.39
7. What must a Foreground Service display to the user?
A) A Toast message
B) A Dialog
C) A persistent Notification
D) Nothing, it's in the foreground
Answer: C) A persistent Notification. Explanation: A Foreground Service must
provide a non-dismissible notification in the status bar to make the user aware of
the ongoing task.32
8. To receive a system broadcast like ACTION_BOOT_COMPLETED even when your
app is not running, you should use a:
A) Dynamic BroadcastReceiver
B) Local BroadcastReceiver
C) Static BroadcastReceiver
D) Bound Service
Answer: C) Static BroadcastReceiver. Explanation: A static receiver, declared in
the manifest, can be invoked by the system to handle broadcasts even if the app
process is not currently running.40
9. What does ANR stand for in Android?
A) Application Not Registered
B) Android Native Runtime
C) Application Not Responding
D) Active Network Request
Answer: C) Application Not Responding. Explanation: An ANR dialog is shown
when the main UI thread is blocked for too long and cannot process user input
events.
10.What is the primary purpose of the [Link] file?
A) To define the UI layout
B) To store user preferences
C) To declare the app's components and permissions to the system
D) To write Kotlin business logic
Answer: C) To declare the app's components and permissions to the system.
Explanation: The manifest file is essential for the Android system to understand
the app's structure, capabilities, and requirements.24
11. Which unit of measurement should be used for defining font sizes to respect the
user's accessibility settings?
A) px (pixels)
B) dp (density-independent pixels)
C) in (inches)
D) sp (scale-independent pixels)
Answer: D) sp. Explanation: sp scales with both screen density and the user's
preferred font size setting, making it ideal for text.
12.The modern Android Runtime (ART) uses which type of compilation?
A) Just-In-Time (JIT)
B) Ahead-Of-Time (AOT)
C) Both JIT and AOT
D) Interpretive Compilation
Answer: C) Both JIT and AOT. Explanation: While ART's primary feature is AOT
compilation at install time, modern versions also use JIT and profile-guided
compilation to further optimize performance after installation. For an intern,
knowing AOT is the key differentiator from Dalvik.30
13.Which interface should you implement for custom objects to be passed efficiently
between Android components?
A) Serializable
B) Parcelable
C) Cloneable
D) Readable
Answer: B) Parcelable. Explanation: Parcelable is an Android-specific interface
that is significantly faster and more memory-efficient than Java's Serializable
because it avoids using reflection.
14.Which tool is used to detect accidental disk or network access on the main thread
during development?
A) Logcat
B) Profiler
C) StrictMode
D) ADB
Answer: C) StrictMode. Explanation: StrictMode is a developer tool that can be
enabled in debug builds to help catch and report violations of thread policies.
15.In the Android architecture stack, which layer is responsible for managing core
system services like processes and memory?
A) Java API Framework
B) Native C/C++ Libraries
C) Linux Kernel
D) System Apps
Answer: C) Linux Kernel. Explanation: The Linux Kernel is the foundation of the
Android stack, handling all the low-level hardware interaction and core system
functions.42
16.What is the primary benefit of using ConstraintLayout?
A) It is the easiest layout to use for beginners.
B) It creates flat view hierarchies, improving performance.
C) It only supports vertical arrangements.
D) It is required for Jetpack Compose.
Answer: B) It creates flat view hierarchies, improving performance. Explanation:
ConstraintLayout allows for the creation of complex layouts without nesting,
which reduces the number of layout passes and improves rendering
performance.45
17.In a RecyclerView, what is the component responsible for creating and binding
views for the data items?
A) LayoutManager
B) ViewHolder
C) Adapter
D) ItemDecorator
Answer: C) Adapter. Explanation: The Adapter connects the data set to the
RecyclerView and manages the creation and data binding of ViewHolders.48
18.The mandatory use of the ViewHolder pattern is a key feature of which
component?
A) ListView
B) GridView
C) ScrollView
D) RecyclerView
Answer: D) RecyclerView. Explanation: RecyclerView enforces the ViewHolder
pattern in its adapter, which is a primary reason for its superior performance over
ListView.48
19.What is the modern, declarative UI toolkit for building native Android UI?
A) XML Layouts
B) Anko
C) Jetpack Compose
D) Flutter
Answer: C) Jetpack Compose. Explanation: Jetpack Compose is Google's
recommended modern toolkit for building native UI, using a declarative approach
in Kotlin.50
20.In Jetpack Compose, what is the term for re-running a composable function
when its state changes?
A) Redrawing
B) Re-inflation
C) Recomposition
D) Re-rendering
Answer: C) Recomposition. Explanation: Recomposition is the core process by
which Compose updates the UI in response to state changes.50
21.To add padding, a background color, and a click listener to a Compose element,
you would use a:
A) Style
B) Theme
C) Modifier
D) Surface
Answer: C) Modifier. Explanation: Modifiers are used to decorate or add behavior
to composables, such as changing layout, appearance, or handling input.
22.Which composable is used to arrange its children vertically?
A) Row
B) Box
C) Stack
D) Column
Answer: D) Column. Explanation: A Column places its children in a vertical
sequence.
23.Which architecture pattern is most commonly recommended for modern Android
development with Jetpack?
A) MVC (Model-View-Controller)
B) MVP (Model-View-Presenter)
C) MVVM (Model-View-ViewModel)
D) VIPER
Answer: C) MVVM (Model-View-ViewModel). Explanation: MVVM is the
recommended pattern as it aligns perfectly with Jetpack components like
ViewModel and LiveData, promoting a clean separation of concerns.30
24.What is the main advantage of the Jetpack ViewModel class?
A) It runs on a background thread automatically.
B) It survives configuration changes, preserving UI state.
C) It automatically fetches data from the network.
D) It encrypts all data by default.
Answer: B) It survives configuration changes, preserving UI state. Explanation: A
ViewModel's primary purpose is to store and manage UI-related data in a
lifecycle-conscious way, so the data isn't lost on screen rotation.37
25.LiveData is an observable data holder class that is also _____.
A) Thread-safe by default
B) Lifecycle-aware
C) Encrypted
D) Only for Strings
Answer: B) Lifecycle-aware. Explanation: LiveData only updates observers that
are in an active lifecycle state, which prevents memory leaks and crashes related
to updating a non-existent UI.55
26.To create a LiveData object whose value can be changed, you should use which
class?
A) StaticLiveData
B) ObservableLiveData
C) MutableLiveData
D) ChangeableLiveData
Answer: C) MutableLiveData. Explanation: MutableLiveData is a subclass of
LiveData that exposes public methods (setValue and postValue) to change its
stored data.
27.Which Jetpack library provides an abstraction layer over SQLite?
A) Retrofit
B) Room
C) Dagger
D) Glide
Answer: B) Room. Explanation: Room simplifies database access by providing an
object-mapping layer over SQLite, with compile-time query verification.56
28.In Room, which component is an interface that defines your database queries?
A) @Entity
B) @Database
C) @Dao (Data Access Object)
D) @Repository
Answer: C) @Dao (Data Access Object). Explanation: The DAO is where you
define methods for interacting with the database, annotated with @Query,
@Insert, etc..57
29.For storing a user's simple boolean preference for "dark mode", which storage
mechanism is most appropriate?
A) Room Database
B) SharedPreferences
C) Internal file storage
D) Firebase Realtime Database
Answer: B) SharedPreferences. Explanation: SharedPreferences is designed for
storing small collections of simple key-value data, like user settings.58
30.Which library is a type-safe HTTP client commonly used for networking in
Android?
A) Volley
B) OkHttp
C) Retrofit
D) Picasso
Answer: C) Retrofit. Explanation: Retrofit is a popular library from Square that
simplifies consuming REST APIs by turning them into Java/Kotlin interfaces.60
31.In Kotlin, how do you declare a variable that cannot be reassigned after its initial
value is set?
A) var
B) const
C) let
D) val
Answer: D) val. Explanation: val declares a read-only (immutable) variable, while
var declares a mutable variable.63
32.What does the ? symbol signify after a type declaration in Kotlin (e.g., String?)?
A) The type is important.
B) The type is a constant.
C) The type is nullable (can hold a null value).
D) The type is a wildcard.
Answer: C) The type is nullable (can hold a null value). Explanation: This is a core
part of Kotlin's null safety system, forcing the developer to handle potential
nulls.63
33.Which Kotlin operator is used to safely call a method on a nullable variable,
returning null if the variable itself is null?
A) !! (not-null assertion)
B) ?: (Elvis operator)
C) ?. (safe call operator)
D) as? (safe cast)
Answer: C) ?. (safe call operator). Explanation: The safe call operator prevents a
NullPointerException by short-circuiting the call if the object is null.63
34.What is the primary purpose of Kotlin Coroutines in Android?
A) To simplify UI layout design.
B) To manage asynchronous tasks and prevent blocking the main thread.
C) To replace the need for if/else statements.
D) To automatically generate code.
Answer: B) To manage asynchronous tasks and prevent blocking the main thread.
Explanation: Coroutines provide an easy and efficient way to handle background
operations without the complexity of traditional threading.63
35.A Kotlin function marked with which keyword can be paused and resumed?
A) async
B) suspend
C) await
D) paused
Answer: B) suspend. Explanation: suspend functions are the building blocks of
coroutines, enabling non-blocking suspension of execution.
36.Which coroutine builder is used for a "fire-and-forget" task that does not return a
result?
A) async
B) runBlocking
C) withContext
D) launch
Answer: D) launch. Explanation: launch returns a Job and is used for side effects,
whereas async returns a Deferred value for tasks that compute a result.63
37.What is the name of the build automation tool used for Android projects?
A) Maven
B) Ant
C) Gradle
D) Jenkins
Answer: C) Gradle. Explanation: Gradle is the official build system for Android,
responsible for compiling, testing, and packaging the application.64
38.In which [Link] file do you typically declare app-specific dependencies like
Retrofit or Room?
A) Project-level [Link]
B) [Link]
C) Module-level [Link] (e.g., app/[Link])
D) [Link]
Answer: C) Module-level [Link] (e.g., app/[Link]). Explanation: The
module-level build file contains configurations specific to that module, including
its library dependencies.44
39.What is the purpose of the minSdk property in [Link]?
A) The SDK version the app is compiled against.
B) The minimum API level required for the app to run.
C) The target API level for which the app was designed.
D) The version of the Gradle plugin.
Answer: B) The minimum API level required for the app to run. Explanation:
minSdk determines the oldest version of Android your app can be installed on.
40.What is the purpose of the targetSdk property in [Link]?
A) It is the maximum version of Android the app will run on.
B) It specifies the SDK version used to compile the app.
C) It tells the system which Android version the app was designed and tested for.
D) It is an alias for minSdk.
Answer: C) It tells the system which Android version the app was designed and
tested for. Explanation: Setting targetSdk to the latest API level ensures your app
can leverage the latest platform behaviors and features.
41.In the Fragment lifecycle, which method is called to inflate the fragment's layout?
A) onCreate()
B) onAttach()
C) onCreateView()
D) onViewCreated()
Answer: C) onCreateView(). Explanation: onCreateView() is where you must
create and return the root View for the fragment's UI.30
42.In the Fragment lifecycle, which method is called when the fragment's view has
been created and is non-null?
A) onResume()
B) onViewCreated()
C) onActivityCreated()
D) onStart()
Answer: B) onViewCreated(). Explanation: onViewCreated() is called immediately
after onCreateView() and is the appropriate place to set up view listeners or
perform other view-related initializations.
43.If you want to share data between two Fragments, what is the recommended
modern approach?
A) Using interfaces to communicate via the host Activity.
B) Using a shared ViewModel scoped to the host Activity or a navigation graph.
C) Using startActivityForResult.
D) Using static variables.
Answer: B) Using a shared ViewModel scoped to the host Activity or a navigation
graph. Explanation: A shared ViewModel is the modern, lifecycle-safe way for
fragments to communicate and share data without creating tight coupling.37
44.Which layout can arrange children relative to each other or to the parent, but is
generally less performant than ConstraintLayout for complex UIs?
A) LinearLayout
B) FrameLayout
C) RelativeLayout
D) TableLayout
Answer: C) RelativeLayout. Explanation: RelativeLayout is powerful for relative
positioning but can lead to nested hierarchies and performance issues that
ConstraintLayout was designed to solve.47
45.What is the purpose of the apply() method on a [Link]?
A) To save the changes synchronously to disk.
B) To save the changes asynchronously to disk.
C) To apply a theme to the SharedPreferences.
D) To clear all the preferences.
Answer: B) To save the changes asynchronously to disk. Explanation: apply()
writes the data to memory immediately and schedules an asynchronous write to
disk, making it non-blocking and preferred over commit().59
46.In Retrofit, which annotation is used to specify a dynamic path segment in a URL?
A) @Query
B) @Path
C) @Body
D) @Url
Answer: B) @Path. Explanation: @Path is used to substitute a value into the URL
path, for example, @GET("users/{id}") with a parameter @Path("id") userId: Int.61
47.In Retrofit, which annotation is used to add a parameter to the URL's query
string?
A) @Query
B) @Field
C) @Header
D) @Path
Answer: A) @Query. Explanation: @Query adds a key-value pair to the end of the
URL, for example, ?sort=desc.61
48.A Kotlin class designed primarily to hold data can be declared with which keyword
to get auto-generated equals(), hashCode(), etc.?
A) object
B) static
C) final
D) data
Answer: D) data. Explanation: The data keyword instructs the compiler to
generate standard boilerplate methods, making the class ideal for use as a
model.63
49.What is the Kotlin equivalent of a static method in Java?
A) An object declaration.
B) A function inside a companion object.
C) An open function.
D) An internal function.
Answer: B) A function inside a companion object. Explanation: A companion
object is an object tied to a class, and its members can be accessed using the
class name, similar to static members in Java.
50.What is the when expression in Kotlin?
A) A replacement for a for loop.
B) A more powerful and flexible replacement for a switch statement.
C) A way to handle try-catch blocks.
D) A way to declare a variable.
Answer: B) A more powerful and flexible replacement for a switch statement.
Explanation: when can be used as either a statement or an expression, and it can
match against a wide range of conditions, not just constants.63
51.To prevent R8/ProGuard from removing or renaming a class, you would add a rule
to which file?
A) [Link]
B) [Link]
C) [Link]
D) [Link]
Answer: C) [Link]. Explanation: This file contains the configuration
rules that tell the code shrinker what to keep and what not to obfuscate.
52.In a RecyclerView, which component is responsible for drawing dividers or offsets
between items?
A) Adapter
B) LayoutManager
C) ItemDecoration
D) ViewHolder
Answer: C) ItemDecoration. Explanation: ItemDecoration is a flexible class that
allows you to draw in the RecyclerView's canvas, under or over the item views.48
53.Which of the following is NOT a primary component of the Room Persistence
Library?
A) Entity
B) DAO
C) Database
D) Repository
Answer: D) Repository. Explanation: While the Repository pattern is commonly
used with Room, it is a design pattern, not a core component of the Room library
itself. The core components are Entity, DAO, and Database.56
54.Which LiveData method should be used to update its value from a background
thread?
A) setValue()
B) updateValue()
C) postValue()
D) sendValue()
Answer: C) postValue(). Explanation: postValue() posts a task to the main thread
to set the value, making it safe to call from a background thread. setValue() must
be called from the main thread.
55.In Jetpack Compose, what is the purpose of the remember function?
A) To make a function run faster.
B) To store an object in memory across recompositions.
C) To remember the user's last action.
D) To add a composable to the back stack.
Answer: B) To store an object in memory across recompositions. Explanation:
remember is used to
Works cited
1. Interview Etiquette Tips for Walk-In & Virtual Interviews - Job Nexus India,
accessed on August 7, 2025,
[Link]
2. Top HR Interview Questions and Answers - InterviewBit, accessed on August 7,
2025, [Link]
3. The 10 Rules of Job Interview Etiquette - Catenon, accessed on August 7, 2025,
[Link]
4. 5 interview etiquette rules that can land you your dream job - The Times of India,
accessed on August 7, 2025,
[Link]
hat-can-land-you-your-dream-job/articleshow/[Link]
5. Indian job interview? Here are some tips - Wise, accessed on August 7, 2025,
[Link]
6. 15 Common job interview questions with answers - Employment Hero, accessed
on August 7, 2025,
[Link]
rs/
7. Interview Preparation Tips: Body Language during Interview - IMS Proschool,
accessed on August 7, 2025,
[Link]
8. Body Language Tips for a Successful Interview - CLINI INDIA, accessed on August
7, 2025, [Link]
9. 10 Things You Need to Know on Body Language During Job Interview - Hr -
Siliconindia, accessed on August 7, 2025,
[Link]
[Link]?utm_source=clicktrack&utm_m
edium=hyperlink&utm_campaign=linkinnews
10.Indian Work Culture vs American Work Culture: A Comparative Guide 2024 -
OWOW Blogs, accessed on August 7, 2025,
[Link]
11. Cultural Differences You Need to Know Before Hiring Talent in India - Uplers,
accessed on August 7, 2025,
[Link]
u-need-to-know-before-hiring-in-india/
12.Cultural Differences When Working with Indians - Commisceo Global, accessed
on August 7, 2025,
[Link]
ans?format=print
13.Cultural Differences YOU Need to Know Before Hiring Talent in India, accessed on
August 7, 2025,
[Link]
14.How do Indian interviewers expect to evaluate someone with a checklist of
questions and no real conversation? Where's the empathy, the people skills? Is
that too much to ask? : r/developersIndia - Reddit, accessed on August 7, 2025,
[Link]
rviewers_expect_to_evaluate/
15.Job Interviews & Body Language: Culture Impacts - Rumie Learn, accessed on
August 7, 2025,
[Link]
16.Using the STAR method for your next behavioral interview (worksheet included),
accessed on August 7, 2025,
[Link]
17.Behavioral-Based Interview Questions, accessed on August 7, 2025,
[Link]
pdf
18.50 Common Interview Questions - Career Services - University of ..., accessed on
August 7, 2025,
[Link]
nterviews/common-questions
19.100+ Job Interview Questions and Answers - Monster Jobs, accessed on August
7, 2025,
[Link]
s
20.Top 100 Entry-Level Interview Questions and Awesome Answers for ..., accessed
on August 7, 2025, [Link]
21.Top 7 Common Job Interview Questions And Answers For Freshers &
Experienced Holders, accessed on August 7, 2025,
[Link]
22.[Link], accessed on August 7, 2025,
[Link]
23.Situational Interview Questions, accessed on August 7, 2025,
[Link]
[Link]
24.Android Developer Interview Question Guide - LinkedIn Business Solutions,
accessed on August 7, 2025,
[Link]
oid-developer/interview-questions
25.Top 10 Common Interview Questions and Best Answers - Randstad India,
accessed on August 7, 2025,
[Link]
stions-and-answers/
26.Most Common Interview Questions and How to Answer Them - Novoresume,
accessed on August 7, 2025,
[Link]
de
27.100 Common Interview Questions - OVMA – Syracuse University, accessed on
August 7, 2025, [Link]
28.The 30 most common Software Engineer behavioral interview questions,
accessed on August 7, 2025,
[Link]
29.Resources/Suggestions to prepare for behavioural interviews : r/careeradvice -
Reddit, accessed on August 7, 2025,
[Link]
_to_prepare_for_behavioural/
30.Top 50 Android Interview Questions and Answers - SDE I to SDE III -
GeeksforGeeks, accessed on August 7, 2025,
[Link]
wers-sde-i-to-sde-iii/
31.Difference Between a Fragment and an Activity in Android ..., accessed on August
7, 2025,
[Link]
-activity-in-android/
32.Services in Android - Topcoder, accessed on August 7, 2025,
[Link]
33.Broadcast Receiver in Android With Example - GeeksforGeeks, accessed on
August 7, 2025,
[Link]
mple/
34.Android fundamentals 02.2: Activity lifecycle and state, accessed on August 7,
2025,
[Link]
cycle-and-state
35.Stages of the Activity lifecycle - Android Developers, accessed on August 7, 2025,
[Link]
fecycle
36.Mastering the Android Activity Lifecycle: Best Practices | by Ken Ruiz Inoue | Deuk
- Medium, accessed on August 7, 2025,
[Link]
s-1d10f15d060a
37.ViewModel overview | App architecture - Android Developers, accessed on
August 7, 2025,
[Link]
38.A diagram of the Android Activity / Fragment lifecycle - GitHub, accessed on
August 7, 2025, [Link]
39.Understanding Android Services: Types, Definitions, and Practical ..., accessed on
August 7, 2025,
[Link]
ses
40.Broadcast Receivers in Android: A Complete Beginner's Guide | by ..., accessed
on August 7, 2025,
[Link]
ginners-guide-6022d62a3bc9
41.
42.[Link] - Android - GeeksforGeeks, accessed on August 7, 2025,
[Link]
43.Android - Difference Between RecyclerView and ListView - GeeksforGeeks,
accessed on August 7, 2025,
[Link]
w-and-listview/
44.Exploring [Link] in Android Application Development - DEV Community,
accessed on August 7, 2025,
[Link]
ment-55i3
45.Performance and view hierarchies | App quality | Android Developers, accessed
on August 7, 2025,
[Link]
archies
46.Should I always use ConstraintLayout for everything? - Stack Overflow, accessed
on August 7, 2025,
[Link]
out-for-everything
47.Exploring Layout Managers in Android: Constraint, Linear, and Relative Layouts
with a Simple UI Example - CaratLane Insider, accessed on August 7, 2025,
[Link]
ear-and-relative-layouts-with-a-simple-ui-85fe26c280c2
48.ListView vs RecyclerView. As an Android developer, Many people ..., accessed on
August 7, 2025,
[Link]
49.RecyclerView or ListView? : Pros, cons, and examples with Kotlin - DEV
Community, accessed on August 7, 2025,
[Link]
in-2nb2
50.Jetpack Compose basics - Android Developers, accessed on August 7, 2025,
[Link]
51.Jetpack Compose Tutorial - Android Developers, accessed on August 7, 2025,
[Link]
52.Pros/Cons of MVVM and live data? : r/androiddev - Reddit, accessed on August 7,
2025,
[Link]
live_data/
53.ViewModels and LiveData: Patterns + AntiPatterns | by Jose Alcérreca | Android
Developers, accessed on August 7, 2025,
[Link]
atterns-21efaef74a54
54.LiveData and ViewModel. Developing Android applications often ..., accessed on
August 7, 2025,
[Link]
55.LiveData overview | App architecture - Android Developers, accessed on August
7, 2025, [Link]
56.Save data in a local database using Room | App data and files ..., accessed on
August 7, 2025, [Link]
57.Getting Started with Room Database in Android | by Amit Raikwar - Medium,
accessed on August 7, 2025,
[Link]
-fa1ca23ce21e
58.Shared Preferences in Android with Example - GeeksforGeeks, accessed on
August 7, 2025,
[Link]
mples/
59.Save simple data with SharedPreferences | App data and files - Android
Developers, accessed on August 7, 2025,
[Link]
60.Introduction to Retrofit in Android - GeeksforGeeks, accessed on August 7, 2025,
[Link]
61.Using Retrofit 2.x as REST client - Tutorial - Vogella, accessed on August 7, 2025,
[Link]
62.Navigation | App architecture | Android Developers, accessed on August 7, 2025,
[Link]
63.Top Kotlin Interview Questions and Answers (2025) - InterviewBit, accessed on
August 7, 2025, [Link]
64.[Link], accessed on August 7, 2025,
[Link]
0is%20a%20build%20system,%2C%20testing%2C%20deployment%2C%20etc.
65.What is Gradle and why do we use it as Android developers? | by ..., accessed on
August 7, 2025,
[Link]
ndroid-developers-572a07b3675d