Saturday, January 23, 2021

Desirable Difficulty

UCLA professor Robert Bjork has argued that desirable difficulty is actually required for us to upskill and move to another level.

Consider two kinds of batting practice. In one, the pitches are chunked into categories—twenty-five fastballs, twenty-five curve balls—in a predictable rhythm. At the end of this practice, hitters reported feeling a sense of confidence and flow.

The alternative involves mixing up the pitches randomly. Here, the batters reported frustration and less satisfaction. But teacher Torre’ Mills points out that the random method, where desirable difficulty is at work, actually improves players’ skills more than the chunked approach.

Desirable difficulty is the hard work of doing hard work. Setting ourselves up for things that cause a struggle, because we know that after the struggle, we’ll be at a new level.

Learning almost always involves incompetence. Shortly before we get to the next level, we realize that we’re not yet at that level and we feel insufficient. The difficulty is real, and it’s desirable if our goal is to move forward.

When we intentionally avoid desirable difficulty, our practice suffers, because we’re only coasting.

The commitment, then, is to sign up for days, weeks, or years of serial incompetence and occasional frustration. To seek out desirable difficulty on our way to a place where our flow is actually productive in service of the change we seek to make.

Seth Godin. “The Practice.” 

Monday, January 18, 2021

Learning Environment

 Learn in a relaxed environment. The best recall occurs when brainwave patterns show a relaxed state.

Learn in a multi-sensory environment by involving visual, auditory and kinesthetic activities.

Use color! This stimulates the right brain and helps recall.

Make sure you take breaks every hour.

Try to relate what you are learning to a bigger picture.

Reinforce what you have learned through practice and review.

Saturday, January 16, 2021

Remove whitespace from file names in Unix/Mac

 Go to the folder where the files are located and run:

for f in *; do mv "$f" `echo $f | tr ' ' '_'`; done

Thursday, January 14, 2021

Upload File to S3

 require 'aws-sdk-s3'  # v2: require 'aws-sdk'



REGION_ID = "us-east-1"

BUCKET_NAME = "bucket-name"

def uploadS3

  credentials =




  s3 =

                          region: REGION_ID,

                          credentials: credentials



  #Upload export/, export/

  for file_name in ['', '']

    name = File.join('export', file_name)

    # Upload, 'rb') do |file|

      puts "start uploading #{file_name} to s3"

      resp = s3.put_object(bucket: BUCKET_NAME, acl: "public-read", key: file_name, body: file)

      puts resp


    puts "File should be available at https://#{BUCKET_NAME}{file_name}"



Thursday, January 07, 2021

Law of Success

  1. Fall in love with the process.
  2. Do it every single day.
  3. Celebrate your commitment.
  4. Track your metrics and data.
  5. Master your craft.

Tommy Baker. “The 1% Rule: How to Fall in Love with the Process and Achieve Your Wildest Dreams.” 

Wednesday, January 06, 2021

Live Coding 175 Session Recordings Now Available

We have now over 175+ live coding recordings for Leetcode live coding sessions. That is over 200 hours of discussions on coding problems. We are a group of developers preparing for FANG interviews. We meet everyday and work collaboratively on solving one medium Leetcode problem via Zoom.

This is NOT a study group. We flip the classroom. You study whatever resources you find useful before the meeting. We only focus on PRACTICE and FEEDBACK during the Zoom calls. We share tips and the peer to peer learning has worked really well so far.

I started the daily live coding sessions on July 25th, 2020. I have learned in just two months as much as I have learned in one year when I was studying and practicing by myself. Members requested me to record the sessions so they can watch any sessions that they miss.

We don't rush into coding. We analyze the problem, create a model of the problem and use the model to answer questions. We then brainstorm alternate approaches to solve the problem starting with brute-force and eventually code the optimal solution by the end of the session.

This is not passive learning like watching videos. The paid courses ask you to pause the video and think. But no one teaches how to think and ask questions to solve problem from scratch. We code the solution to problems from scratch.

Our group hates memorizing and we focus on gaining deep understanding of the concepts. Join Leetcode Live Coding Telegram group:

You will also get access to the Zoom cloud recordings. You will develop insights on how to approach coding problems and you don't have to memorize anything. You will learn how visualizing the key aspects of well known algorithms can make it easier to understand the algorithms at a deeper level. 

Tuesday, January 05, 2021

Topic Wise or Random Practice ?

 Topic wise practice if fine when you are learning the basics of data structures and algorithms. You basically can be operating in either Learning Mode or Practice Mode. When you are in learning mode, it's ok to practice by topic otherwise you should not be practicing by topic. Because, you have to develop the ability to recognize what data structure and algorithm to use just like a real interview.

Leetcode Live Coding Thread Discussion Link