- Multiple columns (e.g., Todo, In Progress, Done)
- Cards inside each column
- Drag and drop cards across columns
- Reorder cards within a column
- Persist state
- How do you handle drag and drop efficiently?
- How do you maintain ordering?
- How do you handle large boards?
- How do you optimize re-renders?
- How do you persist updates?
- UI Layer
- Data Model
- State Management
- Drag & Drop System
- Ordering Logic
- Persistence
- Performance
- Edge Cases
- Board container
- Column (list)
- Card (task)
- Horizontal scrolling for columns
- Vertical scrolling for cards
- Drag interaction with visual feedback

{
columns: {
col1: { id: "col1", title: "Todo", cardIds: ["c1", "c2"] },
col2: { id: "col2", title: "In Progress", cardIds: ["c3"] }
},
cards: {
c1: { id: "c1", title: "Task 1" },
c2: { id: "c2", title: "Task 2" },
c3: { id: "c3", title: "Task 3" }
},
columnOrder: ["col1", "col2"]
}- Avoid nested updates
- Faster re-renders
- Easier drag operations
- columns
- cards
- draggingItem
- sourceColumn
- destinationColumn
- Keep state minimal and normalized
- Drag starts
- Track dragged item
- Detect drop target
- Update state
- Native HTML5 drag & drop
- Libraries (React DnD, dnd-kit)
- Focus on logic, not library
newCardIds = reorder(list, startIndex, endIndex)- Remove from source
- Insert into destination
PATCH /card/{id}
{ columnId, position }
- Optimistic update (update UI immediately)
- Sync with backend
- Update UI instantly
- If API fails → rollback
- Memoization: Avoid re-rendering entire board
- Virtualization: For large number of cards
- Avoid deep copies: Use shallow updates
- Lazy load columns
- Virtualize lists
- Paginate cards
- Dropping outside valid area
- Rapid drag events
- Duplicate updates
- Empty columns
- Large data
- User drags card
- UI updates position
- State updated
- API call sent
- Backend confirms

- State modeling
- Drag & drop logic
- Performance awareness
- UI consistency












