Flipkart
Online AssessmentJewellery Workshop Production Risk Level Analyzer
A jewellery manufacturing company wants to identify workshops that are experiencing production-quality and order-fulfilment problems. The company records workshop details, category production standards, manufacturing batches, customer orders, and return reports.
Your task is to analyse the available records with respect to a fixed referenceDay and identify workshops whose risk level is CRITICAL or WARNING.
Risk Assessment Rules:
1. Defect Rate (% of manufactured items with defects):
- If defect rate exceeds category tolerance threshold by >= 15%: CRITICAL
- If defect rate exceeds category tolerance threshold by >= 5%: WARNING
2. Fulfilment Delay (% of orders shipped after referenceDay or past promised delivery):
- If delay rate >= 20%: CRITICAL
- If delay rate >= 10%: WARNING
3. High Return Volume (% of items returned due to quality):
- If return rate >= 10%: CRITICAL
- If return rate >= 5%: WARNING
Overall Workshop Risk:
- If any metric is CRITICAL, overall risk is CRITICAL.
- Else if any metric is WARNING, overall risk is WARNING.
- Otherwise, NORMAL (do not print).
Print qualifying workshops sorted by risk level (CRITICAL first, then WARNING), and alphabetically by workshopName.
- ▸Structured multi-table input containing:
- ▸- referenceDay
- ▸- Workshops table (workshopId, workshopName, jewelleryCategory)
- ▸- Category standards table (category, maxToleranceRate)
- ▸- Batches table (batchId, workshopId, totalProduced, defectCount)
- ▸- Orders table (orderId, workshopId, promisedDay, actualShippedDay)
- ▸- Returns table (returnId, workshopId, returnedCount, totalShipped)
- ▸Print lines with `<workshopId> <workshopName> <RISK_LEVEL>` sorted by risk (CRITICAL before WARNING) and then workshopName.
- 1 <= Number of workshops <= 500
- 1 <= Total batches, orders <= 10^5
- All days are positive integers.
referenceDay: 100 Workshops: [W1, Royal Gold, GOLD], [W2, Silver Craft, SILVER] Defect Rates: W1 has 22% defect rate (standard 5% -> diff +17%) Delay Rates: W2 has 12% delay rate
W1 Royal Gold CRITICAL W2 Silver Craft WARNING
Workshop W1 exceeds gold tolerance by 17% (>= 15%), triggering CRITICAL risk. Workshop W2 has a 12% fulfilment delay rate, triggering WARNING risk.
1. Aggregate total produced and defective items per workshop to compute Defect Rate. 2. Aggregate on-time vs delayed orders per workshop against referenceDay and promisedDay. 3. Aggregate return quantities against total shipped items. 4. Evaluate threshold conditions against category standards for each workshop. 5. Collect workshops marked CRITICAL or WARNING and sort by priority (CRITICAL > WARNING) followed by workshopName.