Tech Made Simple Jan 2023
Tech Made Simple Jan 2023
Table of Contents
● Table of Contents
● Salesforce CEO profits from laying off 7000+ people [Finance Fridays]
● Some simple techniques to make sure your systems are much better.
● System Design Mock Interview: Design TikTok ft. Google TPM[System Design Sundays]
● How I networked with one of the most prominent Data Scientists online[Storytime
Saturdays]
1
2
To those of you that don’t know me, hi I’m Devansh (you can find my
LinkedIn here). Amongst the many things I’m involved in, I happen to be
a writer covering various topics in Technology, Software Engineering, and
AI. I’ve helped people ace their coding interviews, get their dream jobs,
progress in their careers, gain a better understanding of Tech, and even
find the One Piece!! And hopefully, I can now help you.
I’ll end the introduction here. If you like my writing, I would appreciate
you spreading this ebook. It’s completely free, so no harm to anyone.
2
3
3
4
How you can balance your hobbies, family commitments, health, and career with
your self-study
4
5
5
6
6
7
7
8
health and consistency. Tracking your progress will help a lot with
this.
I will be doing more detailed posts on these points to go into more detail.
Stay tuned, for those.
Loved the post? Hate it? Want to talk to me about your crypto portfolio?
Get my predictions on the UCL or MMA PPVs? Want an in-depth analysis
of the best chocolate milk brands? Reach out to me by replying to this
email, in the comments, or using the links below.
Stay Woke,
Go kill all,
Devansh <3
Instagram: https://www.instagram.com/iseethings404/
Message me on Twitter: https://twitter.com/Machine01776819
My LinkedIn: https://www.linkedin.com/in/devansh-devansh-516004168/
My content:
8
9
.In this post, we’re going to go over what these terms mean and why you
have to make a tradeoff. In a follow-up Sunday post, I will go into more
detail about the datasets you should know about to excel in your
interviews/system design work.
9
10
Important Highlights
10
11
same time. This ensures that at any given moment, every node has
the same values.
3. What is Availability in the CAP theorem- Each read or write request
for a data item will either be processed successfully or will receive
a message that the operation cannot be completed (I like to liken it
to the idea of Atomicity in ACID). Every node must be able to
respond in a reasonable amount of time.
4. What is Partition Tolerance in the CAP theorem- Partitions occur
when due to a failure in the network responsible for connecting the
nodes of the system. The nodes are fragmented into different
partitions and the nodes in each partition can only communicate
with each other. Partition Tolerance guarantees that the system
keeps functioning when this happens.
5. Why we can only make 2 out of 3 guarantees in the CAP theorem-
In the case where you have single systems (no partitions can
occur), you can guarantee Consistency and Availability. Single-node
systems clearly can’t guarantee Fault Tolerance.
Let’s say that network partition failure happens, it must be decided
whether to do one of the following:
○ cancel the operation and thus decrease the availability but
ensure consistency
○ proceed with the operation and thus provide availability but
risk inconsistency.
6. Knowing which tradeoff to pick- Depending on your needs, these 3
metrics will have different importances. So how do you know which
11
12
To those of you who want some fun visuals, the following video by
ByteByteGo is a good start. Check it out.
Stay Woke,
Go kill all,
Devansh <3
Instagram: https://www.instagram.com/iseethings404/
Message me on Twitter: https://twitter.com/Machine01776819
My LinkedIn: https://www.linkedin.com/in/devansh-devansh-516004168/
My content:
12
13
Clean Code,
It’s one of those terms that is thrown around a lot. Obviously, you want to
write code that is pristine, but what does that actually mean? This can be
a hard question to answer because the people interacting with your code
are often not the end users. This means that code quality is not always
correlated with the performance of the code, which makes the concept
of code cleanness very abstract. You can’t really write tests to check for
code cleanness the same way you can for functionality.
13
14
14
15
start writing code that is both functional and cleaner than Luka Modric’s
dribbling.
Important Highlights
1. What is Clean Code- The way that I see it, clean code is code
written for other developers. Clean code is code written in a way
that other developers (even those with minimal context) have an
easy time reading through the code base and extracting the key
ideas from it.
2. Technique 1, 𝗣𝘂𝗿𝗲 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻𝘀- A pure function is a function that
always returns the same output, given the same input(s). It doesn't
depend on any external variable apart from the inputs provided, nor
it affects/changes any outside variable. Having pure functions
makes it a lot easier to test it.
window.addNewControl(title="Title",
15
16
xPosition=20,
yPosition=50,
width=100,
height=50,
drawingNow=True) #do this
This can save your fellow developers a lot of mental energy. Not
every language has this feature. One way to get around it is to use
Objects for params, where the objects contain the params. Another
easy way to get around this is the next technique.
16
17
Using these techniques will allow you to easily make your code much
cleaner in an effortless manner. Do you have any techniques that you
really like to use? Let me know in the comments/by reaching out to me.
Stay Woke,
Go kill all,
Devansh <3
Instagram: https://www.instagram.com/iseethings404/
17
18
My content:
18
19
Problem
19
20
Example 2:
Input: s1 = "ab", s2 = "eidboaoo"
Output: false
Constraints:
● 1 <= s1.length, s2.length <= 104
● s1 and s2 consist of lowercase English letters.
Stay Woke,
Go kill all,
Devansh <3
Instagram: https://www.instagram.com/iseethings404/
20
21
My content:
My YouTube: https://rb.gy/88iwdd
21
22
Problem
22
23
Example 2:
Input: s1 = "ab", s2 = "eidboaoo"
Output: false
Constraints:
● 1 <= s1.length, s2.length <= 104
● s1 and s2 consist of lowercase English letters.
23
24
algorithm is to simply start by attacking simple edge cases. This is a nice way to simplify your
problem and discover some underlying hints about the structure of the problem. It allows you to
hit upon the Communication and Problem-Solving pillars of cracking interviews in one easy
sweep.
This is the 5 Pillar Approach that this newsletter uses to maximize your chances of success.
In our case, there is a clear edge case. Since we are checking for s1 being a part of s2, we
know that we can return false if s1 is longer than s2.
if len(s1)>len(s2): return False
This is a quick way to buy yourself some time and gain a few brownie points from the
interviewer. So where do we go from here?
Here is where some previous knowledge can be helpful. Anytime we are looking for
substrings(in our case s1) within a larger string (s2), the sliding window approach is one of your
best friends. We’ve solved a lot of problems using that, so if you’re looking for practice with this
approach, here are a few older posts on it.
24
25
The sliding window approach is pretty simple. Use two pointers to define an interval on a
string/list, and check for your desired pattern/property in that interval. If you don’t find the
pattern, move your window across to form a new interval.
This approach is great for a simple reason, it’s cheap. Sliding window problems can usually
done in O(n) time. You will see this pattern pop up quite a bit, especially for questions involving
anagrams or strings.
Our sliding window has one major simplification- the length of the window is fixed. We just
need to slide our window across, comparing whether our values match. How do we do this?
The simplest approach would be to generate every permutation (anagram) of s1 and check
whether the current window of s2 has them. This is extremely costly and presenting this as the
final solution will get you kicked out of the interview (and most probably blacklisted from the
company). Fortunately, there is a better approach, one that’s much easier to code and has lower
complexity. It takes advantage of the sliding nature of the sliding window approach. What is it?
Let’s get into it.
25
26
What does this mean? All we have to do is build the window once. After that, it’s just a matter of
replacing the appropriate characters.
I can see the tube light going off in your mind. With this insight, you should be able to see 2
things-
Our windows will be stored hashmaps/dicts. We can leverage their O(1) time for lookup and
insertion to quickly replace characters. Our sliding window character adjustments are made with
the following 2 lines-
h2[s2[l]] -= 1
1. h2[s2[r]] = h2.get(s2[r], 0) + 1
2. Our comparison will just be checking if the two dicts are equal. High-level languages
have this comparison feature built-in.
With that out of the way, the code should become relatively straightforward.
Step 4: Coding It Up
Here is the code for this solution.
from collections import Counter
class Solution:
def checkInclusion(self, s1: str, s2: str) -> bool:
if len(s1)>len(s2): return False
l, r = 0, len(s1)
h1 = Counter(s1)
h2 = Counter(s2[:len(s1)])
#Counter just returns the dict with the no. of occurences in a string
26
27
return h1 == h2
Loved the solution? Hate it? Want to talk to me about your crypto portfolio? Get my predictions
on the UCL or MMA PPVs? Want an in-depth analysis of the best chocolate milk brands? Reach
out to me by replying to this email, in the comments, or using the links below.
Stay Woke,
Go kill all,
Devansh <3
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
27
28
28
29
not in the way you’d expect. The news of these layoffs led to a notable
increase in stock prices. Confused why this happened? And what you
can do to protect yourself? Continue to read on.
Important Highlights
29
30
30
31
pain, no gain. If your goal is job security, aim for places with low
churn and more steady revenues.
If you want to learn more, YouTuber Josh Fluke made an in-depth video
about the layoffs, how the CEO has offloaded his stocks, and a lot more.
His channel is great because it often exposes the hypocrisy and double
standards that some companies impose on their employees. I would
suggest watching it, to help you identify red flags in your own work
culture.
I created Technology Made Simple using new techniques discovered through tutoring multiple
people in top tech firms. The newsletter is designed to help you succeed, saving you from hours
wasted on mediocre resources or on the Leetcode grind. Easily find your needs met in one
place. I have a 100% satisfaction policy, so you can try it out at no risk to you. Use the button
below to get 20% off for up to a whole year. Using this discount will drop the prices-
800 INR (10 USD) → 533 INR (8 USD) per Month
8000 INR (100 USD) → 6400INR (80 USD) per year
Get 20% off for 1 year
In the comments below, share what topic you want to focus on. I’d be interested in learning and
will cover them. To learn more about the newsletter, check our detailed About Page + FAQs
If you liked this post, make sure you fill out this survey. It’s anonymous and will take 2 minutes of
your time. It will help me understand you better, allowing for better content.
https://forms.gle/XfTXSjnC8W2wR9qT9
If you like my writing, I would really appreciate an anonymous testimonial. You can drop
it here.
Stay Woke,
31
32
Go kill all,
Devansh <3
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
32
33
33
34
34
35
35
36
36
37
people will see things the same way we do. Nothing could be further
from the truth.
Keep in mind everyone you’re working with is also facing their own
unique challenges and circumstances. They will put the minimum
possible amount of energy into what you’re doing, just because they
have to conserve their attention for their own work. How many times
have you zoned out during meetings when someone else is presenting
their work? This is doubly true for more senior people, who often tend to
ignore the presentations by their juniors b/c most of that work is too
low-level/focused. Chances are, your supervisor doesn’t really care that
you tried an ARIMA instead of an LSTM for your time series forecasting
task.
I have 6 interns reporting to me, and I couldn’t give you details on what
they do.
-Data Manager, Consulting Company
This is a problem if you care about good performance reviews. These are
the people who will give you your offer/promotion. So what do you do
instead? If you got great acting skills, buy a fake mustache. Then french
revolution your managers, take their spot and pretend to be them for the
rest of your life (this will work regardless of whether your manager has a
mustache or not. Fake mustaches have magic in them). But what about
those who skipped out on acting class? Don’t worry, I have something for
you as well.
For every action you take, justify how that action is expected to impact
the business case. Instead of just saying you added regularization to the
37
38
model, talk about how the current data models were not generalizing
well to new clients, increasing operational overhead (basic business bro
jargon is a game changer. Show up to Finance Fridays to speak Finance
Bro). Speaking in terms of business impact is going to make everyone’s
ears perk up. It can also lead to you getting better input since people can
throw in their own 2 cents. This step is relatively simple to implement
and will lead to amazing outcomes. Try it and thank me later. I did a
more in-depth post on how to crush daily standups here, so check it out
if you’re interested.
Now moving on to a mindset shift you have to make.
Your supervisor is probably really busy. Thus they really value people
who can work independently and will take initiative on projects. Start
doing this. A lot of interns/juniors make the mistake of waiting for
approval for every task they embark on. If you think something is worth
doing, just do it. Start working on the improvement you think is
worthwhile. If your manager/colleagues don’t like it, they will let you
know in the meeting/async channels. I’m not asking you to ignore the
procedures for shipping to production and just push whatever features
you want out there. However, too many juniors keep waiting around for
their supervisors to assign work to them. Flip this approach on its head.
Do what you want, as long as other people aren’t telling you to stop. Even
if you make a mistake, a good supervisor will appreciate your initiative.
38
39
The only caveat (as I’ve said before) is to make sure you’re always
communicating your work. This gives people opportunities to chip in and
offer course correction before you do something catastrophic. And
obviously, don’t push your work into production without the appropriate
checks.
39
40
Say No To Work
In my post about how to easily integrate self-study into your life, I talked
about the importance of picking your battles and not wasting your
energy. The same principle applies here. There will always be unrealistic
expectations that others place on you wrt what they expect. Your
manager will give you large unrealistic projects. There will always be
40
41
more bugs to fix, code to optimize, and features to implement. It’s not
your job to do all of it.
Instead, you need to be discerning. When given a task, evaluate whether
it is feasible and worthwhile. Is there a more pressing task you can do?
Can the same outcomes be achieved with a simpler method? Are the
timelines realistic? Remember, your supervisor doesn’t have their boots
on the ground, you do. So if you believe that something is not the right
call, let them know. Most good supervisors will be happy to listen to you
and either provide you with guidance on how to accomplish tasks or
revise their expectations. Either is a win. Provided that you are able to
communicate properly, there is nothing wrong with providing alternative
ideas. The following format works well if you want to refuse the work
given to you-
1. Point out what goal the proposed task is supposed to accomplish.
This shows that you understand the proposed task.
2. Talk about why you think the task might not be best (technical
challenges/scale/time etc).
3. Present your alternative.
4. If your alternative solves a different problem, then talk about why
solving that problem makes more sense given current
circumstances.
This format allows for open and constructive discussion. Steal it. If you
have any proposed changes, let me know in the comments/by replying to
this email/messaging me through my links.
41
42
42
43
Loved the post? Hate it? Want to talk to me about your crypto portfolio?
Get my predictions on the UCL or MMA PPVs? Want an in-depth analysis
of the best chocolate milk brands? Reach out to me by replying to this
email, in the comments, or using the links below.
Stay Woke,
Go kill all,
Devansh <3
Instagram: https://www.instagram.com/iseethings404/
Message me on Twitter: https://twitter.com/Machine01776819
My LinkedIn: https://www.linkedin.com/in/devansh-devansh-516004168/
My content:
My YouTube: https://rb.gy/88iwdd
43
44
Key Highlights
44
45
down, others can be used w/o any issues. This helps both
Availability (which we covered this Monday) and Security (for
authentication).
○ Increase Read Throughput - Many systems are extremely
read-heavy (way more reads than writes). Take Substack for
example. There are more readers on the platform than
writers. Thus there are many more read operations. than write
operations. Having multiple DBs can help spread the load of
multiple reads across multiple machines, increasing read
throughput.
3. Handling changes to replicated data- When you get a write request
that modifies your database, how do you make sure that all the
replicas reflect this write request? How do you stop replicas that
haven’t updated from responding with stale data to read requests?
You have 3 popular options-
○ Single Leader Architecture: In this architecture, one server
accepts client writes and replicas pull data from it. This is the
most popular and traditional way. It’s the synchronous
technique, but it’s also quite rigid.
○ Multi Leader Architecture: In this architecture, multiple
servers can accept writes and serve as a model for replicas.
To avoid delay, copies should be spread out and leaders
should be near all of them.
○ No Leader Architecture: Every server in this architecture can
receive writes and function as a replica model. While it
45
46
5.
6. Image Source
46
47
Almost all distributed databases use one of the three approaches and
they all have their pros and cons. We will do a more in-depth look into
these soon. In the meanwhile, if you want to learn more check out the
following resources. Much of the research for this write-up was inspired
by the amazing publication Quastor. I have been recommending their
publication for some time now. You can read their work here. I also
referred to Data Replication in Distributed Systems: The Best Guide 101,
an amazing article you can find here.
47
48
In the comments below, share what topic you want to focus on. I’d be
interested in learning and will cover them. To learn more about the
newsletter, check our detailed About Page + FAQs
If you liked this post, make sure you fill out this survey. It’s anonymous
and will take 2 minutes of your time. It will help me understand you
better, allowing for better content.
https://forms.gle/XfTXSjnC8W2wR9qT9
If you like my writing, I would really appreciate an anonymous
testimonial. You can drop it here.
Stay Woke,
Go kill all,
Devansh <3
Instagram: https://www.instagram.com/iseethings404/
Message me on Twitter: https://twitter.com/Machine01776819
My LinkedIn: https://www.linkedin.com/in/devansh-devansh-516004168/
My content:
My YouTube: https://rb.gy/88iwdd
48
49
49
50
Before you proceed, try to solve the problem yourself. This will really
strain your mental muscles. Once you’re done/have given up, read on.
50
51
2.
3. Quick Problem Solving relies on pattern Matching- The way
Micheal quickly runs through options might seem magic to you.
But it is something that all of you do very well- pattern matching. If
you’re struggling with a certain Data Structure or Algorithm- start
exposing yourself to a lot of questions about that DS/A.
Specifically, stick to the Easy Questions, which will let you build
pattern-matching skills. As I’ve covered here, Easy Questions are the
most important type of question that you should be working with for
learning an idea.
4. Attack a Problem from multiple angles- Notice how many different
ideas are pulled in to create the final solution. It’s not enough to
51
52
master one idea in isolation. You’re much better off seeing how
different ideas interact with each other. This will build much deeper
intimacy with these ideas.
5. Complex Solutions can have simple building blocks- None of the
ideas used in the articles are really that high-level. The concepts
needed to solve it are mostly high-school level. This question isn’t
hard because you need to know a lot. This question is hard
because you need to use what you know. In fact, many higher-level
math/computer science solutions are very similar to this. This is
why there is so much value in learning the basics. They will show
up everywhere.
With all that out of the way, take a look at the video. How did you do? Let
me know by replying to this email/post/using my social media links to
reach out to me.
A very interesting differential equation.
I created Technology Made Simple using new techniques discovered
through tutoring multiple people in top tech firms. The newsletter is
designed to help you succeed, saving you from hours wasted on
mediocre resources or on the Leetcode grind. Easily find your needs met
in one place. I have a 100% satisfaction policy, so you can try it out at no
risk to you. Use the button below to get 20% off for up to a whole year.
Using this discount will drop the prices-
800 INR (10 USD) → 533 INR (8 USD) per Month
52
53
Stay Woke,
Go kill all,
Devansh <3
My content:
Read my articles: https://rb.gy/zn1aiu
53
54
Some simple techniques to make sure your systems are much better.
I talk often about robust systems,
But how do you actually build systems that are robust? How can you
create software solutions that are robust? How can you decide what
makes a system robust, given a particular context? What is the
acceptable tradeoff between the simplicity of systems and their
robustness? These are all complex questions, ones that you will be paid
a lot of money to answer. But to get there, you need to answer a much
simpler question first.
What can you do to test whether a software solution is actually robust?
Take it live, and see how quickly bug reports pile in? That’s an option.
However, for those of you that are not brave in to try this out, here are a
few ways you can make test for a system for robustness.
54
55
55
56
56
57
57
58
Some of the nice things y’all have said. If you’d like to be a pal, drop me a
testimonial here
I created Technology Made Simple using new techniques discovered
through tutoring multiple people in top tech firms. The newsletter is
designed to help you succeed, saving you from hours wasted on
mediocre resources or on the Leetcode grind. Easily find your needs met
in one place. I have a 100% satisfaction policy, so you can try it out at no
risk to you. Use the button below to get 20% off for up to a whole year.
Using this discount will drop the prices-
800 INR (10 USD) → 533 INR (8 USD) per Month
8000 INR (100 USD) → 6400INR (80 USD) per year
Get 20% off for 1 year
If you like my writing, I would really appreciate an anonymous
testimonial. You can drop it here.
58
59
In the comments below, share what topic you want to focus on. I’d be
interested in learning and will cover them. To learn more about the
newsletter, check our detailed About Page + FAQs
If you liked this post, make sure you fill out this survey. It’s anonymous
and will take 2 minutes of your time. It will help me understand you
better, allowing for better content.
https://forms.gle/XfTXSjnC8W2wR9qT9
Stay Woke,
Go kill all,
Devansh <3
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
59
60
Source
While this news is very exciting it is important to consider all sides and
not get swept up by the headlines. A lot of people writing these
headlines/pushing the hype are people who haven’t truly done their
research and can thus share analysis that is inaccurate or incomplete.
As the stories shared many times in this newsletter show, nothing is
60
61
61
62
Key Points
1. Will OpenAI help Microsoft stand up to Google and Meta- In
simple words, nope. And not because of the reason you’re probably
thinking off. MS hasn’t been as attention-grabbing as the other 2
Tech Giants in the strides it has made in Machine Learning.
However, make no mistakes, MS has been a big player in the field
with a lot of respectable work In 2021, I did an analysis of the best
ML company of that year. MS came out on top. Put some respect
on their name. OpenAI would add a lot of value, but MS is certainly
no slouch in the Machine Learning space. People treating the Open
AI acquisition thought it will 1000x MS ML research. This is not
true and is purely hype.
2. MS has business data- One thing that I don’t see discussed much
is the abundance of business data that MS has access to. Thanks
to MS Office, they have datasets and insights that are curated for
business users (which are a higher-paying demographic). However,
business data is also inherently harder to deal with, even for large
language models like ChatGPT (more on this in the next point).
This might end up being either a blessing or a curse, depending on
how well this is handled. If there is a niche or topic you are very
interested in, now would be the time to go deep into it.
Understanding business rules and domain logic would make you a
viable hire for anyone trying to develop AI for these domains.
62
63
3. The Problem of LLMs- By this time, you have all heard about how
ChatGPT will threaten Google. I’ve gotten more forwards about this
than Good Morning Texts. Unfortunately, I wish these technologies
were as revolutionaries as Tik Tok and LinkedIn intellectuals make
them out to be. There are still many many problems with these
systems that need to be handled when implementing them in
scalable and secure solutions. Unless these challenges are
handled, the potential of language models is severely restricted. If
you want to know more about these problems, I covered them in
my sister publication, AI Made Simple, here. It is completely free, so
you will be able to access all content without paywalls. If you’re
into detailed AI breakdowns, check it out.
4. We already have alternatives- Another fact that puts some cold
water on the hype is that other companies already have their own
variants of language models. Here is a list of 5 massive models,
that you can access completely for free. Thus, the integration of
these models is will not be as big a competitive advantage as
people are making it out to be. Again, Open AI will add a lot of
value. No doubt. But it is not the Golden Gun that people are
portraying it to be.
5. How this will affect the business- In the short and medium terms,
this will likely increase the stickiness of MS Office. Given the
almost monopoly of Microsoft Office, I don’t see them getting new
customers based on the AI integrated. This move will more likely
just help them retain clients, giving them another reason to stay. In
63
64
7.
8. Whether you’re a technical engineer, manager, or another kind of
tech professional, I have something for you.
64
65
Stay Woke,
Go kill all,
Devansh <3
My content:
65
66
My YouTube: https://rb.gy/88iwdd
66
67
67
68
My writing has helped students and professionals. Hit the next level by
subscribing to the newsletter. Remember, we have a full refund policy, so
you can try at it out at no risk.
68
69
has been applied in the real world. Watch the videos/read the
blogs, to see how different teams applied this idea to solve
problems. These blogs/videos are great for various reasons- they
help you see how people are solving problems IRL, appreciate the
tradeoffs you would have to make when designing systems, and
see how this concept slots into larger systems. This is the step you
can’t skip if you want to reach the expert level.
4. Try to Spot it in real life- Once you have a deep appreciation of the
idea, now is the time to start trying to spot different
implementations of this idea. Say you’ve just learned about Graphs
and their relational nature. You know you can use them to visualize
the components of your system. Now is when you think about how
you could possibly use GNNs and their ability to help you spot
fraud. Think about engineers at Facebook might use it to create
more personalized ads. This step is crucial in translating technical
challenges into business outcomes.
5. Peel back the Layers and Repeat- Finally, we come to the step that
most people do first (and thus they struggle with learning). Once
you have a very strong understanding of the utility of the concept, it
is now time to start understanding the theoretical basis. What is
the proof for certain bounds? How can you derive the important
algorithms? This is the final step. This step will add a lot of solidity
to your knowledge. And it will teach you the problem-solving
techniques to invent ideas of your own.
69
70
70
71
71
72
No matter how well the student did in their theoretical CS course, they
don’t look at their code compiling and think of the Backus–Naur Form and
the developers of the language might have used it.
-Personal Observation
The problem with this is that they are learning these ideas in isolation.
Even if they are able to get through all the technical proofs and get to use
the idea, they only really master the concepts in isolation. You may be
able to build complex neural networks completely from scratch, but that
means nothing if you lack the insight as to when neural networks should
72
73
73
74
Notice how this plan is geared at hitting the higher levels of learning.
Read more
When you learn the history behind an idea, force yourself to evaluate the
strengths and weaknesses, and try to think of how variants can be
developed, you are engaging with the higher levels of learning. Even if
you’re not successful (you probably won’t get the full scope), your
learning will be on steroids.
74
75
There’s a reason that my readers are able to ace their interviews, even
when they don’t get exactly the same questions. Because they develop
insight into these ideas.
For a practical example of how understanding the full nuance of a Data
Structure can be key to mastering it, take a look at the post I did on
spotting graphs in your interviews. The framework for spotting the
graphs comes out of understanding why Graphs are powerful and how
they help us encode relationships. Students have utilized it for great
results. I’m sure you will too.
Loved the post? Hate it? Want to talk to me about your crypto portfolio?
Get my predictions on the UCL or MMA PPVs? Want an in-depth analysis
of the best chocolate milk brands? Reach out to me by replying to this
email, in the comments, or using the links below.
Stay Woke,
Go kill all,
Devansh <3
75
76
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
76
77
One of you reached out and texted me that I hadn’t covered a mock
interview in a while,
I went back through the archives and turns out this was very true.
Anyone who has worked with me knows that I’m a huge believer in the
power of watching mock interviews in learning to communicate
better/come across new ideas. It’s similar to how athletes study footage
of top performers and how writers are told to read a lot to improve the
quality of their work.
So here is another excellent mock interview for you to study. Make sure
you watch the video, study the points he makes, and think about whether
you agree or disagree with them. How would you do things differently?
As we covered in the how to learn DSA post yesterday, making your
compare and contrast various ideas is a great way of learning the idea
on a deeper level.
77
78
As you watch the Mock Interview, here are a few things I want you to look
out for. These are things that I think the interviewee did really well, that
you should definitely integrate into your mock interviews. I’ll also leave
some actions you can take, to further improve upon this performance.
78
79
79
80
6.
One of the reasons I can get the most impactful trends is that I study
information from a variety of sources. Helps me understand topics
better.
With all these points covered, it is now time for you to watch and learn
from the mock interview. Happy Watching my dearest cult member.
80
81
in one place. I have a 100% satisfaction policy, so you can try it out at no
risk to you. Use the button below to get 20% off for up to a whole year.
Using this discount will drop the prices-
800 INR (10 USD) → 533 INR (8 USD) per Month
8000 INR (100 USD) → 6400INR (80 USD) per year
Get 20% off for 1 year
In the comments below, share what topic you want to focus on. I’d be
interested in learning and will cover them. To learn more about the
newsletter, check our detailed About Page + FAQs
If you liked this post, make sure you fill out this survey. It’s anonymous
and will take 2 minutes of your time. It will help me understand you
better, allowing for better content.
https://forms.gle/XfTXSjnC8W2wR9qT9
If you like my writing, I would really appreciate an anonymous
testimonial. You can drop it here.
Stay Woke,
Go kill all,
Devansh <3
81
82
Instagram: https://www.instagram.com/iseethings404/
Message me on Twitter: https://twitter.com/Machine01776819
My LinkedIn: https://www.linkedin.com/in/devansh-devansh-516004168/
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
82
83
83
84
84
85
Coding Interviews Made Simple was the old Name, hence which is why
this is mentioned in the review.
Sound like a Jam? Let’s get right into it. This might get a little abstract
for you, so I have a video linked below where you can apply this process
first-hand.
85
86
4.
5. Recognize the problem with the existing metric- Next step is to
figure out what exactly the problem your current metric is. In my
case, we noticed that MSE flattens the multi-dimensional errors.
We were working with a multi-variate prediction system, where
each target value had a different priority and units of
measurement. Blindly applying MSE would not allow us to study
the prediction engine in depth. So we made a few changes, using
MSE as a baseline to create a new metric that helped us calculate
our system’s weighted deviation from expected values. Once you
have figured out the problem, make the required changes, using the
operations described.
6. Keep Going Back to your Metric- Remember that any metric you
use (whether your own or a standard one) is not a gift from God.
Changing it will not cause the next great flood. Every Metric comes
with certain assumptions and simplifications you make about the
problems you’re solving. You have to keep going back and revising
the metric, at least checking if it is still valid. Far too often, teams
get married to their metric and dedicate their resources to
improving it. Remember, the goal is not to get a high score/low error,
86
87
87
88
A reminder to anyone looking for work- I post job openings very regularly
on my Instagram stories. By following me there, you can get access to
job openings for free. My Instagram can be found here (@iseethings404)
I created Technology Made Simple using new techniques discovered
through tutoring multiple people in top tech firms. The newsletter is
designed to help you succeed, saving you from hours wasted on
88
89
mediocre resources or on the Leetcode grind. Easily find your needs met
in one place. I have a 100% satisfaction policy, so you can try it out at no
risk to you. Use the button below to get 20% off for up to a whole year.
Using this discount will drop the prices-
800 INR (10 USD) → 533 INR (8 USD) per Month
8000 INR (100 USD) → 6400INR (80 USD) per year
Get 20% off for 1 year
In the comments below, share what topic you want to focus on. I’d be
interested in learning and will cover them. To learn more about the
newsletter, check our detailed About Page + FAQs
If you liked this post, make sure you fill out this survey. It’s anonymous
and will take 2 minutes of your time. It will help me understand you
better, allowing for better content.
https://forms.gle/XfTXSjnC8W2wR9qT9
If you like my writing, I would really appreciate an anonymous
testimonial. You can drop it here.
Stay Woke,
Go kill all,
Devansh <3
89
90
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
90
91
I’m excited to share today’s problem with you. It’s a great practice
question, one that can teach you a lot.
This problem can be found as problem 98. Validate Binary Search Tree
Problem
Given the root of a binary tree, determine if it is a valid binary search tree
(BST).
A valid BST is defined as follows:
● The left subtree of a node contains only nodes with keys less than
the node's key.
● The right subtree of a node contains only nodes with keys greater
than the node's key.
● Both the left and right subtrees must also be binary search trees.
91
92
Example 1:
Output: true
Example 2:
Output: false
92
93
Explanation: The root node's value is 5 but its right child's value is 4.
Constraints:
● The number of nodes in the tree is in the range [1, 104].
● -2^31 <= Node.val <= 2^31 - 1
93
94
In the comments below, share what topic you want to focus on. I’d be
interested in learning and will cover them. To learn more about the
newsletter, check our detailed About Page + FAQs
If you liked this post, make sure you fill out this survey. It’s anonymous
and will take 2 minutes of your time. It will help me understand you
better, allowing for better content.
https://forms.gle/XfTXSjnC8W2wR9qT9
If you like my writing, I would really appreciate an anonymous
testimonial. You can drop it here.
Stay Woke,
Go kill all,
Devansh <3
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
94
95
How did you with this question? I’d love to hear from you.
95
96
This problem can be found as problem 98. Validate Binary Search Tree
Problem
Given the root of a binary tree, determine if it is a valid binary search tree (BST).
● The left subtree of a node contains only nodes with keys less than the node's key.
● The right subtree of a node contains only nodes with keys greater than the node's key.
● Both the left and right subtrees must also be binary search trees.
Example 1:
Example 2:
96
97
Constraints:
Proven results, backed by the only refund guarantee in the space. What’s
stopping you from taking that next step.
97
98
sure you check out the how Master DSA guide here). Since they are such
a core concept, I don’t think any interviewer would need you to flesh out
the nuances and really look into the definitions. Therefore it makes a lot
more sense to jump into creating the brute-force first, since it saves you
a lot of time.
What would the brute force of this validation be. Simple. We could do the
following-
start at the node.
Check if children are compliant with the requirement
Then keep going down, checking if the other descendants match meet
this requirement.
This should make a few things clear. The brute-force would implement a
kind of recursive DFS. We would use a node and we go through every
subtree to confirm whether the subtree is a BST, both by itself, and with
the original source node.
98
99
99
100
100
101
Image Source
Why is this relevant? Look back our current brute-force. We do a lot of
repeated work because once we have validated one subtree, we don’t
discard all of our computations to get the results. We don’t really take
advantage of the unique structure of the Binary Search Tree or the
transitive property of inequality to speed up our operations. So as a
natural next step, it’s now time to look into this.
101
102
Let’s take a second to think about what truly makes a valid BST. Given a
node can we come up with some rules to determine if it is part of a valid
subtree?
We know that a node has to be greater than all the nodes to it’s left and
smaller than all the nodes to it’s right. Another, easier way to say this is
that it must be in a certain range. It will have to be greater than the
biggest value to it’s left and lesser than the smallest value to it’s right.
We encode this insight with the following condition-
(node.val < right and node.val > left)
So how do we go about getting the left and right?
We already know what they are. We will get them from the nodes we
have already visited. How? Here is the process-
1. We know that if we consider just the root, then every value is a valid
BST. Thus, our left and right range would be bounded between +/-
infinity.
2. If we go to the left subtree of a node, then we know that the node’s
value is the maximum acceptable value. Anymore, and our tree is
no longer to a BST. Thus we should step into the subtree and
change the right bound to the node.val.
3. The opposite is true when we step into the right subtree. Now,
every value must be greater than the current node value. So we
change the left bound to reflect this property.
This gives us all the necessary pieces to put the final solution. Before
you proceed, drink some water. Reread everything we have covered so
far. Make sure it makes sense. Step away from the screen and come
back in 10 minutes. Make sure things still make sense. This is a very
102
103
Step 4: Coding It Up
If you’re here, coding things should not be too hard. If you have a hard
time coming up with code in a methodical way, check out the recursive
template that we covered here. Since we don’t have any side effects, the
first 3 steps are the ones that are relevant. Take a look at the them
below-
103
104
Now compare this with the solution code. Notice how smoothly this
works. I wrote this template months ago. That is the power of drilling
down to the basics and building up from there.
class Solution:
def isValidBST(self, root: TreeNode) -> bool:
def valid(node, left, right):
if not node:
return True
if not (node.val < right and node.val > left):
return False
104
105
Space Complexity- O(log n) [counting the stack frame]. Worst case O(n)- happens
when tree is very unbalanced.
Loved the solution? Hate it? Want to talk to me about your crypto
portfolio? Get my predictions on the UCL or MMA PPVs? Want an
in-depth analysis of the best chocolate milk brands? Reach out to me by
replying to this email, in the comments, or using the links below.
Stay Woke,
Go kill all,
Devansh <3
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
105
106
106
107
met Ken in Jan 2022, before I had real ‘clout’. Back then, I had started to
commit more to my writing. This newsletter had fewer than 100 readers
(and 0 paying subs). Back then, I was a complete nobody. However,
using the principles that I will go over in this article, I was able to stand
out from the thousands of other people who try to reach out to him. And
you will too.
107
108
The Story
1. Find their work- The first and most overlooked step to networking
with people, especially those that are more prominent is to really
seek out their work. What does this mean? Say you wanted a
referral from an employee at Google named DJ-EQ. The standard
advice is to send a connection request, saying something like, “Hey
DJ-EQ, I am interested in working at Google. Have a few questions,
that I would love to get your input on. Would love to connect and
talk further“. If you’re from the same university/city/former
company, you might throw that in. This is not bad advice, but it is
extremely boring. This will work if you have a strong connection
with them (mutual friends, you’re involved in something they’re
passionate about, etc), but there’s a high likelihood you’ll be
ignored. A better bet is to find their work. Go through their old
posts/Googling them online and find out something that you can
use as a crutch to reach out to them. This gives them a reason to
want to talk to you, beyond just the frame of them being an
employee at a company you’re into. In Ken’s case, this was
relatively straightforward. He has a giant YouTube channel, in a
very similar domain to mine (my work is geared more towards
108
109
3.
4. Image Source
5. Speak their lingo- An important component of the above point is to
speak the language of the people you’re talking to. Ken’s videos are
geared towards beginners and focus more on the
behaviors/principles that allow data scientists to excel. It would be
foolish for me to go into my AI Research breakdowns or use more
advanced jargon. I save this for a creator like Yannic Kilcher, who
covers the important developments in Machine Learning and AI
Research.
109
110
110
111
amount of time you spend reaching out to them, and spend time on
the ones that appreciate your presence. Say your goal is to reach
10 people per week. If 20% of people reply, that’s 2 new engaged
connections per week. Don’t underestimate how much of an
impact this can make.
9.
10. Even in this newsletter, which people have to sign up for, only
about 20% of people open my emails regularly. When you’re trying
to work with people, keep a thick skin.
Once you actually add a person to your network, you want to water your
garden and foster your relationship with them. I will do a separate post
on this, so keep your eyes peeled. In the meantime, use these techniques
to stand out and network with Tech Leaders, the right way.
Loved the post? Hate it? Want to talk to me about your crypto portfolio?
Get my predictions on the UCL or MMA PPVs? Want an in-depth analysis
of the best chocolate milk brands? Reach out to me by replying to this
email, in the comments, or using the links below.
Stay Woke,
111
112
Go kill all,
Devansh <3
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
112
113
Key Principles
1. Good Cakes have layers- Far too often, the temptation while
designing systems is to spend a lot of time and resources trying to
engineer the perfect solution for individual tasks. This is very costly
and time-consuming. You’re much better off layering multiple
113
114
2.
3. Handling Multi-Modal Search- Google search consists of far more
than images. We have images, text, gifs, and videos (in multiple
languages). How can you build an engine to accommodate all of
this? How can we compare the difference in the quality of search
output for the various kinds of search results? One easy solution is
to use User Engagement. Using user engagement to train a
Universal Search Aggregator and your other models would work
well. If I had to make a prediction for the future, my guess is that
Google is working on transcribing the various outputs into a
common latent space. This would allow them to integrate YouTube,
into their search results more heavily. As of now, the knowledge on
YouTube has been largely untouched (videos are linked in search
results but that’s it).
114
115
4.
5. On the labeling of data- Damien rightly points out that manually
labeling data at the scale of Google is not practical. I think they
handle this problem using semi-supervised labeling. This approach
can be used to handle lots of unlabeled data, and it tends to work
very well. The image below is one such example of Google
Researchers using SSL to hit peak performance.
115
116
116
117
risk to you. Use the button below to get 20% off for up to a whole year.
Using this discount will drop the prices-
800 INR (10 USD) → 533 INR (8 USD) per Month
8000 INR (100 USD) → 6400INR (80 USD) per year
Get 20% off for 1 year
In the comments below, share what topic you want to focus on. I’d be
interested in learning and will cover them. To learn more about the
newsletter, check our detailed About Page + FAQs
If you liked this post, make sure you fill out this survey. It’s anonymous
and will take 2 minutes of your time. It will help me understand you
better, allowing for better content.
https://forms.gle/XfTXSjnC8W2wR9qT9
If you like my writing, I would really appreciate an anonymous
testimonial. You can drop it here.
Stay Woke,
Go kill all,
Devansh <3
117
118
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
118
119
119
120
In mathematics, a group is a set and an operation that combines any two elements of the set to
produce a third element of the set, in such a way that the operation is associative, an identity
element exists and every element has an inverse. These three axioms hold for number systems
and many other mathematical structures.
-The definition of a group can easily be applied to objects and instances.
Key Highlights
1. What is Group Theory- Group theory is a branch of math that
studies the groups. The principles of group theory help in
understanding the concept of inheritance and polymorphism in
OOP.
2. What is Inheritance in OOP? How Groups are relevant- Inheritance
in OOP allows classes to inherit properties from their parent
classes, just like groups can inherit properties from their
subgroups. In this way, objects can be organized in a hierarchical
structure, with common properties defined at higher levels and
specialized properties defined at lower levels.
3. What is Polymorphism in OOP? How Groups are relevant-
Polymorphism allows objects to take on multiple forms. This
concept is modeled by group actions, where the elements of a
group act on a set to produce new elements, just as objects can
take on different forms based on their methods.
4. Group Theory as a Framework for design- Group theory also
provides a framework for understanding the relationships between
classes and objects in OOP. This can be useful in creating more
efficient algorithms and designing more modular systems.
5. Where to learn it- YouTube and other online platforms have tons of
courses. Take a look through them and try some out. For a guide
on how to learn it better, check out my post on why math is a
120
121
language. Also, make sure you’ve read all the other posts on the
recommended reading list right here.
You should see that Group Theory provides valuable insights into the
concepts of inheritance and polymorphism in OOP. It can help you in
designing more organized, efficient, and modular systems. So don’t sleep
on it.
121
122
If you liked this post, make sure you fill out this survey. It’s anonymous
and will take 2 minutes of your time. It will help me understand you
better, allowing for better content.
https://forms.gle/XfTXSjnC8W2wR9qT9
If you like my writing, I would really appreciate an anonymous
testimonial. You can drop it here.
Stay Woke,
Go kill all,
Devansh <3
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
122