Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Choose On-Device vs Server Inference

HardGenerative AI & LLMs00:00
Practice interviewer
In session
5 left
00:00

Your question is Choose On-Device vs Server Inference. Take a moment with it on the right.

Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).

You need to log in / sign up to chat or submit.

Problem

Context

PulseNote is building an AI writing assistant inside a mobile health-journaling app. The feature rewrites user notes, summarizes recent entries, and answers simple questions about past journal content. You need to decide whether inference should run primarily on-device, server-side, or via a hybrid routing strategy.

Constraints

  • p95 latency: <700ms for rewrite/summarize actions
  • Cost ceiling: <$0.015 per daily active user per month at 2M MAU
  • Hallucination ceiling: <2% on a labeled factual-grounding set for history-based answers
  • Privacy: raw journal text for minors and EU users should not leave device unless explicitly consented
  • Safety: system must resist prompt injection from retrieved journal content and refuse unsupported medical advice
  • App size increase from on-device models must stay under 250MB
  • Battery impact should be acceptable on mid-tier Android devices

Available Resources

  • 8M anonymized historical prompts/responses from the current cloud assistant
  • 25K labeled evaluation examples across rewrite, summarization, grounded Q&A, refusal, and adversarial injection cases
  • Candidate models:
    • On-device 1B and 3B quantized instruction models
    • Server-side GPT-4.1-mini / Claude Sonnet class models
    • Embedding model for local or server retrieval over a user’s recent journal entries
  • Mobile telemetry for latency, battery, crash rate, and network quality

Task

  1. Propose an evaluation-first framework to decide between on-device, server-side, and hybrid inference, including offline and online metrics.
  2. Design the serving architecture, including what tasks run locally vs remotely, fallback behavior, and how privacy policy affects routing.
  3. Write a system prompt that enforces grounded answers, refusal behavior, and resistance to prompt injection from user-authored journal text.
  4. Estimate cost and latency for each option and recommend one approach, with explicit tradeoffs.
  5. Identify key failure modes, monitoring, and rollout safeguards before launching to all users.