0% found this document useful (0 votes)
14 views2 pages

Chefaa Clone: Offline Image App Design

The technical assessment involves building an Android app that displays images from the Marvel REST API, allows editing captions and resizing images locally using the TinyPNG API, and works offline by caching data. The app must have a listing page to view image previews and a detail page to view and modify individual images. It should handle tasks asynchronously and queue any network requests to run when a connection is available. The completed code must be shared through a public GitHub repository along with instructions to run the project. During the interview, the candidate's architectural choices, use of best practices, and understanding will be discussed.

Uploaded by

Mahmoud Ibrahim
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Chefaa Clone: Offline Image App Design

The technical assessment involves building an Android app that displays images from the Marvel REST API, allows editing captions and resizing images locally using the TinyPNG API, and works offline by caching data. The app must have a listing page to view image previews and a detail page to view and modify individual images. It should handle tasks asynchronously and queue any network requests to run when a connection is available. The completed code must be shared through a public GitHub repository along with instructions to run the project. During the interview, the candidate's architectural choices, use of best practices, and understanding will be discussed.

Uploaded by

Mahmoud Ibrahim
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Technical Assessment

1. Assessment Brief:
Write an offline-first Android app that shows a list of images fetched from a REST API, with the
ability to modify captions for every image, locally add new images from the device gallery, and
resize images while maintaining their aspect ratios.

2. Acceptance Criteria:
● The app loads images from the Marvel REST API
● The app allows resizing images through the TinyPNG REST API
● App allows to resize any image (while maintaining its aspect ratio)
● App allows to add a textual caption that’s stored locally to any image
● App caches images and their captions locally (SQLite, RoomDB, …etc)
● Uploading images should be offloaded to the background with a notification indicator;
● if the app is in the foreground, then an app-global status indicator should be visible
inside all app pages
● The App works offline normally
● Tasks (like editing a caption of an image, or resizing an image) should be queued to run
when the connection is back
● The app contains 2 main pages:
● A listing page that shows all images obtained from the REST api
● Image Previews List: Each item should show the caption beneath the actual Image
● If an image doesn’t have a caption, then it will default to a placeholder of “No Caption”.
● If a caption exceeds 80 characters it shouldn’t show the rest of the caption and replace it
with an ellipsis ‘…’
● Search Input: Search for an image by its caption, only shows matching Image Previews
● Swipe to refresh: re-fetches data from both the server and the local cache
● Floating Action Bar (FAB): to show a modal to add a new image from the device gallery
with a caption (reuse the image detail UI)
● Image Detail page
● It shows the image;
● and an editable text input that contains the caption;
● Two editable text inputs for the width and height of the image;
● SubmitButton: resizes the image if needed and updates the caption from the text box (if
any)
● This page’s background should be based on the dominant accent color of the image (no
3rd party lib)
● If an image doesn’t have a caption, then it will default to a placeholder of “No Caption” +
a red border around the text input
● Long-pressing all images in the app shows a menu to save to the device gallery with the
caption in the image file metadata
● Users can add gallery images to the app from in-app-FAB or a `share intent`
This challenge will be used as a base for the technical interview.
During the interview, we will discuss your architectural choices, use of good practices, and your
general understanding of what you just did. So refrain from copying code online. Along with a
fully working application.

Finally, the code should be versioned using git and shared with us through any git
repository hosting service.

3. Prerequisites
a. APIs:
i. Marvel
1. [Link]
2. Please note that the API requires a hash and a timestamp, please read
the documentation thoroughly.
3. API base URL: [Link]
ii. TinyPNG
1. [Link]

4. Delivery
● Upload the code to a GitHub public repo.
● We should be able to clone and run the project using instructions from the readme file.

5. Assets:
● Marvel Doc: [Link]

At Chefaa, we Pay attention to design. So, apart from your code quality,
we’ll evaluate how you handle the UI.

Finally, best of luck, we are looking forward to reviewing your great work.

Common questions

Powered by AI

For integrating the Marvel API, developers need to carefully follow the documentation which includes creating necessary authorization using a hash and timestamp, and using the base URL: https://gateway.marvel.com. This involves setting up secure API requests to fetch image data. For the TinyPNG API, similar attention to developer documentation is required for implementing image resizing capabilities with the base functionalities provided by TinyPNG API . Practical considerations for implementation include understanding the rate limits, authentication requirements, and ensuring secure data handling for both APIs. Additionally, caching and offline capabilities should be designed to manage API call frequency and data persistence .

Version control, specifically git, is crucial for tracking changes, collaborating, and managing multiple development branches in this Android application. It ensures historical records of code changes are maintained, facilitating rollback if errors occur. Best practices include committing small, meaningful changes with descriptive messages, utilizing branching strategies to manage features or bug fixes independently, conducting code reviews via pull requests, and maintaining a comprehensive README file in a public GitHub repository. This facilitates seamless cloning and setup by others, critical for both code evaluation and collaborative improvement .

Maintaining aspect ratio during image resizing ensures aesthetic integrity and prevents distortion, preserving the image quality and clarity. If aspect ratio is not preserved, images may appear stretched or squashed, significantly affecting visual representation and potentially degrading the user interface’s visual appeal. Not maintaining consistency can lead to user dissatisfaction or confusion especially when image previews differ from expected visual standards. Addressing this involves using APIs like TinyPNG, which provide resizing functions that automatically maintain aspect ratios .

Implementing local image caching and caption editing involves challenges like ensuring data consistency, optimal storage management, and maintaining fast access times. The app must handle data synchronization efficiently when online connectivity is restored, ensuring that any local changes propagate to the server correctly. This can be addressed using techniques like timestamping local edits to resolve conflicts and maintaining a local-first strategy so that users always interact with cached data. Additionally, using efficient database indexing and querying strategies can help in retaining application performance despite potential large volumes of data .

An offline-first Android app as described in the assessment needs to load images from the Marvel REST API and allow image resizing through the TinyPNG REST API, maintaining aspect ratios. Users can modify image captions stored locally and add images from the device gallery. The app should cache images and captions using a local storage solution like SQLite or RoomDB. Uploading images must occur in the background with appropriate notifications and indicators. Even offline, users should manage tasks like editing captions or resizing images, with tasks queued for execution once connectivity resumes. Functionally, the app needs a listing page showing image previews with captions, a search feature for captions, a swipe-to-refresh capability, and an Image Detail page where users can edit captions and resize images using editable input fields. Additionally, the app's design must adapt the background color based on the image's dominant color and include a feature for long-press saving of images to the gallery with caption metadata .

The app employs strategies like local caching of images and captions using databases such as SQLite or RoomDB, allowing users to access stored data without connectivity. Background processes are queued to synchronize changes like image resizing or caption edits once the connection is restored. The UI continuously reflects the status of uploads or task completions post-reconnection, maintaining awareness. These strategies ensure that user interactions remain seamless and operations like searching, viewing images, and editing captions continue without noticeable disruption, greatly enhancing resilience and satisfaction of user experience without internet .

The UI design of the Android app should prioritize responsiveness and intuitiveness. Employing a clear and consistent layout that guides users to primary actions, such as viewing images or editing captions, enhances usability. Utilizing a color scheme that adapts to each image's dominant color helps create an aesthetically pleasing interface. Implementing familiar gestures like swipe-to-refresh aligns with user expectations, and having a visible global status indicator ensures users are informed about upload progress or connectivity status. Efficient design also considers accessibility, ensuring text readability especially in dynamic scenarios like caption editing, and using visual cues like ellipses for exceeding caption limits .

To handle image captions exceeding the character limit, the app should use a strategy that automatically truncates text beyond 80 characters and appends an ellipsis ‘…’ to indicate additional hidden content. This approach ensures displayed content remains manageable and visually consistent without overwhelming the user interface. Users accessing longer captions can view and edit them fully on the Image Detail page, supporting both data integrity and user accessibility to complete information .

Background task management enhances functionality by allowing operations like image uploads, editing, and resizing to proceed seamlessly without hindering the app’s foreground activities. Utilizing tools such as WorkManager ensures these tasks can retry if initial attempts fail due to connectivity issues, facilitating imperceptible continuity. From a user experience perspective, this means users can queue tasks without delay, receive updates on task completion, and enjoy a smoother app experience that appears more responsive and less dependent on real-time connectivity issues .

Critical architectural decisions for offline functionality include choosing a robust local storage solution like SQLite or RoomDB to cache images and captions. This choice supports data persistence and real-time access without connectivity. Implementing a reliable task queue for editing and resizing operations ensures these tasks execute once connectivity is restored, maintaining user experience integrity. Managing background tasks with notifications involves using WorkManager or similar libraries to handle uploads and updates efficiently in the app’s lifecycle. These decisions ensure the app remains responsive and functional offline, catering to user needs when network access is unpredictable .

You might also like