以前我也有这个困惑,但是现在确定了自己交流的模板之后反正没有被交流原因据过。
-
问题阅读 Let me spend a moment reading the problem description. (开始阅读问题描述)
-
澄清问题 “Let me clarify what we want to achieve here.” (问清楚问题的目标以及corner case的处理)
-
重复问题 “So, given an array of numbers, I need to find the two numbers that add up to a target value. Are all numbers positive? Can I assume the array is sorted?” (确保对问题有清晰的理解)
-
确认理解 “Got it, thanks for clarifying. I'll take a minute to think through some possible solutions. (花几分钟考虑解法)
-
提出解法
-
想出解法时:“I have an approach in mind. Can I explain it to you”
-
暂无思路时:“I don’t have a clear solution yet. Could you give me a hint?” (等待对方的提示,之后提出并讨论解法)
-
-
确认解法 What Do you think about this approach? Should I go ahead and start coding? (确认解法是否合适)
-
编写代码
- “Ok, I’ll start coding now. I’ll let you know once I’m done with the implementation.” (进入编码环节)
-
展示代码和测试 “Alright, I’ve completed the code. Let’s walk through it and maybe test it with some examples.” (展示代码并测试)
-
复杂度和改进 如果对方问到复杂度,可以说:“This approach has a time complexity of… and a space complexity of… I think this is optimal, but I’m open to exploring alternatives if you have suggestions.”
-
总结 “It seems to handle the cases well. Let me know if you’d like any adjustments.” (展示测试结果后,总结一下)