Build a chat widget: create a JSON file, fetch/read messages from it and display them, append newly entered messages dynamically, make the chat window resizable and draggable (drag and drop).
Asked in the Personal technical interview stage. Interviewers asked HTML/CSS/JS questions involving flexbox, justify-content, the DOM, and event handling while the candidate implemented.
For grading, model the behavior with build_chat_state(config). json_messages contains initially loaded messages, entered_messages are appended in order, resize events contain dw and dh, and drag events contain dx and dy. Return the final messages and widget position and size. Width must not fall below 240 and height must not fall below 160.
def build_chat_state(config):