<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Ashutosh Kumar</title>
    <description>The latest articles on Forem by Ashutosh Kumar (@atkumar).</description>
    <link>https://forem.com/atkumar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F545284%2F7b6c1087-dc99-4a90-aa6d-5ad0afe3acc6.jpeg</url>
      <title>Forem: Ashutosh Kumar</title>
      <link>https://forem.com/atkumar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/atkumar"/>
    <language>en</language>
    <item>
      <title>10 Things You Didn’t Know You Could Do in Python3</title>
      <dc:creator>Ashutosh Kumar</dc:creator>
      <pubDate>Fri, 11 Aug 2023 08:18:53 +0000</pubDate>
      <link>https://forem.com/atkumar/10-things-you-didnt-know-you-could-do-in-python3-3196</link>
      <guid>https://forem.com/atkumar/10-things-you-didnt-know-you-could-do-in-python3-3196</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AgxAfJuXjvwkbSEUg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AgxAfJuXjvwkbSEUg" alt="Representative image showing code in laptop" width="800" height="478"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Alex Chumak on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Python is the third most commonly-used programming language. It has introduced many new features, simplifying and enhancing the development process. Yet, many developers remain unaware of the full potential that Python 3 has to offer.&lt;/p&gt;

&lt;p&gt;This article will uncover ten lesser-known and underutilized capabilities in Python (v3.5 to v3.11). These hidden gems can improve your coding efficiency and productivity. So, without further ado, let’s dive into these fascinating Python 3 features.&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Walrus Operator
&lt;/h3&gt;

&lt;p&gt;It’s a new syntax introduced in &lt;a href="https://docs.python.org/3/whatsnew/3.8.html#assignment-expressions" rel="noopener noreferrer"&gt;Python 3.11&lt;/a&gt; that assigns values to variables as part of a larger expression.&lt;/p&gt;

&lt;p&gt;Old way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = "This is a sample string text"

if len(a) &amp;gt; 10:
    print("Length of string a = ", len(a))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;New way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = "This is a sample string text"

if (len_a := len(a)) &amp;gt; 10: # Note the walrus operator will compute value of len(a) and assign it to variable len_a
    print("Length of string a = ", len_a)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Structural Pattern Matching
&lt;/h3&gt;

&lt;p&gt;You might remember reading that Python doesn’t support switch statements because if-else can achieve the same result. You are in for a treat. &lt;a href="https://docs.python.org/3/whatsnew/3.10.html#simple-pattern-match-to-a-literal" rel="noopener noreferrer"&gt;Python3.10&lt;/a&gt; introduced something similar.&lt;/p&gt;

&lt;p&gt;Old way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def http_error(status):
    if status == 400:
        return "Bad request"
    elif status == 404:
        return "Not found"
    elif status == 418:
        return "I'm a teapot"
    else:
        return "Something's wrong with the internet"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;New way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def http_error(status):
    match status:
        case 400:
            return "Bad request"
        case 404:
            return "Not found"
        case 418:
            return "I'm a teapot"
        case _: # This is a wildcard operator
            return "Something's wrong with the internet"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Merging Dictionaries
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.python.org/3/whatsnew/3.9.html#dictionary-merge-update-operators" rel="noopener noreferrer"&gt;Python3.9&lt;/a&gt; introduced a new way of merging or updating dictionaries. It complements the existing dict.update and {**d1, **d2} methods of merging dictionaries.&lt;/p&gt;

&lt;p&gt;Old way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = {"key1": "value1 from x", "key2": "value2 from x"}
y = {"key2": "value2 from y", "key3": "value3 from y"}

print({ **x,** y})
print({ **y,** x}) # Note here keys of y would be given preference over keys of x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;New way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = {"key1": "value1 from x", "key2": "value2 from x"}
y = {"key2": "value2 from y", "key3": "value3 from y"}

# Note the usage of OR (|) operator
print(x | y)
prin(y | x) # Note here keys of y would be given preference over keys of x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Removing Prefix or Suffix
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.python.org/3/whatsnew/3.9.html#new-string-methods-to-remove-prefixes-and-suffixes" rel="noopener noreferrer"&gt;Python3.9&lt;/a&gt; introduced dedicated methods to get rid of prefixes or suffixes in strings.&lt;/p&gt;

&lt;p&gt;Old way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = "prefixstring"
y = "stringsuffix"

print(x.split("prefix")[-1])
print(y.split("suffix")[0])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;New way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = "prefixstring"
y = "stringsuffix"

print(x.removeprefix("prefix"))
print(y.removesuffix("suffix"))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Positional Only Parameters
&lt;/h3&gt;

&lt;p&gt;Python provides to define positional and keyword arguments for a function. But you can pass them interchangeably. &lt;a href="https://docs.python.org/3/whatsnew/3.8.html#positional-only-parameters" rel="noopener noreferrer"&gt;Python3.8&lt;/a&gt; introduced a way to enforce that you cannot pass positional arguments as keyword arguments.&lt;/p&gt;

&lt;p&gt;Old way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def fun(pos_arg1, pos_arg2, key_arg_1 = None):
    print("positional arguments: ", pos_arg1, pos_arg2)
    print("Keyword arguments: ", key_arg_1)

# It will work
fun(1, 2, 3) # Passing keyword argument as positional argument

# It will also work
fun(pos_arg1=1, pos_arg2=2, key_arg_1=3) # Passing positional argument as keyword argument
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;New way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def fun(pos_arg1, pos_arg2, /, key_arg_1 = None):
    print("positional arguments: ", pos_arg1, pos_arg2)
    print("Keyword arguments: ", key_arg_1)

# It will work
fun(1, 2, 3) # Passing keyword argument as positional argument

# It won't work
fun(1, pos_arg2=2, key_arg_1=3) # Passing one positional argument as keyword argument
fun(pos_arg1=1, pos_arg2=2, key_arg_1=3) # Passing both positional arguments as keyword argument
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  6. Time with nanoseconds Precision
&lt;/h3&gt;

&lt;p&gt;Did you ever need nanosecond precision in getting time to compare code performances? &lt;a href="https://docs.python.org/3/whatsnew/3.7.html#pep-564-new-time-functions-with-nanosecond-resolution" rel="noopener noreferrer"&gt;Python3.7&lt;/a&gt; introduced new methods in the time library.&lt;/p&gt;

&lt;p&gt;Old way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import time

start = time.time()
end = time.time()

print(end - start)
# Provides sub-second precision, though that precision varies by platform
# &amp;gt;&amp;gt; 2.7179718017578125e-05 Notice the precision is in e-05
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;New way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import time

start = time.time_ns()
end = time.time_ns()

print(end - start)
# Provides nanosecond precision
# &amp;gt;&amp;gt; 47000 Notice the figure is in nanoseconds
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7. f-strings
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.python.org/3/whatsnew/3.6.html#pep-498-formatted-string-literals" rel="noopener noreferrer"&gt;Python3.6&lt;/a&gt; introduced f-strings to provide an easy way of formatting strings.&lt;/p&gt;

&lt;p&gt;Old way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 1

print("Value of a = {}".format(a))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;New way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 1

print(f"Value of a = {a}")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  8. Underscores in Numeric Literals
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.python.org/3/whatsnew/3.6.html#pep-515-underscores-in-numeric-literals" rel="noopener noreferrer"&gt;Python 3.6&lt;/a&gt; introduced allowing adding underscores in numeric literals for better readability.&lt;/p&gt;

&lt;p&gt;Old way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 1000000000000000 # try counting the number of 0's

print(type(a))
# &amp;gt;&amp;gt; &amp;lt;class 'int'&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;New way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 1_000_000_000_000_000

print(type(a))
# &amp;gt;&amp;gt; &amp;lt;class 'int'&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  9. Matrix Multiplication Operator
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.python.org/3/whatsnew/3.5.html#pep-465-a-dedicated-infix-operator-for-matrix-multiplication" rel="noopener noreferrer"&gt;Python3.5&lt;/a&gt; introduced a dedicated @ infix operator for matrix multiplication.&lt;/p&gt;

&lt;p&gt;Old way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import numpy

x = numpy.ones(3)
m = numpy.eye(3)

print(x.dot(m))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;New way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import numpy # NumPy 1.10 has support for the new operator:

x = numpy.ones(3)
m = numpy.eye(3)

print(x @ m) # @ is the new matrix matrix-multiplication operator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  10. Approximate Equality
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.python.org/3/whatsnew/3.5.html#pep-485-a-function-for-testing-approximate-equality" rel="noopener noreferrer"&gt;Python3.5&lt;/a&gt; introduced dedicated methods to tell whether two values are approximately equal or “close” to each other.&lt;/p&gt;

&lt;p&gt;Old way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 5.0
b = 4.99998

print(abs(a - b) &amp;lt;= 1e-5)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;New way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import math

a = 5.0
b = 4.99998

print(math.isclose(a, b, rel_tol=1e-5))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://docs.python.org/3/whatsnew/3.11.html" rel="noopener noreferrer"&gt;Python3.11 Change-log&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.python.org/3/whatsnew/3.10.html" rel="noopener noreferrer"&gt;Python3.10 Change-log&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.python.org/3/whatsnew/3.9.html" rel="noopener noreferrer"&gt;Python3.9 Change-log&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.python.org/3/whatsnew/3.8.html" rel="noopener noreferrer"&gt;Python3.8 Change-log&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.python.org/3/whatsnew/3.7.html" rel="noopener noreferrer"&gt;Python3.7 Change-log&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.python.org/3/whatsnew/3.6.html" rel="noopener noreferrer"&gt;Python3.6 Change-log&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.python.org/3/whatsnew/3.5.html" rel="noopener noreferrer"&gt;Python3.5 Change-log&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>programming</category>
      <category>technology</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
    <item>
      <title>You Could Be Wrong About Probability</title>
      <dc:creator>Ashutosh Kumar</dc:creator>
      <pubDate>Tue, 08 Aug 2023 13:58:00 +0000</pubDate>
      <link>https://forem.com/atkumar/you-could-be-wrong-about-probability-35p6</link>
      <guid>https://forem.com/atkumar/you-could-be-wrong-about-probability-35p6</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz64i6gitxxflglh7cxif.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz64i6gitxxflglh7cxif.jpg" alt="Representative image for article showing two dices" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Probability has always fascinated me. It makes the hidden backbone of Machine Learning and Artificial Intelligence. I had the opportunity to study it in school and college. But it wasn't until I took up courses on Bayesian Statistics that I realized how wrong my understanding was about it.&lt;/p&gt;

&lt;p&gt;You might have studied probability in school or college. You might have come across the question, "What's the probability of getting heads on tossing a coin"? If your answer is &lt;code&gt;1/2&lt;/code&gt;, think again. It's where it gets interesting.&lt;/p&gt;

&lt;p&gt;Mathematics is generally viewed in light of being "consistent". We assume that a problem would always have the same solution no matter how we solve it. It's true except for when it comes to probability. Probability stands like an exception in that it has three different definitions or frameworks. Approaching the same problem with these definitions could yield different (and valid) answers.&lt;/p&gt;

&lt;p&gt;To showcase the same, let's consider the following problem. We will solve it using all three frameworks of Probability. One thing common across all the frameworks is that the total probability of all the outcomes of an experiment is always &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;"My friend Sovit gave me a coin. He didn't tell me if the coin is fair or not. What's the probability of getting heads on this coin?"&lt;/p&gt;

&lt;h2&gt;
  
  
  Classical Framework
&lt;/h2&gt;

&lt;p&gt;It's the simplest framework in probability. It's also the easiest to understand.&lt;/p&gt;

&lt;p&gt;The classical framework says that "Equally likely outcomes have equal probability".&lt;/p&gt;

&lt;p&gt;In the above problem, we don't know if the coin is fair. We cannot say if getting heads is equally likely as getting tails. So, we cannot solve this problem using the classical framework.&lt;/p&gt;

&lt;p&gt;But to showcase the usage of this framework, let's assume that the coin is fair. It means that getting heads is equally likely as getting tails. Since these are the only two possible outcomes and the total probability is &lt;code&gt;1&lt;/code&gt;, the probability of getting heads is &lt;code&gt;1/2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The classical framework might look rudimentary but it's also the most abused framework. Arguments like "Either there's life on Mars or there isn't and so the probability of existence of life on Mars in &lt;code&gt;1/2&lt;/code&gt;" are wrong. Because the classical framework only works when outcomes are equally likely. In this case, the existence and non-existence of life on Mars are not equally likely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequentist Framework
&lt;/h2&gt;

&lt;p&gt;It's one of the most used frameworks in probability. If you have solved any problem in probability, you might have likely used the frequentist framework to do so.&lt;/p&gt;

&lt;p&gt;The frequentist framework says that to compute the probability of an event, we need to conduct an experiment and observe the outcome. Repeat the experiment an infinite number of times. And, the probability of the event is &lt;code&gt;P(E) = Count(favorable outcomes) / Count(total outcomes)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In practice, we cannot conduct an experiment an infinite number of times. So, we do it a finitely large number of times. For our problem, let's conduct the experiment &lt;code&gt;10&lt;/code&gt; times. Let's assume that we got &lt;code&gt;6&lt;/code&gt; heads and &lt;code&gt;4&lt;/code&gt; tails. So, the probability of getting heads is &lt;code&gt;0.6&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The frequentist framework also has limitations. Consider the problem to find the probability of rain tomorrow. By definition, we need to have an infinite number of parallel universes. Then we would need to observe the tomorrow in each of these universes and count the ones where it's raining. But, it's not possible. Besides, why would we compute the probability of rain tomorrow if we can observe tomorrow?&lt;/p&gt;

&lt;h2&gt;
  
  
  Bayesian Framework
&lt;/h2&gt;

&lt;p&gt;It's one of the most used frameworks in probability. It's also the easiest to understand but difficult to work with.&lt;/p&gt;

&lt;p&gt;Bayesian framework says that the probability of an event is what you think it is. It's more about your personal perspective. You are watching cricket and Sachin Tendulkar is at &lt;code&gt;94&lt;/code&gt;. You exclaim there's a &lt;code&gt;90%&lt;/code&gt; chance that he would hit a century. That's your Bayesian probability of the event.&lt;/p&gt;

&lt;p&gt;So far in the above two frameworks, we have missed focusing on other key information in the problem: "My friend Sovit gave me the coin". Sovit is my friend and I know him. He has given me other coins in the past. Let's say that those coins had a probability of &lt;code&gt;0.4&lt;/code&gt; of turning heads. It's called "prior" information. The above two frameworks don't have any way of using it. It's where the Bayesian framework shines. It allows us to use both the prior information and the data, unlike the frequentist framework that relies only on data. We will have to assume how much we trust our prior and how much we trust our data. Let's say we trust both &lt;code&gt;50%&lt;/code&gt; (called weights). The probability of heads then would be a weighted average of prior and data: &lt;code&gt;0.5 * 0.4 + 0.5 * 0.6 = 0.5&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The Bayesian framework can provide more realistic answers by utilizing prior information. But, we have to make assumptions on weights. This is the critical point of criticism. Since we make assumptions, it is possible to skew the results based on our biases.&lt;/p&gt;




&lt;p&gt;So, that's all about probability and it's different frameworks. Let me know in the comments if this blew your mind as it did mine. Give me some claps if you liked the article.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resources&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Courses that I did on &lt;a href="https://www.coursera.org/learn/bayesian-statistics" rel="noopener noreferrer"&gt;Bayesian Statistics: Bayesian Statistics: From Concept to Data Analysis&lt;/a&gt; and &lt;a href="https://www.coursera.org/learn/mcmc-bayesian-statistics" rel="noopener noreferrer"&gt;Bayesian Statistics: Techniques and Models&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>datascience</category>
      <category>machinelearning</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Write Impeccably Clean Code That Will Save Your Sanity</title>
      <dc:creator>Ashutosh Kumar</dc:creator>
      <pubDate>Thu, 27 Jul 2023 19:53:03 +0000</pubDate>
      <link>https://forem.com/atkumar/how-to-write-impeccably-clean-code-that-will-save-your-sanity-4np9</link>
      <guid>https://forem.com/atkumar/how-to-write-impeccably-clean-code-that-will-save-your-sanity-4np9</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79b82k7spcmrvfzdb8a6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79b82k7spcmrvfzdb8a6.png" alt="The Zen of Python" width="800" height="590"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Article published on &lt;a href="https://levelup.gitconnected.com/how-to-write-impeccably-clean-code-that-will-save-your-sanity-7d0ea59d285c" rel="noopener noreferrer"&gt;GitConnected&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Writing code is a skill that anyone can acquire, but attaining the highest standards of clean code requires discipline and dedication. In this article, we will explore practical strategies and tools to help you elevate your Python code to impeccable levels. By gradually incorporating these best practices into your development lifecycle, you can ensure clean, bug-free code that stands the test of time.&lt;/p&gt;

&lt;p&gt;Adhering to best practices not only maintains code cleanliness but also minimizes the risk of introducing bugs. While it may require an initial investment of time, following these practices ultimately reduces development effort in the long run. As a seasoned full-stack software engineer, I have consistently received accolades for upholding coding standards in the companies I have worked with.&lt;/p&gt;

&lt;p&gt;To illustrate these best practices, we'll consider a hypothetical project called &lt;a href="https://github.com/ashu-tosh-kumar/stack-scraper" rel="noopener noreferrer"&gt;Stack-Scraper&lt;/a&gt;. This project consists of a single-page website scraper that extracts questions and answers from (hypothetical) Stack Overflow. Please note that Stack-Scraper is not a functional project but serves as an example to demonstrate the ideas discussed here. The source code for this example can be found on &lt;a href="https://github.com/ashu-tosh-kumar/stack-scraper" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I personally use &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt; as my go-to IDE, and so some of the tools and plugins mentioned here are for the same. Let's dive into the best practices and tools I employ to ensure my Python code adheres to the highest standards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Repository Structure
&lt;/h2&gt;

&lt;p&gt;A thoughtfully designed repository structure serves as the foundation for clean code development. If the structure fails to meet the project's requirements, developers may scatter code across different locations, resulting in a messy structure and decreased code re-usability. A carefully crafted repository structure plays a vital role in maintaining code organization and facilitating collaboration among developers.&lt;/p&gt;

&lt;p&gt;It's important to note that there's no one-size-fits-all solution for repository structure. Each project may have unique requirements that warrant a specific organization scheme. However, examining a practical example can provide valuable insights. Let's consider the repository structure of the Stack-Scraper project. Here are some key points to note:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The Stack-Scraper repository employs clearly demarcated folders for different components, such as APIs (&lt;code&gt;src/apis&lt;/code&gt;) database models (&lt;code&gt;src/db_wrappers&lt;/code&gt;), domain-level constants (&lt;code&gt;src/constants&lt;/code&gt;), pydantic models (&lt;code&gt;src/domain_models&lt;/code&gt;), and scrapers (&lt;code&gt;src/external_sources/scrappers&lt;/code&gt;) etc.. This segregation ensures a logical separation of code, enabling developers to locate and modify specific functionalities easily.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The test files in the Stack-Scraper repository follow the same hierarchy as the main repository. This practice ensures that tests remain organized and aligned with the corresponding code. Consistent test organization simplifies test management and improves code testability.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  pre-commit
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://pre-commit.com/" rel="noopener noreferrer"&gt;pre-commit&lt;/a&gt; is a framework that enables the execution of configurable checks or tasks on code changes prior to committing, providing a way to enforce code quality, formatting, and other project-specific requirements, thereby reducing potential issues and maintaining code consistency.&lt;/p&gt;

&lt;p&gt;All you need to do is create a &lt;code&gt;pre-commit-config.yaml&lt;/code&gt; file in your repository. You can install pre-commit by running following commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;pre-commit
pre-commit &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's examine the &lt;code&gt;pre-commit-config.yaml&lt;/code&gt; of Stack-Scraper.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;repos&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/ambv/black&lt;/span&gt;
    &lt;span class="na"&gt;rev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;23.3.0&lt;/span&gt;
    &lt;span class="na"&gt;hooks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;black&lt;/span&gt;
        &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;--config=./pyproject.toml&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
        &lt;span class="na"&gt;language_version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;python3.11&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/pycqa/flake8&lt;/span&gt;
    &lt;span class="na"&gt;rev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;6.0.0&lt;/span&gt;
    &lt;span class="na"&gt;hooks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;flake8&lt;/span&gt;
        &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;--config=./tox.ini&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
        &lt;span class="na"&gt;language_version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;python3.11&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/pycqa/isort&lt;/span&gt;
    &lt;span class="na"&gt;rev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;5.12.0&lt;/span&gt;
    &lt;span class="na"&gt;hooks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;isort&lt;/span&gt;
        &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--profile"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;black"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--filter-files"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
        &lt;span class="na"&gt;language_version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;python3.11&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/pre-commit/pre-commit-hooks&lt;/span&gt;
    &lt;span class="na"&gt;rev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v4.4.0&lt;/span&gt;
    &lt;span class="na"&gt;hooks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;requirements-txt-fixer&lt;/span&gt;
        &lt;span class="na"&gt;language_version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;python3.11&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;debug-statements&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;detect-aws-credentials&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;detect-private-key&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we have configured 7 hooks. You can add &lt;a href="https://pre-commit.com/hooks.html" rel="noopener noreferrer"&gt;more hooks&lt;/a&gt; if you need but above setup is more than enough to help you keep your code clean.&lt;/p&gt;

&lt;h2&gt;
  
  
  Type-hints
&lt;/h2&gt;

&lt;p&gt;Python's dynamic typing allows variables to be assigned without explicit type definitions, which can lead to convenience. However, this flexibility can pose challenges in maintaining code quality, especially in larger projects where type errors and inconsistencies may occur.&lt;/p&gt;

&lt;p&gt;Consider following example from file: &lt;code&gt;src/apis/question_no.py&lt;/code&gt; in Stack-Scraper. Can you identify if &lt;code&gt;ques_no&lt;/code&gt; is an integer or a string?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@stackoverflow_blueprint.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/stackoverflow/&amp;lt;ques_no&amp;gt;&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;methods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;GET&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_question_answer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ques_no&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# code to do stuff
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Checkout the same example now with type-hints. It clearly highlights that &lt;code&gt;ques_no&lt;/code&gt; is expected to be an integer and &lt;code&gt;get_question_answer&lt;/code&gt; returns a Response object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@stackoverflow_blueprint.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/stackoverflow/&amp;lt;ques_no&amp;gt;&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;methods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;GET&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_question_answer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ques_no&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# code to do stuff
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Doc-strings
&lt;/h2&gt;

&lt;p&gt;Doc-strings are documentation strings added for each function to improve code readability. They provide additional information about the function's purpose, parameters, and return values, making it easier for developers to understand and utilize the code effectively.&lt;/p&gt;

&lt;p&gt;You can also use doc-strings to generate automated documentation for your code using a library like &lt;a href="https://pdoc.dev/" rel="noopener noreferrer"&gt;pdoc&lt;/a&gt;. Consider the following example from Stack-Scraper and the corresponding documentation generated using pdoc library.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@stackoverflow_blueprint.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/stackoverflow/&amp;lt;ques_no&amp;gt;&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;methods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;GET&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_question_answer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ques_no&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Function to fetch data for given question number

    Args:
        ques_no (int): Question number

    Returns:
        Response: Returns response object
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="c1"&gt;# code to do stuff
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frms1q94m0ht4zetih52p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frms1q94m0ht4zetih52p.png" alt="Screenshot showcasing documentation generated for function get_question_no using pdoc library" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  SonarLint
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.sonarsource.com/products/sonarlint/" rel="noopener noreferrer"&gt;SonarLint&lt;/a&gt; is a code analysis tool that integrates with various IDEs (as a free plugin) and helps identify and fix code quality issues, security vulnerabilities, and bugs during the development process, enabling developers to write cleaner and more reliable code. This has been a must install plugin for me over years now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pydantic
&lt;/h2&gt;

&lt;p&gt;Pydantic is a Python library that provides runtime type checking and validation for data models. We don't aim to make Python behave as C/C++ but there are certain use cases where it's paramount to enforce type-checking. Examples: API inputs, methods in database wrapper to provide consistent in and out of data from database etc.&lt;/p&gt;

&lt;p&gt;Stack-Scraper demonstrates an implementation for the same. By leveraging the pydantic model, &lt;code&gt;StackOverflowQuestionAnswer&lt;/code&gt; as the output of the &lt;code&gt;get_question_answer_by_ques_no&lt;/code&gt; method within the &lt;code&gt;InMemoryDatabaseWrapper&lt;/code&gt; class, we establish a reliable means of retrieving questions from the database based on their unique identifiers. This design choice ensures that future changes to the database, including modifications to its schema, will not disrupt the application's functionality as long as the method's output adheres to the consistent model defined by pydantic.&lt;/p&gt;

&lt;p&gt;Another demonstration is validating the inputs to the method &lt;code&gt;upsert_question_answer&lt;/code&gt; in the same class as above to ensure that only allowed values go into the database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Spell Checker
&lt;/h2&gt;

&lt;p&gt;While it may initially appear counterintuitive, incorporating a spell checker into your code is a valuable practice that aligns with the other advice provided. The inclusion of a spell checker ensures code quality and readability, reinforcing the importance of attention to detail in maintaining clean and error-free code.&lt;/p&gt;

&lt;p&gt;Firstly, it will help to avoid naming methods like &lt;code&gt;upsert_qusetion_answer&lt;/code&gt; due to its unintuitive spelling, as it can lead to errors and confusion during usage. Notice the spelling mistake in &lt;code&gt;qusetion&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Secondly, if you utilize an automatic documentation generator, it becomes essential to minimize spelling mistakes. Maintaining accurate and error-free documentation not only improves code understand-ability but also enhances the overall professionalism and credibility of the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tests
&lt;/h2&gt;

&lt;p&gt;Comprehensive testing is crucial for maintaining error-free and robust code, ensuring its adaptability to future changes and different developers. While aiming for 100% coverage is desirable, the focus should be on thoroughly testing the code rather than just the coverage number.&lt;/p&gt;

&lt;p&gt;When writing test cases, it is important to consider all possible scenarios and edge cases that the code might encounter. This includes positive and negative testing, boundary testing, and error handling. An example test case for the &lt;code&gt;get_question_answer&lt;/code&gt; function in the &lt;code&gt;test/src/apis/test_question_no.py&lt;/code&gt; file can provide insights into designing effective test cases.&lt;/p&gt;



&lt;p&gt;That's all for this article on maintaining clean code practices and enhancing code quality. I hope you found the insights and strategies shared here valuable. Remember, implementing these best practices and incorporating them into your development habits one step at a time can make a significant difference in your code's reliability and maintainability.&lt;/p&gt;

&lt;p&gt;By prioritizing code cleanliness and adhering to these practices, you'll witness your code soar to new heights. Enjoy the journey of writing impeccable code and reap the rewards of robust, error-free software development. Happy coding!&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Tips
&lt;/h2&gt;

&lt;p&gt;Here I am listing a few more generic tips/comments that you can incorporate into your coding habits.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add comments wherever warranted in your code. If you make an assumption in the code, it's better to highlight the same in comments. Example: Line &lt;code&gt;78&lt;/code&gt; in file &lt;code&gt;src/external_sources/scrappers/stack_overflow.py&lt;/code&gt; .&lt;/li&gt;
&lt;li&gt;Try not to define constants inside functions/classes because overtime, you could end up having bunch of these constants scattered across the code. Either define them in their respective constants file or in the respective module. Example: &lt;code&gt;src/constants/api_constants.py&lt;/code&gt; .&lt;/li&gt;
&lt;li&gt;Define your own Exceptions rather than using the generic one. This helps in differentiating exceptions in code to respective segregation. Example: &lt;code&gt;StackOverflowException&lt;/code&gt; in file &lt;code&gt;src/external_sources/scrappers/stack_overflow.py&lt;/code&gt; represents exception raised by the Stack Overflow Scrapper.&lt;/li&gt;
&lt;li&gt;Follow &lt;a href="https://www.geeksforgeeks.org/object-oriented-programming-oops-concept-in-java/" rel="noopener noreferrer"&gt;OOPs&lt;/a&gt; for coding. Example: Inheritance by defining base class &lt;code&gt;ExternalSource&lt;/code&gt; in file &lt;code&gt;src/external_sources/external_source_base.py&lt;/code&gt; .&lt;/li&gt;
&lt;li&gt;Follow &lt;a href="https://restfulapi.net/" rel="noopener noreferrer"&gt;REST&lt;/a&gt; principles for API development.&lt;/li&gt;
&lt;li&gt;Do not add secrets into your repository. Instead use an environment file or a Secrets Management Service like &lt;a href="https://aws.amazon.com/secrets-manager/" rel="noopener noreferrer"&gt;AWS Secrets Manager&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Make your code environment agnostic. So, that it's easy to maintain separate development, testing, staging and/or production environments. Example: &lt;code&gt;src/config.py&lt;/code&gt; .&lt;/li&gt;
&lt;li&gt;Peg versions of the libraries that you install in &lt;code&gt;requirements.txt&lt;/code&gt; file. It helps in avoiding application failure because of breaking upgrades to libraries.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
    <item>
      <title>How to develop a Wox Plugin using Python</title>
      <dc:creator>Ashutosh Kumar</dc:creator>
      <pubDate>Sat, 15 Jul 2023 11:49:01 +0000</pubDate>
      <link>https://forem.com/atkumar/how-to-develop-a-wox-plugin-using-python-1omc</link>
      <guid>https://forem.com/atkumar/how-to-develop-a-wox-plugin-using-python-1omc</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhoorqxfdgfcj31kefg7o.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhoorqxfdgfcj31kefg7o.jpeg" alt="Representative image for plugin" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Read this article on &lt;a href="https://medium.com/@at-k/how-to-develop-a-wox-plugin-using-python-8f2372281d7" rel="noopener noreferrer"&gt;Medium&lt;/a&gt; published by &lt;a href="https://gitconnected.com/" rel="noopener noreferrer"&gt;gitconnected&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.wox.one/" rel="noopener noreferrer"&gt;Wox&lt;/a&gt; is a full-featured launcher for the Windows platform. It’s akin to &lt;a href="https://support.apple.com/en-in/guide/mac-help/mchlp1008/mac" rel="noopener noreferrer"&gt;Mac’s Spotlight&lt;/a&gt; and can be augmented by a plethora of &lt;a href="https://www.wox.one/plugin" rel="noopener noreferrer"&gt;plugins&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I have been using Wox (with the almighty &lt;a href="https://www.voidtools.com/support/everything/" rel="noopener noreferrer"&gt;Everything&lt;/a&gt; plugin) for several years now and have loved it. But I have always resented the unavailability of a working English dictionary plugin that would also work offline. So, I embarked on developing a plugin for myself but was frustrated by the lack of documentation available to do the same.&lt;/p&gt;

&lt;p&gt;Below, I am sharing how I developed a dictionary plugin, Easy Dictionary, using Python. I hope it would help you in your quest to develop another Python-based plugin. &lt;a href="http://www.wox.one/plugin/351" rel="noopener noreferrer"&gt;Easy Dictionary&lt;/a&gt; can be installed from the official Wox &lt;a href="http://www.wox.one/plugin/351" rel="noopener noreferrer"&gt;plugin website&lt;/a&gt;. The source code is available on &lt;a href="https://github.com/ashu-tosh-kumar/Wox.Plugin.eDict" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Please check it out and you’d understand why I named it an “Easy” dictionary.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4nwmoli8e1ueax4ilm8k.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4nwmoli8e1ueax4ilm8k.jpeg" alt="Easy Dictionary Usage Screenshot" width="795" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alright, all we need to do is follow below simple steps.&lt;/p&gt;




&lt;p&gt;We need to create a python file to contain our code. Let’s call it &lt;code&gt;main.py&lt;/code&gt; (file name could be anything). Add a class (class name could be anything) inheriting from &lt;code&gt;wox.Wox&lt;/code&gt; and instantiate the same as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Only for type-hinting in Python
# For more info: https://docs.python.org/3/library/typing.html
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;

&lt;span class="c1"&gt;# No need to worry about the presence of the `Wox` class. Wox runtime has its own 
# python environment that contains the required `Wox` class
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;wox&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Wox&lt;/span&gt;


&lt;span class="c1"&gt;# Class name could be anything
# NOTE: Don't forget to inherit from `Wox`
&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EDict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Wox&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Overriding the `__init__` is NOT mandatory
&lt;/span&gt;    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Initializer for `EDict` class&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
        &lt;span class="c1"&gt;# Add all the custom initialization required for the `EDict` class
&lt;/span&gt;
        &lt;span class="c1"&gt;# NOTE: If overriding the `__init__` method, make sure to call the
&lt;/span&gt;        &lt;span class="c1"&gt;# parent class initializer like below
&lt;/span&gt;        &lt;span class="nf"&gt;super&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# NOTE: We must override the `query` method
&lt;/span&gt;    &lt;span class="c1"&gt;# `query` method is called when a user queries the plugin using its trigger
&lt;/span&gt;    &lt;span class="c1"&gt;# keyword in Wox. Wox passes the user input as an argument
&lt;/span&gt;    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]]:&lt;/span&gt;
        &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
        &lt;span class="c1"&gt;# NOTE: Each item on the list must be a dictionary that should contain 
&lt;/span&gt;        &lt;span class="c1"&gt;# at least following keys. For more info, check out the annotated screenshot below
&lt;/span&gt;            &lt;span class="c1"&gt;# "Title": Main search result to show in Wox
&lt;/span&gt;            &lt;span class="c1"&gt;# "IcoPath": Path of image/icon for the search result in Wox
&lt;/span&gt;            &lt;span class="c1"&gt;# "SubTitle": Subtitle of the search result in Wox
&lt;/span&gt;
        &lt;span class="c1"&gt;# Our core logic goes here or in any other method that we can call here
&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt;


&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# NOTE: Don't forget to instantiate the above class
&lt;/span&gt;    &lt;span class="c1"&gt;# No need to return anything
&lt;/span&gt;    &lt;span class="nc"&gt;EDict&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We need to create another file called &lt;code&gt;plugin.json&lt;/code&gt; (the name must be the same). Wox looks for this JSON file to get details about the plugin and instantiates the same at runtime. Below &lt;code&gt;plugin.json&lt;/code&gt; file is for the Easy Dictionary plugin.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;plugin.json&lt;/code&gt; file requires the following details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ID&lt;/strong&gt;: This must be a UUID that we generate online or using any programming language. It shouldn’t clash with the ID of any other plugins available for Wox.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ActionKeyword&lt;/strong&gt;: It is the trigger keyword for the plugin when using Wox. See the below screenshot showing Easy Dictionary getting triggered on typing “ed”.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19c5z09l88ooc784r5kk.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19c5z09l88ooc784r5kk.jpeg" alt="Easy Dictionary Usage Screenshot with markings to highlight different components" width="795" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Name, Description, Author, Version&lt;/strong&gt;: These are self-explanatory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Language&lt;/strong&gt;: Wox supports writing plugins in many languages as the communication is based on RPC. So, language is not a barrier for Wox plugins. Here, we need to specify the language in which we are writing the plugin (“python” in this case).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Website&lt;/strong&gt;: This can be empty string or we can link to a website for our plugin.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IcoPath&lt;/strong&gt;: Path of image/icon we wish to use for our plugin. This image/icon must be part of the plugin package (we will be packaging the plugin shortly).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ExecuteFileName&lt;/strong&gt;: It specified the entry point for our plugin. Note that it’s the same &lt;code&gt;main.py&lt;/code&gt; file that we created earlier.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"0c6569f79d49409e8e5e42e1ec8bb035"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ActionKeyword"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"ed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Easy Dictionary"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Provides an offline English Dictionary"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"ashutosh"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"2.2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Language"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"python"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Website"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/ashu-tosh-kumar/Wox.Plugin.eDict"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"IcoPath"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"icons&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;edict.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ExecuteFileName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"main.py"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are almost done. Next we need to just grab the files &lt;code&gt;main.py&lt;/code&gt; , &lt;code&gt;plugin.json&lt;/code&gt;, folder named &lt;code&gt;icons&lt;/code&gt; with files &lt;code&gt;edict.png&lt;/code&gt; (used in &lt;code&gt;plugin.json&lt;/code&gt;) &amp;amp; &lt;code&gt;edit.ico&lt;/code&gt; (used in &lt;code&gt;main.py&lt;/code&gt;) and zip them together into &lt;code&gt;Wox.Plugin.&amp;lt;plugin_name&amp;gt;.zip&lt;/code&gt;. In our case, it’s &lt;code&gt;Wox.Plugin.eDict.zip&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Once zipped, change the zip format manually to &lt;code&gt;.wox&lt;/code&gt;. So, finally we would have the zipped file: &lt;code&gt;Wox.Plugin.eDict.wox&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The file &lt;code&gt;Wox.Plugin.eDict.wox&lt;/code&gt; can be dragged and dropped onto Wox launcher to install it manually. Or, we can share it on Wox’s official website for wider use by creating an account and uploading the above file.&lt;/p&gt;

&lt;p&gt;That’s it. Follow the above steps and you can create your own Wox plugins using our old chap Python language. For the sake of completeness, let’s go through the actual code of Easy Dictionary below.&lt;/p&gt;




&lt;p&gt;First, let’s have a look at the files that we would need to package for the Easy Dictionary. Please checkout the source code on &lt;a href="https://github.com/ashu-tosh-kumar/Wox.Plugin.eDict" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|-icons  # Folder
| |-edict.ico
| |-edict.png
|-dictionary_compact_with_words.zip
|-main.py
|-plugin.json
|-spell.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;icons&lt;/strong&gt;: icons folder contains the image &lt;code&gt;edict.png&lt;/code&gt; and icon &lt;code&gt;edict.ico&lt;/code&gt; used in the project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;dictionary_compact_with_words.zip&lt;/strong&gt;: It contains the unabridged Webster dictionary in json format. We have zipped it to reduce the plugin size. We unzip it for use in Python in &lt;code&gt;__init__&lt;/code&gt; method of class &lt;code&gt;EDict&lt;/code&gt; in &lt;code&gt;main.py&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EDict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Wox&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Easy Dictionary Class used by Wox&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Initializer for `EDict` class&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
        &lt;span class="c1"&gt;# Unzipping the dictionary for usage
&lt;/span&gt;        &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;ZipFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DICTIONARY_ZIP_FILE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;zip_file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;zip_file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DICTIONARY_JSON_FILE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;edict_file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_edict&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;edict_file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c1"&gt;# Key "cb2b20da-9168-4e8e-8e8f-9b54e7d42214" gives a list of all words
&lt;/span&gt;        &lt;span class="c1"&gt;# For more info, checkout: https://github.com/matthewreagan/WebstersEnglishDictionary
&lt;/span&gt;        &lt;span class="n"&gt;words&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_edict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cb2b20da-9168-4e8e-8e8f-9b54e7d42214&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_spell_correct&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SpellCorrect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;words&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="nf"&gt;super&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;main.py&lt;/strong&gt;: This is our starting point for our plugin. We override the &lt;code&gt;query&lt;/code&gt; method in class &lt;code&gt;EDict&lt;/code&gt; to provide results to user query. We use the method _format_result to format each result as a dictionary as explained earlier. Some formatting rules in &lt;code&gt;_format_result&lt;/code&gt; are in place because of the underlying dictionary used. Moreover, if we fail to find a definition for user input key, we try to auto-correct the word and show results for the auto-corrected word instead.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]]:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Overrides Wox query function to capture user input

    Args:
        key (str): User search input

    Returns:
        List[Dict[str, str]]: Returns list of results where each result is a dictionary
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Avoid looking for empty key
&lt;/span&gt;        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt;

    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Look for the given key
&lt;/span&gt;        &lt;span class="n"&gt;definitions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_edict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

        &lt;span class="c1"&gt;# Format results in the form of a dictionary
&lt;/span&gt;        &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_format_result&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MAXIMUM_RESULTS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;KeyError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Try correcting the key and looking again with the corrected key
&lt;/span&gt;        &lt;span class="c1"&gt;# This is an additional feature where we try to auto-correct the user input
&lt;/span&gt;        &lt;span class="c1"&gt;# This helps in case of spelling mistakes
&lt;/span&gt;        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;corrected_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_spell_correct&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;correction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;definitions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_edict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;corrected_key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_format_result&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;corrected_key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MAXIMUM_RESULTS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;KeyError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="c1"&gt;# Word doesn't exist in our dictionary
&lt;/span&gt;            &lt;span class="k"&gt;pass&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;plugin.json&lt;/strong&gt;: Explained earlier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;spell.py&lt;/strong&gt;: A simple implementation of probability based method to auto-correct a word. Implementation taken from &lt;a href="https://norvig.com/spell-correct.html" rel="noopener noreferrer"&gt;norvig.com&lt;/a&gt;. This file is used by &lt;code&gt;main.py&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>opensource</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Streamline Your TODOs with TODO Notifier for Python projects</title>
      <dc:creator>Ashutosh Kumar</dc:creator>
      <pubDate>Fri, 21 Apr 2023 05:12:57 +0000</pubDate>
      <link>https://forem.com/atkumar/streamline-your-todos-with-todo-notifier-for-python-projects-5fpe</link>
      <guid>https://forem.com/atkumar/streamline-your-todos-with-todo-notifier-for-python-projects-5fpe</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ql1topq5290geph3u4l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ql1topq5290geph3u4l.png" alt="TODO Notifier Icon Image" width="800" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Full article on &lt;a href="https://at-k.medium.com/streamline-your-todos-with-todo-notifier-for-python-projects-6f95c03a2d34" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Are you tired of tracking your TODOs in Python projects? Do you wish there was a tool that could scrape and summarize all your TODOs for you? Checkout &lt;a href="https://pypi.org/project/todonotifier/" rel="noopener noreferrer"&gt;TODO Notifier&lt;/a&gt;, an open source project available on &lt;a href="https://github.com/ashu-tosh-kumar/todo_notifier" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; and &lt;a href="https://pypi.org/project/todonotifier/" rel="noopener noreferrer"&gt;PyPi&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;At my last company, I had the pleasure of using a tool that summarized all the TODO items in a Python project. It would send periodic reminders to individual developers to complete them. The tool was helpful and could identify expired and upcoming TODOs with an expected completion date.&lt;/p&gt;

&lt;p&gt;When I moved to a new company, I realized how much I missed that tool. So, I decided to take matters into my own hands and develop a similar tool myself. It was a challenging but rewarding experience. And I’m excited to share my journey of building a Python TODO management tool.&lt;/p&gt;

&lt;p&gt;With TODO Notifier, you can set up automated summaries of TODO items in your code by module. It also lists all expired and upcoming TODO items based on expiry date. Moreover, you can customize the tool to generate and send these summaries over email. And send reminders to individual developers (upcoming feature) to finish their TODO items.&lt;/p&gt;

&lt;p&gt;Let’s first see the TODO Notifier in action. I will be using TODO Notifier on itself to generate the default summaries. Please note that I am not using any notifier for this demo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futg7eug800948nisnkeh.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futg7eug800948nisnkeh.gif" alt="Example Demo GIF" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffro32pdi34q2n38uiarr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffro32pdi34q2n38uiarr.png" alt="Sample summary generated" width="800" height="1022"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Setting up TODO Notifier is simple. Follow the detailed article on &lt;a href="https://at-k.medium.com/streamline-your-todos-with-todo-notifier-for-python-projects-6f95c03a2d34" rel="noopener noreferrer"&gt;Medium&lt;/a&gt; and you will have TODO Notifier ready in no time. If you want more information, please check out the &lt;a href="https://github.com/ashu-tosh-kumar/todo_notifier#method-1-as-a-pip-package" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; or &lt;a href="https://pypi.org/project/todonotifier/" rel="noopener noreferrer"&gt;PyPi&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;TODO Notifier is flexible and customizable. It’s open source and free to use. You can adjust the date format to match your project’s needs. You can also send the generated summaries over Email or any other notification service. You can exclude certain modules or files from the summaries.&lt;/p&gt;

&lt;p&gt;TODO Notifier is a powerful tool for Python developers who want to streamline their TODO management. With its easy setup and customizable options, it’s a must-have for any project with many developers and lots of TODOs to track.&lt;/p&gt;

&lt;p&gt;If you’re interested in trying out TODO Notifier, you can find the code on &lt;a href="https://github.com/ashu-tosh-kumar/todo_notifier" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; and install it with &lt;a href="https://pypi.org/project/todonotifier/" rel="noopener noreferrer"&gt;pip&lt;/a&gt;. Give it a try and let me know what you think!&lt;/p&gt;

</description>
      <category>python</category>
      <category>opensource</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to start with competitive coding from ZERO</title>
      <dc:creator>Ashutosh Kumar</dc:creator>
      <pubDate>Fri, 06 Dec 2019 19:38:07 +0000</pubDate>
      <link>https://forem.com/atkumar/how-to-start-with-competitive-coding-from-zero-35ij</link>
      <guid>https://forem.com/atkumar/how-to-start-with-competitive-coding-from-zero-35ij</guid>
      <description>&lt;h3&gt;
  
  
  How to Start with Competitive Coding from Zero?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AMvAOO8Gsdn8kT6LO" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AMvAOO8Gsdn8kT6LO" alt="Representative image for Programming" width="800" height="536"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;-Photo by Kobu Agency on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is a question that has haunted me for years, and I could never begin for a long time. Finally, it turned out to be a simple lesson: “Start by doing”, and that’s all that is required. The only problem in this statement is what exactly to start with.&lt;/p&gt;

&lt;p&gt;I am from a non-CSE Department and chose to have a career in Software Engineering. So, I had to start from zero myself. After 8 months of coding practice, I landed an offer from a good MNC. Here I am laying down a simple step-wise plan that might help you to start from zero. Though it is not the only plan that would work and you don’t need to stick to it. But it helps to have a concrete plan to compare with in case you have your own road map. In fact, once you start having a hang of coding (after solving 60–80 easy-level questions), you would not even need to further follow this plan. But, it would still be handy to check if you miss any topic.&lt;/p&gt;

&lt;p&gt;This post has six sections. The first section includes basic data structures and algorithms that you need to learn. Completing Section 1 might be helpful in coding tests of some companies. Section 2 includes Dynamic Programming and Greedy Algorithms. Completing Sections 1 and 2 will be good enough for fresher coding tests of most companies. Section 3 includes graphs that you encounter in coding tests of a few companies. Section 4 contains some other specific topics/data structures/algorithms that I have encountered in coding tests of a few companies. But, you won’t find questions too often on these topics but it’s better to learn them too if you could get enough time). Section 5 includes some extra topics/algorithms that are generally taught in Algorithms courses but are not important for placement tests. Section 6 includes FAQs about placements that I have encountered people asking in different forums.&lt;/p&gt;

&lt;p&gt;It would be better if you approach and master these sections sequentially (except Section 4; you can do it with Section 3). But, you can have your own preference depending on what works best for you.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; : Please note that I keep editing this article to best add all the relevant information/resources. I maintain a history of all the edits that I make so that it is easy for you to follow the changes. So, checkout the &lt;strong&gt;Edits Section&lt;/strong&gt; at the end of this post if anything is added after you last visited the article.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Section 1
&lt;/h3&gt;

&lt;p&gt;Let’s first have a look at the key things required for competitive coding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Programming Language&lt;/li&gt;
&lt;li&gt;Data Structures&lt;/li&gt;
&lt;li&gt;Algorithms&lt;/li&gt;
&lt;li&gt;Online Coding Practice&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  A. Programming Language
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdwternkoo8tmebpt8zn0.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdwternkoo8tmebpt8zn0.jpeg" alt="Image listing multiple programming languages" width="800" height="364"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Edited Image from towardsdatascience&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The first step is to choose a programming language (only choosing and not mastering). You only need to know some basic functionalities and shouldn’t bother about mastering it. Many people (including me) fall into the trap of trying to master the language before coding.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You could never learn a language without starting to use it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, to learn the required basic functionalities, head to &lt;a href="https://www.hackerrank.com/" rel="noopener noreferrer"&gt;HackerRank&lt;/a&gt;and log in/create your account. After login look for “Language Proficiency” Modules as shown in following image:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flgqm73sw7vc7725vxdx9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flgqm73sw7vc7725vxdx9.png" alt="Screenshot of Language Proficiency Module on HackerRank" width="461" height="628"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Language Proficiency Module&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Choose a programming language and solve the first &lt;strong&gt;15–20&lt;/strong&gt; questions. That’s it! Only the first 15–20 questions and you are all set with all the basic functionalities required. Don’t bother about the choice of the language at this point. If you are good at coding with one programming language, you can pick up any other. I coded with Python for around 7 months and then picked up C++ in 2–3 days. I first read some of its theory (see Resources at the end of this post) and then practised with it for next 3–5 days.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you don’t have a strict personal preference or are not sure about the programming language, here’s a point that may help you. I only know Python and C++ and so my point here is only about these two languages. If you are an absolute beginner, you will find it easier to start with Python than C++. But, you have to learn C++ because sometimes (only 1–2 companies like JP Morgan Quant Profile) don’t allow Python (I don’t know why). And, many companies ask questions about the output of a given C/C++ code in the form of MCQs and OOP concepts in C++. So, if you have around one semester (3–4 months) then Python may be your best bet as the learning will be fast with Python. But, if you have at least two semesters (8 months or more) then you can either choose C++ or Python first and then learn C++ later on (that’s what I did). But, learning will be slow initially with C++ but normal once you have enough practice.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  B. Data Structures
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxkwn3jl6u8bx2uy7lgd.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxkwn3jl6u8bx2uy7lgd.jpeg" alt="Representative image to show data structures" width="800" height="433"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Harsh Goel on HackerEarth&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Data structures are the basic building blocks of competitive coding. It is better to first read about the basic data structures mentioned below.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/array-data-structure/" rel="noopener noreferrer"&gt;Array&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/data-structures/linked-list/" rel="noopener noreferrer"&gt;Linked List&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/stack-data-structure/" rel="noopener noreferrer"&gt;Stack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/queue-data-structure/" rel="noopener noreferrer"&gt;Queue&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/string-data-structure/" rel="noopener noreferrer"&gt;Strings&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.geeksforgeeks.org/hashing-data-structure/" rel="noopener noreferrer"&gt;Hashing&lt;/a&gt;* (Only usage, you can read theory later on)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.geeksforgeeks.org/binary-tree-data-structure/" rel="noopener noreferrer"&gt;Binary Trees&lt;/a&gt;**&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.geeksforgeeks.org/binary-search-tree-data-structure/" rel="noopener noreferrer"&gt;Binary Search Trees&lt;/a&gt;**&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.geeksforgeeks.org/heap-data-structure/" rel="noopener noreferrer"&gt;Heap&lt;/a&gt;**&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can learn about the above data structures from &lt;a href="https://www.geeksforgeeks.org/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;. Read their theory and learn how to implement them in the programming language of your choice. &lt;a href="https://www.geeksforgeeks.org/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt; contains the implementation of these data structures in different programming languages.&lt;/p&gt;

&lt;p&gt;Once you master and have some experience with these basic data structures (№1–6), you can go on to learn the complex ones mentioned at the end of this post.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;*Note:&lt;/strong&gt; I have mentioned hashing here because you may find it helpful in a lot of problems. You need not know its theory at this point. Most of the programming languages offer built-in implementation of hashing. But its theory is very important for coding interviews. &lt;strong&gt;You should check out its theory from the book&lt;/strong&gt; &lt;a href="https://www.amazon.in/Introduction-Algorithms-3Ed-International-Press/dp/0262533057/ref=sr_1_3?crid=1Q9X9WBSF9JRL&amp;amp;keywords=cormen+introduction+to+algorithms&amp;amp;qid=1575660481&amp;amp;s=books&amp;amp;sprefix=cormen%2Cstripbooks%2C1009&amp;amp;sr=1-3" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;Introduction to Algorithms&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;mentioned in the Resources section.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;**Note:&lt;/strong&gt; I am not counting binary trees, binary search trees and heaps in basic data structures. And, you need not to finish them right now to move on to the next section. I have mentioned them here because there are lectures in the next section on these topics. So, complete only up to Hashing and move on to the next section. After completing lectures on trees and heaps in the next Section, you can learn their implementation from the above links.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  C. Algorithms
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89kchh1rvpc6vwo8ssyq.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89kchh1rvpc6vwo8ssyq.jpeg" alt="Representative image to show Algorithms" width="800" height="479"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Edited Image from Coursera&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Algorithms are the most important part of competitive programming. If you master algorithms, you are more than 50% done.&lt;/p&gt;

&lt;p&gt;There is no substitute for a proper course on Algorithms. It would be better if you both watch a lecture and read from &lt;a href="https://www.geeksforgeeks.org/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;. For example, the &lt;a href="http://cse.iitkgp.ac.in/~abhij/course/theory/Algo1/Spring19/" rel="noopener noreferrer"&gt;Algorithms course&lt;/a&gt; ( &lt;strong&gt;CS21003&lt;/strong&gt; ) offered by the CSE Department in my college (IIT Kharagpur) is good. I would recommend that you take that course (if possible) as a “depth/breadth” and not as an “additional” (for obvious reasons). CS21003 is offered in even semesters for non-CSE students. You can get the course if you have an 8+ CGPA. I am not sure about the below 8 CGPA because the cutoff depends upon all the students who have applied.&lt;/p&gt;

&lt;p&gt;If you are from some other college or can’t take that course for some reason, I am adding relevant online lectures below. Feel free to skip these lectures if you are already taking any course in Algorithms.&lt;/p&gt;

&lt;p&gt;I am not aware of many online courses on Algorithms except those provided by MIT OCW which you can find on their &lt;a href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/" rel="noopener noreferrer"&gt;website&lt;/a&gt; or &lt;a href="https://www.youtube.com/user/MIT" rel="noopener noreferrer"&gt;YouTube&lt;/a&gt;. MIT has many courses on Algorithms, and you may find it overwhelming to complete them. Moreover, it’s not required to complete them for fresher coding tests. So I am mentioning selective lectures from the courses &lt;a href="https://www.youtube.com/playlist?list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb" rel="noopener noreferrer"&gt;MIT 6.006 Introduction to Algorithms, Fall 2011&lt;/a&gt; and &lt;a href="https://www.youtube.com/playlist?list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp" rel="noopener noreferrer"&gt;MIT 6.046J Design and Analysis of Algorithms, Spring 2015&lt;/a&gt; that you can watch in the sequence mentioned below:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=P7frcB_-g4w" rel="noopener noreferrer"&gt;R1. Asymptotic Complexity, Peak Finding&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=r5pXu1PAUkI&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=29&amp;amp;t=0s" rel="noopener noreferrer"&gt;R5. Recursion Trees, Binary Search Trees&lt;/a&gt; (only Recursion trees part)&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=HtSuA80QTyo&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=1" rel="noopener noreferrer"&gt;Lec1: Algorithmic Thinking, Peak Finding&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=Zc54gFhdpLA&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=2" rel="noopener noreferrer"&gt;Lec2: Models of Computation, Document Distance&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Read about &lt;a href="https://www.geeksforgeeks.org/recursion/" rel="noopener noreferrer"&gt;Recursive Thinking&lt;/a&gt; from GeeksforGeeks&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=Kg4bqzAqRBM&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=3" rel="noopener noreferrer"&gt;Lec3: Insertion Sort, Merge Sort&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=B7hVxCmfPtM&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=5&amp;amp;t=0s" rel="noopener noreferrer"&gt;Lec4: Heaps and Heap Sort&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=9Jry5-82I68&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=5" rel="noopener noreferrer"&gt;Lec5: Binary Search Trees, BST Sort&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=Nz1KZXbghj8&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=7" rel="noopener noreferrer"&gt;Lec7: Counting Sort, Radix Sort, Lower Bounds for Sorting&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.046J] &lt;a href="https://www.youtube.com/watch?v=EzeYI7p9MjU&amp;amp;list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp&amp;amp;index=2" rel="noopener noreferrer"&gt;Lec2. Divide &amp;amp; Conquer: Convex Hull, Median Finding&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.046J] &lt;a href="https://www.youtube.com/watch?v=09vU-wVwW3U&amp;amp;list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp&amp;amp;index=4&amp;amp;t=0s" rel="noopener noreferrer"&gt;R1. Matrix Multiplication and the Master Theorem&lt;/a&gt; (matrix multiplication is optional, but do check master theorem)&lt;/li&gt;
&lt;li&gt;[MIT 6.046J] &lt;a href="https://www.youtube.com/watch?v=QPk8MUtq5yA&amp;amp;list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp&amp;amp;index=9" rel="noopener noreferrer"&gt;R4. Randomized Select and Randomized Quicksort&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The above lectures should be enough to start coding online.&lt;/p&gt;

&lt;p&gt;While you are watching lectures, also start practising coding online. That is, suppose you finished a lecture on merge sort then you should try to code it yourself. You should always know to code the routines of all major sorting algorithms by yourself. For example, many companies have asked &lt;a href="https://www.geeksforgeeks.org/counting-inversions/" rel="noopener noreferrer"&gt;Array Inversion&lt;/a&gt;. You will need to write a modified routine of Merge Sort to get an O(nlogn) complexity. At this point, you already know a language and have completed basic data structures. So, you should also start doing questions about those data structures as explained in the next section.&lt;/p&gt;

&lt;h4&gt;
  
  
  D. Online Coding
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2A_CJKdWwDuIngwIff" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2A_CJKdWwDuIngwIff" alt="Images showing some code written on screen" width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Clément H on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Practice is the ultimate key to mastering anything you want to learn.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are several websites to practice coding like &lt;a href="https://leetcode.com/" rel="noopener noreferrer"&gt;LeetCode&lt;/a&gt;, &lt;a href="http://hackerrank.com/" rel="noopener noreferrer"&gt;HackerRank&lt;/a&gt;, &lt;a href="http://interviewbit.com/" rel="noopener noreferrer"&gt;InterviewBit&lt;/a&gt;, &lt;a href="https://codeforces.com/" rel="noopener noreferrer"&gt;Codeforces&lt;/a&gt;, and &lt;a href="https://www.codechef.com/" rel="noopener noreferrer"&gt;CodeChef.&lt;/a&gt; I have used only the first three. Start with &lt;a href="http://interviewbit.com/" rel="noopener noreferrer"&gt;LeetCode&lt;/a&gt; if you have at least two semesters (8 months) to prepare else start with &lt;a href="https://www.interviewbit.com/" rel="noopener noreferrer"&gt;InterviewBit&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So far, you have completed Data Structures and started Algorithms. So, head to the &lt;a href="https://leetcode.com/problemset/all/" rel="noopener noreferrer"&gt;LeetCode Problems&lt;/a&gt; and filter out the questions based on topics that you have already covered. Then, sort the questions based on their level of difficulty. You should start with the Easy level questions. Easy doesn’t mean “easy” and you may not be able to solve them on your first try. Solve &lt;strong&gt;10–15&lt;/strong&gt; questions on each of the topics that you have covered so far and then head to the next section.&lt;/p&gt;

&lt;p&gt;Having done 10–15 Easy level questions on all the topics, you should start doing Medium level Questions on them. I would recommend that you should start doing Medium level questions once you start Section 2. Once you start doing Medium level questions, you would feel easy-level questions to be “easy”.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; &lt;a href="https://www.interviewbit.com/" rel="noopener noreferrer"&gt;InterviewBit&lt;/a&gt; has a &lt;a href="https://www.interviewbit.com/courses/programming/" rel="noopener noreferrer"&gt;programming practice track&lt;/a&gt; that you should complete for your coding tests. It includes questions that have already been asked in coding tests of different companies. And, you will find repetitions of many of these questions in your coding tests. So if you start with any other website like &lt;a href="https://leetcode.com/" rel="noopener noreferrer"&gt;LeetCode&lt;/a&gt;&lt;a href="https://www.hackerrank.com/" rel="noopener noreferrer"&gt;,&lt;/a&gt; make sure that you also complete this track. It may take around 1–2 months to complete this track, so plan accordingly. If possible, also complete the &lt;a href="https://leetcode.com/problemset/top-100-liked-questions/" rel="noopener noreferrer"&gt;Top 100 liked questions&lt;/a&gt; of LeetCode after completing the &lt;a href="https://www.interviewbit.com/courses/programming/" rel="noopener noreferrer"&gt;InterviewBit practice track&lt;/a&gt; as you may find many repetitions from there also. Don’t worry, you would have already solved most of these 100 questions during your practice.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Section 2
&lt;/h3&gt;

&lt;p&gt;If you have come this far, then you would have gained very good coding skills. There are two important algorithmic paradigms that are important to master and I didn’t mention them in the above &lt;strong&gt;Algorithms&lt;/strong&gt; section. These are Dynamic Programming and Greedy Algorithms. You can watch the following lectures for the same:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=OQ5jsbhAv_M&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=20&amp;amp;t=0s" rel="noopener noreferrer"&gt;Lec19: Dynamic Programming I: Fibonacci, Shortest Paths&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=ENyox7kNKeY&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=20" rel="noopener noreferrer"&gt;Lec20: Dynamic Programming II: Text Justification, Blackjack&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=ocZMDMZwhCY&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=21" rel="noopener noreferrer"&gt;Lec21. DP III: Parenthesization, Edit Distance, Knapsack&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.046J] &lt;a href="https://www.youtube.com/watch?v=-QcPo_DWJk4&amp;amp;list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp&amp;amp;index=18&amp;amp;t=0s" rel="noopener noreferrer"&gt;R6. Greedy Algorithms&lt;/a&gt; (Also read about Greedy algorithms from &lt;a href="https://www.geeksforgeeks.org/greedy-algorithms/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt; via example problems shown there. You need to practice a bit to develop an intuition on where you can use the Greedy approach.)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The path is like as above for these two topics. Watch the video lectures and then solve &lt;strong&gt;10–15&lt;/strong&gt; questions on each topic. Dynamic Programming and Greedy approaches are important. Practice as many questions as you can on them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Section 3
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft0qnflreovikpxcmgen9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft0qnflreovikpxcmgen9.png" alt="Image showing Graphs" width="800" height="449"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Image from Annalect&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So far, you have covered almost everything required to be a good competitive programmer except graphs. If you still got time, you can go on to learn graphs*. You may find the following resources useful:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read about Graphs as a data structure on &lt;a href="https://www.geeksforgeeks.org/graph-data-structure-and-algorithms/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Read about representations of Graphs from &lt;a href="https://www.geeksforgeeks.org/graph-and-its-representations/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=s-CYnVz-uh4&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=13" rel="noopener noreferrer"&gt;Lec13: Breadth-First Search (BFS)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=AfSk24UTFS8&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=14" rel="noopener noreferrer"&gt;Lec14: Depth-First Search (DFS), Topological Sort&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.046J] Lec12: &lt;a href="https://www.youtube.com/watch?v=tKwnms5iRBU&amp;amp;list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp&amp;amp;index=17&amp;amp;t=0s" rel="noopener noreferrer"&gt;Greedy Algorithms: Minimum Spanning Tree&lt;/a&gt; (This lecture includes &lt;a href="https://www.geeksforgeeks.org/prims-minimum-spanning-tree-mst-greedy-algo-5/" rel="noopener noreferrer"&gt;Prim’s MST Algorithm&lt;/a&gt; and &lt;a href="https://www.geeksforgeeks.org/kruskals-minimum-spanning-tree-algorithm-greedy-algo-2/" rel="noopener noreferrer"&gt;Kruskal’s MST Algorithm&lt;/a&gt;**)&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=Aa2sqUhIn-E&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=15" rel="noopener noreferrer"&gt;Lec15: Single-Source Shortest Paths Problem (SSSP Problem)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=2E7MmKv0Y24&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=16" rel="noopener noreferrer"&gt;Lec16: Dijkstra&lt;/a&gt; (for SSSP Problem)&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=ozsuci5pIso&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=18&amp;amp;t=0s" rel="noopener noreferrer"&gt;Lec17: Bellman-Ford&lt;/a&gt;(for SSSP Problem)&lt;/li&gt;
&lt;li&gt;[MIT 6.046J] &lt;a href="https://www.youtube.com/watch?v=NzgFUwOaoIw" rel="noopener noreferrer"&gt;Lec.11: Dynamic Programming: All-Pairs Shortest Paths&lt;/a&gt; (ONLY &lt;a href="https://www.geeksforgeeks.org/floyd-warshall-algorithm-dp-16/" rel="noopener noreferrer"&gt;Floyd Warshal Algorithm&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With graphs, you have covered almost everything required assuming that you were also practising online. There are some specific topics left that I have encountered sometimes in coding tests of a few companies. You can find these topics in the next section.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;*NOTE&lt;/strong&gt; : If you are overwhelmed with so much by now or don’t have much time for Graphs then finish only up to BFS (№3) and DFS (№4). BFS and DFS will be enough for 95–99% of the questions that you may encounter on Graphs in coding tests. Only 2–3 core CSE companies open for non-CSE students ask very difficult questions on graphs like Nutanix. So, don’t bother much about graphs for now. Additionally, you can learn Topological Sort.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;**NOTE&lt;/strong&gt; : For implementing Kruskal’s Minimum Spanning Tree Algorithm, you would need to learn Disjoint Data Set Structure. It’s mentioned in Section 4 and is a very helpful data structure for a lot of problems. You can read about it first from &lt;a href="https://www.geeksforgeeks.org/union-find/" rel="noopener noreferrer"&gt;here&lt;/a&gt; and then &lt;a href="https://www.geeksforgeeks.org/union-find-algorithm-set-2-union-by-rank/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Section 4
&lt;/h3&gt;

&lt;p&gt;I have encountered the following topics sometimes in coding tests of a few companies. You can read about them if you got enough time.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Bits Manipulation&lt;/strong&gt; : Bits manipulation is an important topic for coding as well as interviews. It can save you a lot of time and complexity in certain questions. Walmart asked questions only on Bits Manipulation this time in both the Coding and Data Science profiles. You can read about Bits Manipulation from &lt;a href="https://www.hackerearth.com/practice/basic-programming/bit-manipulation/basics-of-bit-manipulation/tutorial/" rel="noopener noreferrer"&gt;HackerEarth Tutorial&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dequeue&lt;/strong&gt; : I have found usage of Dequeues in only one specific &lt;a href="https://www.geeksforgeeks.org/sliding-window-maximum-maximum-of-all-subarrays-of-size-k/" rel="noopener noreferrer"&gt;question&lt;/a&gt; asked in the coding test of two companies. Both Python and C++ offer built-in implementation for Dequeues.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disjoint Set Union (DSU) Data Structure&lt;/strong&gt;: DSU is important and used in Kruskal’s Minimum Spanning Tree Algorithm and in a bunch of other &lt;a href="https://leetcode.com/tag/union-find/" rel="noopener noreferrer"&gt;problems&lt;/a&gt;. I have encountered questions on DSU in a few coding tests including that of AB InBev.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trie Data Structure&lt;/strong&gt; : Tries can come in handy in specific sets of &lt;a href="https://leetcode.com/tag/trie/" rel="noopener noreferrer"&gt;problems&lt;/a&gt; on strings and bits. I was asked to implement a “set” for strings with O(n) or O(logn) complexity in my coding interview. You can do the same using Tries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Concepts of Object Oriented Programming (OOP):&lt;/strong&gt; You should understand the OOP concepts like Encapsulation and Interface. Questions on OOPs in general and OOPs in C++ are often asked in coding tests in the form of MCQs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regular Expression (regex)&lt;/strong&gt;: I encountered one question on regex in my entire placement (Trexquant). So it’s not important but if you have time, you may give it a shot in case you get unlucky.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Section 5 &lt;em&gt;(not important for Placement tests)&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;I am adding this section to include height-balanced binary trees and string-matching algorithms. Because they are generally taught in algorithms courses.&lt;/p&gt;

&lt;p&gt;But, they are not important for placement tests for all those companies that are open to non-CSE students. Most of the programming languages offer built-in implementation of pattern matching for strings. And, questions on height-balanced binary trees are generally time-consuming.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=FNeL18KsWPc&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=7&amp;amp;t=0s" rel="noopener noreferrer"&gt;Lec.6: AVL Trees, AVL Sort&lt;/a&gt; (height-balanced binary trees)&lt;/li&gt;
&lt;li&gt;[MIT 6.046J / 18.410J Fall 2005] Lec.10: &lt;a href="https://www.youtube.com/watch?v=O3hI9FdxFOM" rel="noopener noreferrer"&gt;Red-black Trees, Rotations, Insertions, Deletions&lt;/a&gt; (height-balanced binary trees)&lt;/li&gt;
&lt;li&gt;[MIT 6.006] &lt;a href="https://www.youtube.com/watch?v=BRO7mVIFt08&amp;amp;list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&amp;amp;index=10&amp;amp;t=0s" rel="noopener noreferrer"&gt;Lec.9: Table Doubling, Karp-Rabin&lt;/a&gt; (only Rabin-Karp part) (for pattern matching in strings)&lt;/li&gt;
&lt;li&gt;You can read about &lt;a href="https://www.geeksforgeeks.org/kmp-algorithm-for-pattern-searching/" rel="noopener noreferrer"&gt;KMP Algorithm&lt;/a&gt; from GeeksforGeeks (for pattern matching in strings)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Section 6 (FAQs)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Q1. Is STL allowed in C++ in placement tests?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes, you can import all the basic libraries using #include . But, if the question asks to implement certain functionality already provided by a built-in function, then the placement organizer may block the usage of that particular function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q2. Can libraries be imported in Python in placement tests?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes, you can import any library you want. But the organizer can limit your options in questions on Data Analysis like in the Publicis Sapient Data Science profile. As a rule of thumb, put the usage of libraries to a least.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q3. Is there any downside to using Python given that Python takes more time than C/C++?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No, the time limits to solutions are language specific. In general, only the complexity like O(logn) affects the acceptance of your code. But, note that this time Walmart put an absolute time limit on questions, likely a mistake from their side. An O(nlogn) solution didn’t get accepted in C++ or Python but an O(n²) solution got accepted in C. This was a rare incident and there isn’t anything that you can do in such situations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q4. Are we asked to solve programming questions in placement Interviews?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It depends on the interviewer. Some companies like Amazon asks to write proper code, (not pseudo-code) on paper. You need to practice writing code on paper beforehand. For other companies, the interviewer can either ask you to write proper code or pseudo code or may not ask a programming question at all. In such cases, your interview may revolve around your resume and other Aptitude questions/Puzzles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q5. Is OOPs important for placements?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OOPs is not important for coding tests and you won’t need to write classes or use inheritance etc. But, OOPs is important for MCQs in coding tests. Some companies have a joint MCQ &amp;amp; Coding test like Amazon. Also, OOPs is very important for interviews.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q6. Is it important to have software internships/experience to bag a placement in software engineering?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No, except for the walk-in interviews and cases when companies go for a resume-based shortlist (generally happens after Day 2). The only thing that is important is your coding test. I didn’t have any software experience myself and only had an ML internship. So my interview went around my ML project. In your case, it could revolve around your resume. Even so, having an experience in software is always a plus.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q7. How much CGPA and CV matter for placements?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There’s no straightforward answer to this question. I would try to answer this question from the perspective of the timeline of events in a job process for non-core software/ML profiles. First of all, companies open up and they put a general or department-wise cutoff. 7+ in most cases but higher in a few cases like Wells Fargo put 8.5+ for Mechanical Engineering. That’s where CGPA matters. After that, you give your coding tests and companies shortlist you based on your coding test performance. There may be 1–2 exceptions where the company also take into consideration your resume. So CV might play a role in 1–2 cases. After that, you go for your interviews and in most cases, only your performance affects your selection. There could be a few exceptions depending on factors like interviewer, profile and fellow candidates. So, your coding skills and performance in interviews (both technical and HR) are most important. Other things in general only help in clearing cutoffs. Even so, a good CGPA and CV are always a plus.&lt;/p&gt;

&lt;p&gt;That’s it. If you have come this far, you should have gained excellent coding skills. All the best for your placements/coding challenges.&lt;/p&gt;

&lt;p&gt;I have covered pretty much everything. I will update this post if I find anything missing. Thank You for reading and let me know in the comments about your experience in learning coding. If you liked reading this article, give me some claps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;p&gt;Some other resources that you may find helpful:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.geeksforgeeks.org/" rel="noopener noreferrer"&gt;&lt;em&gt;GeeksforGeeks&lt;/em&gt;&lt;/a&gt;&lt;em&gt;:&lt;/em&gt; A wonderful website for all the theories and explanations of different solutions to various programming questions. GeeksforGeeks would be your Handbook for coding.&lt;/li&gt;
&lt;li&gt;[BOOK] &lt;a href="https://www.amazon.in/Introduction-Algorithms-3Ed-International-Press/dp/0262533057/ref=sr_1_3?crid=1Q9X9WBSF9JRL&amp;amp;keywords=cormen+introduction+to+algorithms&amp;amp;qid=1575660481&amp;amp;s=books&amp;amp;sprefix=cormen%2Cstripbooks%2C1009&amp;amp;sr=1-3" rel="noopener noreferrer"&gt;&lt;em&gt;Introduction to Algorithms&lt;/em&gt;&lt;/a&gt; &lt;em&gt;by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein&lt;/em&gt;: For theory and a better understanding of any specific topic in Algorithms.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://stackoverflow.com/" rel="noopener noreferrer"&gt;&lt;em&gt;Stack Overflow&lt;/em&gt;&lt;/a&gt;&lt;em&gt;:&lt;/em&gt; For doubts or clarifications in programming questions/algorithms/your code.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-096-introduction-to-c-january-iap-2011/lecture-notes/" rel="noopener noreferrer"&gt;&lt;em&gt;Lecture Notes of MIT Introduction to C++&lt;/em&gt;&lt;/a&gt;&lt;em&gt;:&lt;/em&gt; In case you choose to learn C++, lecture notes of this course might be helpful. It’s not necessary to complete the whole course, only read the lecture notes.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://cse.iitkgp.ac.in/~abhij/course/lab/Algo1/Spring18/" rel="noopener noreferrer"&gt;&lt;em&gt;CS21003 Course&lt;/em&gt;&lt;/a&gt; &lt;em&gt;by Prof.&lt;/em&gt; &lt;a href="http://cse.iitkgp.ac.in/~abhij/" rel="noopener noreferrer"&gt;Abhijit Das&lt;/a&gt;, CSE Dept. IIT Kharagpur: For checking the proper syllabus of this course.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://drive.google.com/open?id=1VECOiHOAXGcLSzoXtWcGi4a57iAGXyIJ" rel="noopener noreferrer"&gt;Lectures Notes for CS21003 Course&lt;/a&gt;: Credits: Anubhav Jain, Student CSE Dept. IIT Kharagpur&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Edits
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Someday&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Corrected some linguistic mistakes and added more clarifications at certain points.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Added&lt;/em&gt; &lt;a href="https://leetcode.com/problemset/top-100-liked-questions/" rel="noopener noreferrer"&gt;&lt;em&gt;Top 100 liked questions of LeetCode&lt;/em&gt;&lt;/a&gt; &lt;em&gt;in the last Note of Section 1.&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;12-Feb-2020&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Corrected some linguistic mistakes and made some points clearer.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Moved the OOP section from Resources to Section 4.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Added&lt;/em&gt; &lt;a href="https://www.geeksforgeeks.org/" rel="noopener noreferrer"&gt;&lt;em&gt;GeeksforGeeks&lt;/em&gt;&lt;/a&gt; &lt;em&gt;in the Resources section.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Added some points in the section of ‘Programming Language’ to help choose between Python and C++.&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;10-March-2020&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Added a few images to balance the wordiness of the post.&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;17-May-2020&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Added resource for theory of Hashing in Data Structures in Section 1 (first Note there).&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Added 3 lectures (№2:Recursion Trees, №5:Recursive Thinking, №11:Matrix Multiplication and Master Theorem) in Algorithms of section 1.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Added 1 lecture for Greedy Algorithms (№4) in Section 2.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Added 3 lectures (№5:Minimum Spanning Tree, №8:Bellman Ford, №9:Floyd Warshal Algorithm) in Section 3.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Added Section 5 for certain topics/algorithms that are generally taught in algorithms courses but are&lt;/em&gt; &lt;strong&gt;&lt;em&gt;NOT&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;important for placement tests.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Added&lt;/em&gt; &lt;a href="https://cse.iitkgp.ac.in/~abhij/course/lab/Algo1/Spring18/" rel="noopener noreferrer"&gt;&lt;em&gt;CS21003&lt;/em&gt;&lt;/a&gt; &lt;em&gt;website in the Resources section.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Added&lt;/em&gt; &lt;a href="https://drive.google.com/open?id=1VECOiHOAXGcLSzoXtWcGi4a57iAGXyIJ" rel="noopener noreferrer"&gt;&lt;em&gt;CS21003 course notes&lt;/em&gt;&lt;/a&gt; &lt;em&gt;of Anubhav Jain, student CSE Dept. IIT Kharagpur.&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;18-May-2020&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Shifted the Edits section after the Resources section.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Changed some images and a bit of face-lift. No change in content.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Added Regular Expression (regex) in Section 4 (Point №6).&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;22-May-2020&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Added missing link to lecture on Bellman-Ford (№8) in Section 3&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;02-July-2020&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Corrected some linguistic mistakes.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Added some explanation at the start of Section 4.&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;23-July-2020&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Added Section 6 for FAQs (added Q.1, Q.2, Q.3) about placement tests and placement Interviews that I often encounter on various forums. I will keep adding relevant questions here.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Added the following Note before Section 1: “&lt;/em&gt; &lt;strong&gt;&lt;em&gt;Note&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;: Please note that I keep editing this article to best add all the relevant information/resources. I maintain a history of all the edits that I make so that it is easy for you to follow the changes if you are revisiting this article. So in such a case, please check out the&lt;/em&gt; &lt;strong&gt;&lt;em&gt;Edits Section&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;at the end of this post to check if anything is added after you last visited the article.”&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;24-July-2020&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Added Q.4 in Section 6.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Added GeeksforGeeks link to&lt;/em&gt; &lt;a href="https://www.geeksforgeeks.org/floyd-warshall-algorithm-dp-16/" rel="noopener noreferrer"&gt;&lt;em&gt;Floyd Warshall Algorithm&lt;/em&gt;&lt;/a&gt; &lt;em&gt;(Lecture 9) in Section 3.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Edited solution of Q.2 in Section 6 to include libraries (heapq, collections, random and bisect) that are generally imported in Python for CP problems.&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;10-Sep-2020&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Italicized all the notes to differentiate them from the text. No change in content.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Moved the note in Section 1: A) Programming Language from middle to end. No change in Content.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Stripped down answers to Q.2 and Q.3 in Section 6 : FAQs&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;08-Oct-2020&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Added Q.5, Q.6 and Q.7 in Section 6: FAQs&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;25–July-2023&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Improved the writing w.r.t. Hemingway Editor. Re-worded the article, with no material changes.&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>howto</category>
      <category>programming</category>
      <category>tech</category>
      <category>career</category>
    </item>
  </channel>
</rss>
