Idea behind Bit shifting [Math Monday]
Don't neglect learning about Binary Math for your interviews. A little bit of practice goes a long way.
How’s it going y’all,
I’m currently exploring to Fairbanks (Alaska), so I’m having a great start to the week. I was able to see the Northern Lights for the first time yesterday. They are truly one of a kind. Make sure you check them out, at least once in your life. No pictures do them justice.
Getting into the topic for today, we are covering a very important math idea. I’m sure a lot of you have got some exposure to Binary Numbers, but that is not enough. Problems that involve bit shifting and transitions between number systems can be very tricky. Understanding these ideas will be critical to solving about 10-15% of the interview questions at bigger companies.
This video is a great introduction to one of the most important algorithms in the world. As you get into Computer Science, you will continue to come across more such concepts. Make sure you take your time and understand the ideas expressed in this video.
There are a few foundational Math skills that are shown in this video that you should know. Fortunately, with a bit of practice, they are simple. Look into the following topics:
Modular Arithmetic- Understanding the use of Mods (%) in computations is very crucial. For your coding interviews, a baseline familiarity with the Mod function is enough. Look at how the 3 values - number 1 % number 2= number 3 are related. In your interviews, the challenge will be spotting the use of the mod function, as opposed to using it. Unless you’re a math person like me, in which case they might go wild.
Number Systems- A lot of the bit manipulation questions will require you to switch between different number bases. While Binary and Base 10 are the most common, many questions will require you to use other bases. Understanding how number systems bases work, and how to transition between them is crucial.
Recursion- This is pretty clear. I have posts going into Recursion here and here. Read them.
The first two ideas will be generally easy to code up. However, understanding them to a degree that you can identify problems that would use them is crucial.
**Special Offer** Get 5 FREE STOCKS from Webull
To my readers based in the USA, I have a really cool offer. Open up your account with Webull, and you get 5 FREE Stocks. Hurry and take advantage of this promo, before it runs out. Use my referall link below.
https://a.webull.com/6rhBWSFwyfZhnIe3yz
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
Happy Prep. I’ll see you at your dream job.
Mike Pound is GOATed,
Devansh <3
To make sure you get the most out of Math Mondays, make sure you’re checking in the rest of the days as well. Leverage all the techniques I have discovered through my successful tutoring to easily succeed in your interviews and save your time and energy by joining the premium subscribers down below. Get a discount (for a whole year) using the button below
Reach out to me on:
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
Get a free stock on Robinhood. No risk to you, so not using the link is losing free money: https://join.robinhood.com/fnud75