Notes from a CTO #3: Hiring, Logging and Profiling, GPT training.
Let's discuss the nitty-gritty's of hiring and the talk of the town "ChatGPT"
Hey, it’s Bkrm from Docsumo.
You’re reading the third issue of Notes from a CTO: my raw canvas of thoughts and collection of interesting resources I found online.
My goal with this newsletter is to spread knowledge at scale. If you don’t find it useful, you can unsubscribe at the bottom of the page.
But, if this is up your alley, have a read and let me know what you think!
1. Running a startup
This section is a dump of the various facets of startups I have experienced while running one. This week, let's talk about hiring.
With a team of 50+ people spread across India and Nepal, I have learned a little about hiring. There are two critical tasks while running a startup:
Finding Product-Market fit
Hiring the right team
I have hired people within different domains ranging from engineering to sales. After a point in time, you begin to understand what you require from each position. But, a few core things never change in our hiring, no matter the department or seniority.
Our hiring philosophies are simple:
Do you understand the impact you are making in your current organization?
Do have good communication and energy (This is critical).
Can you get things done?
Do you have a good understanding of the task/project you have done? Why, and more whys.
Do your long-term goals align with the organization?
Why did you get into a particular role, and why did you want to join us? (You can do anything in the world, why do this?)
We always pre-screen the CV before an interview, and most people miss this:
Each line in a CV is prime real estate; the HR team has less than one minute to review it. Include impactful information and highlight the points you want to emphasize.
Each line should include the impact, "I did X to solve Y, and the result was Z*."
Important: Z should be [0-9]*.
Here is a sample CV (this CV got me a first-round interview at Google '18). Each line has a number for a reason.
2. Technology
If you missed the last newsletter: A quick recap, I am a bad programmer and need to improve.
There are three fundamental skills you should learn while coding. Primarily understanding how to log, profile, and monitor the code. Other points, such as clean code, test cases, and design patterns, are common knowledge, but the points below are frequently overlooked and cause significant problems in the production of code.
Logging: Always use a proper logging system, which can help you save countless hours in the long run. We use loguru but have heard good things about strict logs. Some best practices include:
Always add metadata to the log: For instance, if you are processing a document in a flask request, always add an ID.
Use proper logging levels like DEBUG, WARNING, INFO, and CRITICAL.
Have a central logging system.
Have a structure for the log that will parse it for downstream tasks.
Have a proper alert system based on logs.
Profiling: Every line in the code is not the same in terms of space and time complexity, so keep tools handy to debug and profile to find the culprit. Please stop trying to optimize every line of code and follow the pareto principle to make informed decisions.
Here are two good tools to get started line profiler and memory_profiler. Use these links to dive into more detail about memray, pyspy, pyroscope, pyinstrument, and yappi. Choose the work base that suits you/ or your needs. For continuous profiling, you can use Tracing but be careful about the overheads.
Monitoring: Once code is pushed into production, monitoring and finding how it failed is critical for debugging. When a bug that you can't replicate craps in production, it translates to losing at least 1-2 weeks of a developer's time to figure out what went wrong. One tool that I can't recommend enough is sentry for error monitoring.
At the start of Docsumo, I used to think dashboards just looked fancy but served no purpose. I have never been more wrong, as these dashboards help me pinpoint the issue quickly or even help find it before it occurs. Though, be careful with dashboards, as they should be created for a reason, so don't overdo it.
Before making any additions, ensure the user writes the use case and the team agrees. For us, google monitoring has been working out great. We had tried datalog, but the cost was very high, and we never pushed it to production. You can even check an open-source EFK stack with Prometheus and grafana, they are good as well.
Here is a thread from 2 years ago on writing better code.
3. Podcasts
This was the most obvious choice. We have been experimenting with GPT internally, and this video came on my feed. (Talk about timing)
4. Interesting links
Repos:
Train LLM in limited resources: Everyone is excited about chatGPT and looking forward to GPT4, but I am more interested in a model that runs on a single CPU. The smaller model will help us implement the true power of AI on a larger scale. The above article is a good start.
News Feed Eradicator: No matter how much I try to channel my time constructively, I sometimes get lost on hacker news or on Reddit. This add-on keeps me on track. (Lifesaver)
Transfer.sh and yopass: A simple self-hosted system can go a long way for your security when implemented correctly. Twitter, LastPass, and circleci hacks have shown how things can go downhill quickly.
Kratos: We have added multiple security features on authentication into our web app. We have decided to go with firebase, but Kratos can be a great alternative.
Articles:
Average Engineer to 10x Engineer: I interact with many developers/engineers and hate when organizations don't treat them right. At Docsumo, we pride ourselves as a developer-first organization and ensure developers are the center of all decision-making. I feel everyone on the team should know their impact. It should also reflect in the interview process. A few things we focus on: Deeply understanding the business domain, prioritizing impactful projects, being a better communicator, get things done. These things help us become excellent developers.
Barnes & Noble's Surprising Turnaround: Time and again, we think new technology will replace the old tech, but I feel they can coexist and play on their strengths.
Why I'm still using Python: When you're starting your developer journey, everyone has one pivotal question: "What language should I start with?" You check multiple blogs and get confused about which one is better. My advice, start with anything that you are comfortable learning. As you grow, one language will not suffice, and you will have to learn more. One factor everyone looks at is the speed of the execution (not the best choice), so always consider other decisive factors like maintainability, community support, developer support, talent, the learning curve for new people, and more.
If I had to rebuild Docsumo, I would still use Python. I also love golang, but there are so many factors to consider in which Python comes out on top. If I were to rebuild, the only difference I might make is to use a fast API in place of flask. Though, I need more analysis to conclude. Evaluate your options, and don't jump to shiny new things.
5. Quotes/ Books
Book recommendation: Steal like the Artist
Nothing is original; everything's a mix of ideas. You can amalgamate ideas and make something unique.
Unless you’re a fortune-teller, long-term business planning is fantasy. Many factors are out of your hands: market conditions, competitors, customers, the economy, etc. Writing a plan makes you feel in control of things you can’t control.
I often get this question: What is the long-term vision for Docsumo? We naturally have a long-term objective for Docsumo, but I am always hesitant to answer.
Yes, Docsumo wants to be the single platform for any document/data you need to process to make a decision. Now, this sounds futuristic, but being a tech guy, these words from Linus Torvalds capture my feelings perfectly. "I am not a visionary, I'm an engineer. I'm perfectly happy with all the people who are walking around and just staring at the clouds ... but I'm looking at the ground, and I want to fix the pothole that's right in front of me before we fall in."
Our Slack channels have a great collection of memes.
That’s it for this edition, I hope you find it useful.
See you in two weeks!
Best,
Bikram Dahal
P.S. If you learned something new today, please share “Notes from a CTO” with your friends and spread the love. ✌🏻
Could you please write a post on setting up company in Singapore vs Nepal?