Algorithm: Best time to buy and sell stock
Review: Simple Thought on Data Product
Tips: Usage of list comprehensions and generator expression in Python
Share: The Magic Loop from Ethan Evans
Algorithm(ref)
import "fmt"
func maxProfit(prices []int) int {
var maxProfit int = 0
var profit int
buy := prices[0]
for _, sell := range prices[1:] {
if sell > buy {
profit = sell - buy
maxProfit = max(maxProfit, profit)
} else {
buy = sell
}
}
return maxProfit
}
fmt.Println(maxProfit([7,1,5,3,6,4])) // 5
Review: Simple Thought on Data Product
Data products are more than data pipelines and data sets. The hallmark of a data product is:
UIs to show the data, every one could “see“ it
No effort to access the data, like access points(UI) and APIs.
A closed-loop between the system and human idea. Feed back loops that consider human input and improve upon getting high-fidelity feedback.
Among these THREE hallmark from the blog, I think the last key point is the hardest to achieve. In most of the cases, the company never thinks they need it, or fails to reach the step to build the loop and then the product is dumped.
Ref
Tips: Usage of list comprehensions and generator expression in Python
Difference
List comprehension is faster.
Generator is more memory efficient.
How do we use them?
Use list comprehension,
[i for i in range(10)]
when the result needs to be iterated over multiple times
or where speed is the first priority.
Use generator expression,
(i for i in range(10))
, where the range is large or infinite.
Extra
As a good habit, we should use list comprehension if we want to use any of the list methods(indexing, slicing, append, extend…) Otherwise, let’s use generator.
Ref
Share: The Magic Loop from Ethan Evans
Before the section, I want to anounce that I am gonna share more career idea/advice in share section, and keep the review section about technology.
(Back to the main content)
Magic Loop, a framework to rise quickly in the career.
What is it?
This is the magic loop, consisting of:
(Responsibility) Do your current job well
(Proactive) Ask your manager how you can help
(Earn credits)Do what they ask
(Proactive) Ask for work that advanced your career
(Positive feedback) Do as they suggest, and repeat in a loop
From step1 to step3, they help us gain the credits to do for our own favors.
Some of these steps will require substantial time and effort, but they lead to not just rapid career growth but also a great relationship with our manager.
Why it works?
The magic loop relies on simple human nature. We have a natural sense of fair play and partnership, and we want to invest in people we view as having our best interests at heart.
How to execute?
Managers always need help, and they normally welcome offers of help and look positively on those making such an offer. However, the exception to this is when they feel that the person asking is not doing their current job well.
1. Do your job well without causing problems for others.
We need to first be an employee in good standing in terms of performance with our current responsibilities. And this is an ongoing challenge, with the workplaces and projects changing, we’ll take on new responsibilities, and struggle with (even a little bit suffer from) it. Thus it is important to verify with your manager that we are doing our current job well, ask them in a non-threatening manner.
A good way to ask is to wait until a relatively quiet time, when there is no crisis going on (or less of one than usual, for a chaotic workplace), and ask our manager something like say something like, “It’s been a while since I last checked in with you. I want to do a good job here and be helpful. I was wondering if you could tell me how you feel I am doing.” Then, no matter what they say in response, say thank you. Do not argue. At most, ask for an example if they receive a complaint.
The next step is about how to take feedback well, which is another topic beyond the scope in this article.
P.S. We will definitely come back and talk about it in another week
2. Ask your manager how you can help, when the current job is under control.
Except offering the help to the manage, One great way to shortcut this process is to volunteer when a new task comes up. Often in a meeting, something will come up that needs to be done, and the manager will be trying to figure out who to give it to.
However, some managers may need a bit of prompting if offers to help are unusual in the company. We could check again in a week or so, giving them time to think about it.
3. Do what you are asked to as your responsibility to gain extra credits
Once a manager makes a request, even if it was not the work you were hoping for, make an honest attempt to help as you. Often what managers need help with are the more operational tasks(e.g. migrating servers, applying patches, and fixing bugs). Good managers want to balance the work and match it to their employees’ desires.
If the work is truly beyond your skills (not your willingness), then you will need to be politely clear about that and ask for pointers, resources, or aid in doing the work. Be clear that you are willing to do all you can but that you are concerned about failing and leaving the manager worse off
4. Ask your manager how you can help aligning with one of your own career goals.
After completing steps through one to three, we earn enough credits to be in a position to ask for work that helps us advance a career goal. If we have a good manager who invests in the careers of their team members, we may be able to skip the previous steps, and starts to ask the work that aligns with our career goal.
We have to have some idea of what we’d like to achieve(e.g. learn a new skill, develop an ability we already have, a raise or a promotion).
Try to use the phrase like
(simple goal) “Is there a way I could help you out while working with [piece of technology or specific skill] so that I can learn and improve?”
(complex goal) “One day I’d like to be promoted. Could I help out in a way that you think would develop me toward that goal?”
5. Repeat the loop to grow more
Sometimes we only go back to step four and do something else that both helps us grow or advance and that helps our manager.
Sometimes we have to revisit step one and make sure that we are doing a great job even with new and more challenging tasks.
Advanced forms of the Magic Loop
Once we master the basics and begin building a collaborative relationship with our manager, we could start to suggest our own ideas and just do it.
(hopefully) I will talk about this next week.
Ref
https://kashiwachen.substack.com/publish/post/14754701