Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Build a Translate App UI in Jetpack Compose
00:00
5 left

Build a Translate App UI in Jetpack Compose

MediumPython

Problem

Android coding: using Jetpack Compose, build a UI similar to the Google Translate app home page

Asked in the phone screen (Android coding) stage. Compose UI coding round.

For grading, implement the pure state-building logic that feeds the Compose screen. Given available languages, selected languages, and recent translations, return a render model containing the language bar, swap availability, input area, and recent items. Preserve language order and do not mutate inputs.

Function: build_translate_home_state(languages, source, target, recent)

languages is a non-empty list of strings, source and target are language names, and recent is a list of objects with source_text, translated_text, source, and target. Return a dictionary with keys languages, source, target, can_swap, input_text, and recent.

Constraints

  • 1 <= len(languages) <= 1000
  • Each language name is a non-empty string
  • source and target are strings
  • 0 <= len(recent) <= 1000
  • Each recent item contains source_text, translated_text, source, and target
  • Do not mutate any input list or dictionary

Function Signature

def build_translate_home_state(languages, source, target, recent):
Interviewer

Your question is Build a Translate App UI in Jetpack Compose. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
Sign up free to run your codeLog inLn 2
Run your code to see test output here.