# 2022.04.29 線上面試一面 陳弘毅(後端工程師) ###### tags: `線上面試一面` ### 需求說明 請設計一個購買清單服務, 功能類似 https://www.amazon.com/hz/wishlist/ls , 使用者可以把喜愛的商品連結加入購買清單裡, 並分享連結給其他人。 * 需要一個簡單的登入頁。 * 有一個可以接受輸入商品名稱及網址的表單。 * 有一個可以顯示購買清單的列表功能頁。 * 在購買清單頁, 提供分享按鈕的功能, 按下後自動複製購買清單的網址。 * 未登入的狀態下, 購買清單不提供刪除功能。 * 記錄購買清單被訪問的次數。 --- ### Present Here #### MemberInfo | col1 | col2 | col3 |col4 |col5 |col6 | | ---- | ---- | ---- |---- |---- |---- | | userid | userAccount | userPassword |userName|createtime|updatetime| #### WishList | col1 | col2 | col3 |col4 |col5 |col6 | | ---- | ---- | ---- |---- |---- |---- | | wishlistid |userid | watchcount | wishlisturl|createtime|updatetime| #### WishItem | col1 | col2 | col3 |col4 |col5 |col6 | | ---- | ---- | ---- |---- |---- |---- | | wishitemid |wishlistid | wishitemName | wishitemurl|createtime|isDelete| --- ### Samples #### Table | col1 | col2 | col3 | | ---- | ---- | ---- | | val1 | val2 | val3 | #### SQL Command ``` sql SELECT * FROM WishItem wi left join WishList wl on wi.col2 = wl.col1 left join MemberInfo mif on mif.userid = wl.col2 WHERE mif.userid = 'xxx' ``` | col1 | col2 | col3 |col4 |col5 |col6 | | ---- | ---- | ---- |---- |---- |---- | | userid |wishlistid | wishitemid | wishitemName|wishitemurl|createtime|isDelete| | userid |wishlistid | wishitemid | wishitemName|wishitemurl|createtime|isDelete| | userid |wishlistid | wishitemid | wishitemName|wishitemurl|createtime|isDelete| | userid |wishlistid | wishitemid | wishitemName|wishitemurl|createtime|isDelete| #### Sequence ```sequence Alice->Bob: Hello Bob, how are you? Note right of Bob: Bob thinks Bob-->Alice: I am good thanks! ``` #### Relation ``` mermaid graph TD; a -->|col1| b a -->|col2| c c --> a ```