Type d'évaluation
Mise en situation réelle
Analyse
Intelligence Artificielle
Compétences ciblées
Scénario Technique
Context A todo application updates a task's completion status by calling a REST API, but the UI only updates after the server responds, causing a noticeable delay. The Problem The current approach waits for the API response before updating the UI, resulting in a laggy experience even on reliable connections. Constraints Apply the state change immediately in the UI before the API call resolves. Revert the state to its previous value if the API call fails. Show an error notification on failure. Expected Deliverable A React component implementing optimistic UI updates with automatic rollback on API failure, demonstrating the pattern with a toggle action.
Prêt à évaluer ce talent ?
Accédez à l'interface de test complète pour soumettre votre architecture ou votre code.