bookmark_borderHow to treat code review comments

When you send out changes/pull requests and get revision comments, what should you do? Especially, if “quick work-arounds” exist for some issues, what will you do?

It’s tempting to apply the “quick work-around”, and get the changes submitted ASAP, since you will have get something DONE and cross it off your list. You are not against making some larger changes, but would want them to be separated changes. “Iteration”, you say.

It’s not wrong to do things that way, but DO remember to finish the “larger change”, or at least open an issue, triage to the correct priority, and do it when time comes. Otherwise, you’ll have left some tech debt/potential issues in your code base that’s hidden and forgotten, until one day it comes back to bite you. Not only does it hurt your project/codebase, it hurts your teammates’ trust in you.

Reading kindness is underrated, I realize what happened when I submitted changes without fully addressing comments. It’s nice that I got something done, and would enjoy the feeling of accomplishment for the moment. But it hurts your team culture and efficiency in longer term.

  1. Teammate T will feel ignored and/or unrespected.
  2. Next time making a comment, T will need to emphasize things in a more direct manner with a stronger opinion, which may make me feel more nervous in return.
  3. I become more cautious, but meanwhile less comfortable working with T, vice versa

In this process, trust is weakened. It will reach a balance at one point, where both T and me will have weaker trust in each other and less efficient communication. This is not ideal.

To break the loop, a few things to do:

  1. DO read and address comments. Don’t skip/ignore. Don’t just focus on getting the thing done. Get it done well, up to expectation, or make sure you do complete what you said in TODO.
  2. Don’t have hard feelings on comments. Sometimes people are trying to make sure you get their point, if you react proactively they may be softer in future. Other times, you have met someone not nice enough or having a bad day. Just get the right thing done, and their emotion/communication style is not your fault. Get used to it.

bookmark_borderSnap.Inc in 2017

Reading: http://go.theinformation.com/zYv9TN3S6Fk

Major unicorns of 2017:

  • Snap.Inc : IPO expected in March, 2017
  • Uber
  • Airbnb
  • Lyft (predict: acquired by waymo)

Snap vs Facebook

Snap has its own advantages over facebook:

  • Growing strongly with a good monetization model. It tries to make profit from existing users, instead of growing user base, as Facebook does.
  • Facebook has a more highly polluted community (by spam and auto-generated contents).
  • Young people prefer snap since Facebook is growing to be more serious.
  • People tend to switch for a more private social network when the current one is too strongly connected.

Facebook is facing serious challenges from Snap.

bookmark_borderThe difference of “protected” in Java vs C++

在学校的时候一直写C和C++,工作后开始写Java,有些差别是边写边慢慢发现的,比如protected这个权限。

在C++里,protected是只有当前class和subclass可以访问。所有其他的class不行(友元除外)

在Java里,protected是当前class,subclass,和同一package内的其他class可以访问。关键就在于这最后一个区别,在自己写code的时候基本上各个class都在同一个package之内,于是protected的成员在基本所有类都可以访问了,这个访问权限略弱于public(其他package也可以访问),却强过默认的package-private(子类subclass不能访问)。

在Java的访问控制系统内,package有比较重要的地位,总体感觉就是“一个package里面的代码都是你自己管理的,访问权限什么的你拿脑子记住就好了”

bookmark_border如何做决定之——随便挑一个

原链接:Just pick something

作者提到,任何长期不做的决定都会带来

  • 有意识的注意力(consious attention)-前台资源
  • 无意识的能量消耗(unconscious energy)-后台处理
  • 做完决定后不管如何选择都会觉得不满意
  • 会阻碍其他事务的完成,引起焦虑和疑惑

面对一个问题时,思考最坏的结果和最好的结果,如果二者之间差别不大,那就没必要太纠结。

bookmark_borderLeetcode笔记(15)Populating Next Right Pointers in Each Node

Given a binary tree

struct TreeLinkNode {
      TreeLinkNode *left;
      TreeLinkNode *right;
      TreeLinkNode *next;
    }

Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL Initially, all next pointers are set to NULL

Note:
* You may only use constant extra space.
* You may assume that it is a perfect binary tree (ie, all leaves are at the same level, and every parent has two children). For example, Given the following perfect binary tree,

        1
       /  \
      2    3
     / \  / \
    4  5  6  7

After calling your function, the tree should look like:

        1 -> NULL
       /  \
      2 -> 3 -> NULL
     / \  / \
    4->5->6->7 -> NULL

Continue reading “Leetcode笔记(15)Populating Next Right Pointers in Each Node”

bookmark_borderYelp面经

Yelp的简历投了很久了,当时投的其他公司没多久就都或好或坏有了回音,只有yelp在小半年后突然发来邮件说要面试,之前刷的题都已经手生了。感觉要酱油,新鲜yelp面经留下来供后人参考

第二轮: skype 面

  1. Self-intro : spam team
  2. Introduce yourself
  3. Your project in detail
  4. A database gets slow
    1> Single table: index
    2> Multiple tables: join, redesign tables
    3> Unavoidable joins: Indexing and caching
    4> Really large database: distributed, how to distribute table
  5. Binary search, 找一行 0*1*(e.g. 00011)中的第一个1

 

第一轮: hr 电面

和其他公司不同,yelp的hr电面会包含一些technical question,但是都很基础而且很好对付,只要花半天准备一下就妥妥的

和网上说的一样,Yelp的第一轮hr电面包含general behavior question和technical两部分。Technical
的部分就是hr对着一张表读下来,题目和网上的也没什么不同(参见http://www.1point3acres.com/bbs/thread-25318-1-1.html),看一下就好,回答也可以简洁明了。
简单列一下我的问题:
为什么选择yelp
想要什么职位
用什么语言? C++好像没有题可以问
python会么?一点点
64bit的int几字节
32bit机器unsigned int最大值
binary search 用sorted array还是linked list
sorted array的binary search复杂度
octonary的一个digit代表几个binary bit
测试一个ip地址的response: ping
从代码文件中找一个function: grep
sql的inner join是交并差?
sql删除一个record
ip和域名的映射?
http端口号?
http的传输层协议
linux kill的signal
python什么数据结构mutable
能不能合法工作
有没有面其他公司
有什么问题

bookmark_borderLeetcode笔记(13)Best Time to Buy and Sell Stock III

Say you have an array for which the ith element is the price of a given stock on day i.

Design an algorithm to find the maximum profit. You may complete at most two transactions.

Note:
You may not engage in multiple transactions at the same time (ie, you must sell the stock before you buy again).

Continue reading “Leetcode笔记(13)Best Time to Buy and Sell Stock III”