Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

LLM Ticket Classification and Routing

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is LLM Ticket Classification and Routing. Start with the requirements and the three tables on the right.

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.

Problem

How do you approach fine-tuning or prompt-engineering an LLM to automatically classify and route incoming user support tickets?

Using the provided ticket, prediction, and queue data, write a query to evaluate which model versions and predicted queues are reliable for automatic routing. Include only predictions with confidence of at least 0.70 and tickets with a known actual queue.

Output

  1. One row per model version and predicted queue
  2. Columns: model_version, predicted_queue, eligible_tickets, correct_tickets, accuracy_pct, and avg_confidence
  3. Sort by model_version, accuracy descending, then predicted queue alphabetically

Schema

tickets
ColumnTypeDescription
ticket_idPKINTUnique support ticket identifier
subjectTEXTShort ticket subject
actual_queue_idINTReviewed queue assignment
model_predictions
ColumnTypeDescription
prediction_idPKINTUnique prediction identifier
ticket_idINTTicket being classified
model_versionVARCHAR(30)LLM or prompt version used for prediction
predicted_queue_idINTQueue selected by the model
confidenceDECIMAL(4,3)Model confidence from 0 to 1
support_queues
ColumnTypeDescription
queue_idPKINTUnique support queue identifier
queue_nameVARCHAR(80)Human-readable queue name
Tablesticketsmodel_predictionssupport_queues
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results