PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/ML System Design/Intuit

Design prompts for JSON-only LLM responses

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's skills in prompt engineering, API and schema design, and robust output validation for large language models, with emphasis on producing strict JSON-only responses.

  • medium
  • Intuit
  • ML System Design
  • Software Engineer

Design prompts for JSON-only LLM responses

Company: Intuit

Role: Software Engineer

Category: ML System Design

Difficulty: medium

Interview Round: Technical Screen

You need an LLM API to return strict JSON only. How would you structure prompts and the request so the model reliably responds with JSON and no extra text? Include: message roles and instructions, use of a JSON schema or function/tool calling to constrain output, parameter choices (e.g., temperature, max tokens), and runtime enforcement (schema validation, parsing, retry with repair prompts, or few-shot JSON examples). Provide a minimal example of the request and the expected JSON shape. Then explain how you would evaluate whether the output meets the ‘ideal answer’ criteria and how you would iterate on prompts and guards to improve reliability.

Quick Answer: This question evaluates a candidate's skills in prompt engineering, API and schema design, and robust output validation for large language models, with emphasis on producing strict JSON-only responses.

Related Interview Questions

  • Design AI feature launch and data collection - Intuit (hard)
Intuit logo
Intuit
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
ML System Design
4
0

Design an LLM request that returns strict JSON only

Context

You are designing a backend call to an LLM for a technical screen (System Design & Engineering, Software Engineer). The service must return valid JSON only—no prose, no Markdown, no code fences—so downstream code can parse and validate responses reliably.

Task

Describe how you would:

  1. Structure message roles and instructions so the model returns only JSON.
  2. Constrain outputs using either a JSON Schema or function/tool calling.
  3. Choose parameters (e.g., temperature, top_p, max tokens) to reduce variability.
  4. Enforce correctness at runtime (schema validation, parsing, retries with repair prompts, and/or few-shot JSON examples).
  5. Provide a minimal example of the request and the expected JSON shape.
  6. Explain how you would evaluate whether the output meets the “ideal answer” criteria and how you would iteratively improve prompts and guards to increase reliability.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More ML System Design•More Intuit•More Software Engineer•Intuit Software Engineer•Intuit ML System Design•Software Engineer ML System Design
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.