Skip to content

zoom是一家外企,在脉脉、知乎、小红书上口碑还是不错的,几乎都是褒奖。他们的主业是在线会议,围绕在线会议衍生出一些周边产品,我面试的是武汉的在线文档相关岗位的后端开发。

这个岗位是前同事内推的,由于我之前待的一家公司zoom比较认可(就武汉而言),因此只有一轮技术面,面试官也是前公司的另一部门的同事,之前没有交集。

面试先对我的过往项目经历做了些讨论,然后问了些八股文,最后给了两个技术问题,一个是系统设计:怎么设计一个多人编辑的在线表格,回答中主要围绕怎么解冲突、怎么应对高并发做了些讨论。另外一个是一个leetcode, 把我的实现贴在这里。

go
package main

import (
	"fmt"
)

type Node struct {
	Value int
	Next  *Node
}

func sortList(head *Node) *Node {
	if head == nil {
		return head
	}

	nodes := make([]*Node, 0)
	for head != nil {
		nodes = append(nodes, head)
		head = head.Next
	}

	for i := 0; i < len(nodes)-1; i++ {
		for j := i + 1; j < len(nodes); j++ {
			if nodes[i].Value > nodes[j].Value {
				nodes[i].Value, nodes[j].Value = nodes[j].Value, nodes[i].Value
			}
		}
	}

	return nodes[0]
}

func merge(lists []*Node) *Node {
	if len(lists) == 1 {
		lists[0] = sortList(lists[0])
		return lists[0]
	}

	start, end := 0, len(lists)
	middle := (start + end) / 2
	leftPart := merge(lists[start:middle])
	rightPart := merge(lists[middle:end])

	head := &Node{}
	ret := head

	for leftPart != nil && rightPart != nil {
		if leftPart.Value > rightPart.Value {
			leftPart, rightPart = rightPart, leftPart
		}

		head.Next = leftPart
		leftPart = leftPart.Next
		head = head.Next
	}

	if leftPart != nil {
		head.Next = leftPart
	}
	if rightPart != nil {
		head.Next = rightPart
	}

	return ret.Next
}

func main() {
	// 多个单链表
	n1 := Node{Value: 1}
	n2 := Node{Value: 7}
	n3 := Node{Value: 5}
	n4 := Node{Value: 4}
	n5 := Node{Value: 6}
	n6 := Node{Value: 9}
	n7 := Node{Value: 10}
	n8 := Node{Value: 2}
	n9 := Node{Value: 3}
	n10 := Node{Value: 8}

	n1.Next, n2.Next, n3.Next = &n2, &n3, nil // 1->2->3

	// l1 := sortList(&n1)
	// fmt.Println("test sortList...")
	// printList(l1)

	n4.Next, n5.Next, n6.Next = &n5, &n6, &n7
	n8.Next, n9.Next = &n9, &n10

	lists := []*Node{&n1, &n4, &n8}

	fmt.Println("before merge...")
	for _, l := range lists {
		printList(l)
	}

	fmt.Println("after merge...")
	m := merge(lists)
	printList(m)
}

func printList(l *Node) {
	for l != nil {
		fmt.Println(l.Value)
		l = l.Next
	}
}

最终给了我offer, 但是考虑到自己年纪大了,不敢轻易挪窝了,待遇给的也没让我心动,因此没去。

也许当前这份工作,是做技术岗职业生涯的最后一站?不知道还能坚持多久……