I’m sharing a front-end experience I had 3 months ago. The algorithm is extremely simple! I was so impressed with the design. Is FEEDBACK due to insufficient domain knowledge? ? ?
1:
const data = [
{ type: ‘phone’, color: ‘gold’, name: ‘iphone’ },
{ type: ‘phone’, color: ‘blue’, name: ‘iphone’ },
{ type: ‘tv’, color: ‘blue’, name: ‘samsung’ }];
const excludes = [{ k: ‘color’, v: ‘gold’ }, { k: ‘type’, v: ‘tv’ }]
// Print filtered data
2:
give two dom tree, the structure of two trees are same.
give one node in tree one, find it’s matching node in tree two.
3.
give distance, time as parameter, wirte a function can do animation that move a box from left side to right side.
4. give intervals, for example, [0,3, ‘b’], 0 is start position (includesive), 3 is end position , and b is tag name
so use intervals abcedfgh → ab c c 5
desinging an auto complete search box, like facebook level of data.