12 things I learned in 2016

maxresdefault

Life is about trying out new things. How else are you supposed to know what are you good at. You get to live only once. Make sure it’s worth it. At the end of every year, I try to jot down the things I learned, all good and bad ones. While I find few of them worth cherishing, others are equally valuable to teach us lessons of life. 2016 was a wonderful year. Words would fall short to pen it. For the past few years, I had been wondering what my life is meant to be, what are the things out there which will render me with greatest pleasure, what is the secret ingredient of being happy. It was the year when I finally found the core where my happiness lies. While last year was fully devoted to my physical transformation, this year my focus was mainly on building my skills, to become a better version of myself. People often ask me about the trigger point of all these crazy stuffs that I do. Few people even asked me why do I not value money. All I can say is that they haven’t gone through the dark phase of life which I did. I have witnessed that anything can happen in the blink of an eye. We humans are mortals, made of flesh and blood. All it took me was an event to realize the value of life. Waking up each morning and finding yourself in best health is a blessing. 2016 was a year of diving into the artistic world – Poetry, Photography and Piano. Perhaps, someday I will compile another experience about these 3 P’s of my life.

So what was that event that changed me for good? My life was greatly influenced by the movie Zindagi Na Milegi Dobara (You won’t get a second life). I literally wanted to live it big while trying out all the crazy adventures, exploring the world and having hands on new things. As of now I have tried Bungee jumping, Sky diving, Scuba diving, Para sailing, Sea walking, Flying fox, 18 kms River rafting. In one of the adventures, I met an accident which took from me precious 72 days of my life. It left me devastated and broke. I had no clue on what to do. You can earn lost money but not the lost moments. They are priceless. I could give anything to get back the old life. What kept me alive, more important than oxygen and blood was hope. I realized what Pandora’s box is all about.

cgglimpuoaachkf

All this time, I couldn’t stop myself asking same questions over and over again. Did I live my life the way I wanted to? Or was it influenced by how others wanted me to? What if there is no tomorrow? The answers of these questions steered my thoughts about how my life should be in a complete different direction. While I am done with adventures, I realized that there are other domains worth exploring. Toughest phase of life teaches you lessons nothing else can.

life-lessons-quotes-sometimes-painful-things-can-teach-us-lessons-that-we-didnt-think-we-needed-to-know

Following are 12 lessons I learned in 2016:

1. Live life as if there is no tomorrow. And if you get a chance to witness tomorrow, do it all over again

2. If you love something, make it a habit: Do it regularly, be it playing piano or photography. It will help you improve your skills and to become a better time manager

3. Don’t procrastinate things that don’t take much time doing: Ever forgot to pay electricity or credit card bills on time and regretted doing it instantly you got the bills? If a piece of work requires less than 5 minutes of your attention, do it immediately instead of postponing it. These small tasks usually pile up and then takes more of your time than it should.

4. Had a breakup? Build up your skills: I won’t lecture much on this topic. Love is the sweetest fruit. But sometimes it doesn’t go according to your wish. If you suffered a broken heart, keeping yourself busy helps a lot. Try to learn something new.

5. Find happiness in whatever you do: Science has proven that you learn something quickly if you enjoy it. Happiness plays a very key role in your success. Look at successful people around you. They are far better than others because they love what they do. Don’t do anything just because everyone else is doing. Do it because your passion drives you

6. Meet new people, they have lots to tell you. Examples are better than precepts. People experience life differently. Sometimes talking to them is no less than watching a fiction.

7. Hope is a good thing. Don’t underestimate it

8. Choose friends wisely. Not everyone you consider friend will understand you when you will be undergoing hardest phase of your life. I learned this the hard way

9. When you feel left out, a lone wolf, write your heart out. Believe me, this is how I started writing and it is fun

10. Your parents love you. They will support you when noone else will. You should always try to find time for them no matter how busy your life is. As a matter of fact, I have noticed that people are not that busy. It’s all about managing time and priorities.

11. Wake up an hour early to feel the power of time. Have you ever woke up early and found yourself binding up a lot of smaller tasks? Were you not amazed by finding out how much your day changed? You plan your day in advance and observe the difference between an adhoc and well managed day. Remember, you don’t need an assistant for that.

12. Every year go somewhere you have never been before. Every month take a day off from social networks

Each one of us have different ways of narrating story because we live differently, perceive differently and react differently. If you love reading my way of telling the story, you might like other experiences I penned here – My life experiences.

Here is a list of 12 things I learned in 2015

If you like my writing, please follow my:

Copyright © 2016, Aashish Barnwal,  All rights reserved.

Wanderlust

b8nbwjccaaeunho

What to say about wonders of travel,
Never ending mysteries are there to unravel,
No matter how much I wander around,
Something new renders me spellbound,
Varieties of culture and exotic food,
Millions of reasons to uplift my mood,
A thirst which never seems to be quenched,
That is why, it’s called wanderlust my friend,
I wish I could travel forever and ever,
Far from the materialistic world, in the lap of nature.

If you like my writing, please follow my:

Copyright © 2016, Aashish Barnwal,  Some rights reserved.

The final goodbye

I very well remember the day I met you. The day I saw you, I talked to you.
As I’m writing this, all those golden moments we spent together are flashing in front of my eyes. Those were some of the best days of my life and you changed me for good. I learned to laugh. I learned to care. I learned to see the world from a different perspective altogether. All I can say is that you have given me memories I will cherish. You had a bad impression on me in a good sense. I am a very careful person. But for some reasons, it was hard to be careful when you were around me. I am the kind of person who prefers to bottle up the feelings to make sure noone gets hurt.

While I always liked you and loved you, you never really cared about my feelings. All those long hours were fake. Somehow, I feel you knew this all along. I waited long, really long. Days, weeks, months. 

So it’s enough.

I can’t do this anymore. I can’t let emotions trick me into false believes that we can be together. If we were meant to be together, it would have already happened.

In this dilemma between heart and mind, heart has played me enough. Love was always my weakness. It’s time to let mind take the decisions. It’s time to move on. So here is me, letting you finally go. I wish you all the best. Whatever you do, be happy. Because it was your smile which made me fall for you the very first day.

Copyright © 2016, Aashish Barnwal,  All rights reserved.

Person of Interest review

poi-header

You are being watched. The government has a secret system: a machine that spies on you every hour of every day. I know because I built it.
I designed the machine to detect acts of terror, but it sees everything. Violent crimes involving ordinary people, people like you. Crimes the government considered irrelevant. They wouldn’t act, so I decided I would. But I needed a partner, someone with the skills to
intervene. Hunted by the authorities, we work in secret. You’ll never find us, but victim or perpetrator, if your number’s up…we’ll find you.

What did I just watch?

So I just finished watching last episode of Season 5. All I can say is that Person of Interest, a Nolan’s masterpiece is the best TV series I have watched till date. Most intense, best actors, excellent acting and gripping story which only gets better with each episode. What do you expect when you start a TV series? Good acting, story that holds you tight, witty dialogues. Well, it has everything in it. It got me hooked right from the very first episode.

Spoilers ahead… Read at your risk.
The story revolves around a person who happens to be the best coder and hacker world has ever known, or more precisely, the world should know, because he is very good at avoiding digital footprints. You just can’t find him on web. In the very childhood, he learns that a system should be made robust. If they don’t want you to get inside, they ought to build it better. And thus he builds a machine, an AI that can watch every single moment of everyone’s life, listen every phone conversation, read every text, has access to every database and analyse it to find out if anyone is at risk or going to do something wrong. The machine becomes so intelligent with time that it starts talking to people, giving commands, hiring snipers to protect her primary assets and establishing a company. The creator hired John Reese, a former badass CIA guy to fight crime, to protect people whose number have come up. The story becomes intense when a parallel AI comes into picture who is given full control. Two gods fighting with each other where one has the mission to protect human kind at all cost while the other with motive that few people must be sacrificed for the greater good. I can’t say what did I like most in the show, was it the hot sexy root whose seducing sounding voice is embraced by the machine after she dies or confidence and panache portrayed by Mr Reese, the man in bespoke suit who is near to untraceable or Finch who never fails to surprise you with his geeky words or Greer, dark yet convincing, lies yet authoritative tone in his voice.

Some of the episodes are freaking so awesome that make you feel sometimes, TV series can be better than movies.
There were pleasing moments when machine behaved like a human child asking its creator very innocent questions:

But if you erase my memories, how will I learn from my mistakes?
How will I continue to grow?
And how will I remember you?

Another conversation between her and its creator, she had asked Harold to teach chess:

Harold Finch:[to The Machine in a flashback to 2003] You asked me to teach you chess and I’ve done that. It’s a useful mental exercise. Through the years many thinkers have been fascinated by it. But, I don’t enjoy playing. Do you know why not?
[Receives a ‘No’ reply on his cellphone]
Harold Finch: Because it was a game that was born during a brutal age when life counted for little and everyone believed that some people were worth more than others. Kings and pawns. I don’t think that anyone is worth more than anyone else. I don’t envy you the decisions you’re going to have to make. And one day I’ll be gone. And you’ll have no one to talk to. But, if you remember nothing else, then please remember this. Chess is just a game. Real people aren’t pieces. You can’t assign more value to some of them than to others. Not to me. Not to anyone. People are not a thing that you can sacrifice. The lesson is… that anyone who looks on the world as if it was a game a chess deserves to lose.

Dialogues from the show I really liked

162e0dd2bd1ac8670037d730132cdc32
nplavjrirydfpkabsziy8ftz7r5tu71shmyeqxo0g2g

Sure, Everyone dies alone.
But if you mean something to someone,
if you help someone or love someone,
if even a single person remembers you…
Then maybe…
you never really die at all.

cgglimpuoaachkf

Episodes you must watch

  • The Day the World Went Away (Season 5)
  • 6,741 (Season 5)
  • If-Then-Else (Season 4)
  • return 0 (Season 5)

Why should you watch this show?

If you love Sci fi, love code, big data and power of AI engrosses you and you think that logic is God, this show is for you. The series will keep you sit tight right from the beginning to the end and there will be times you will find yourself biting nails to know what is going to happen next. If you haven’t watched it, watch the first episode. You will definitely like it.

Other movies of similar kind I loved

Source code, Eagle eye, Live free or Die hard

Copyright © 2016, Aashish Barnwal,  All rights reserved.

How to prepare for top MNCs?

This post was residing in my draft for quite long. I finally got some time out of my busy schedule to refine it.
The first question quickly pops up on why am I writing this post at all. There are already tens of hundreds of similar compilations on web that talks about this.

Well, following reasons compelled me to do so:

  1. Being a GFG moderator, I’ve been getting many requests from readers through various social media (FB, LinkedIn, Quora, InstaGuide) and various mail clients asking for mentorship and guidance on how to prepare for top MNCs like Microsoft, Amazon, Google etc
  2. Having gone through similar journey and witnessing many of my friends succeeding, I feel knowledge should be shared. My experience might be useful for newer generations who happen to chase the same goal as once was mine

Please note that this article is purely a reflection of my learnings, what I followed through the years and my experience. This is NOT the only way to improvise on what is needed – your coding skills, strengthening DS & Algorithms and boosting problem solving skills. I repeat, this is NOT the only way. There are things I couldn’t follow because of time constraints or didn’t follow because I was just not aware. Please comment if I missed anything which is worth mentioning here.

Language

Language has been a topic of debate between aspirants since years. It’s always good to master one language, knowing ins and out of it rather than hopping from one language to other. Why?  Because sometimes it might happen to you that when you get a problem, you start wondering what language you should choose and your focus is compromised. When you should really concentrate on problem solving, Implementation comes later. Then while you are coding, you plan to change the language in between. This won’t serve you good in interviews. If you’re able to solve a problem in language ‘X’, eventually you will also solve it in language ‘Y’. Learning a new language is just a matter of time. A language might not be as widely used after 5 years as it is being used now. Your ability to solve a problem will what matter in the long run.

I usually switch between C and C++. If time is at its crunch, I prefer to use STL (standard library functions) instead of writing my own version of Linked List. If I want to develop a project, an android app for instance, I go for a managed language because it is easier. If I want to automate something to save my time, like replying and liking my birthday wishes, a python script is the saving grace. You got the point, right? Master one language and learn others as per requirements.

Data Structures and Algorithms

Data Structures and Algorithms is very important and serves as the backbone of problem solving.

For beginners, Fundamentals of Data Structures in C by Sahni Horowitz is good. After reading it, you should be able to understand basic Data Structures, how they are implemented and fewer examples where they can be used. Don’t expect to learn advanced DS through this. After your basic concepts are clear and you are comfortable implementing them in a language of your choice, you can work on learning algorithms and solving problems.

Many sites (including GeeksforGeeks) present problems in a very adhoc manner with no order of difficulty level. This makes things difficult for beginners because they don’t know the difficulty level of the problem they are attempting. Data Structures and Algorithms made easy by Narasimha Karumanchi is a good read after you are comfortable with the basics. It has pretty good collection of problems organized by difficulty level. Just make sure to try to solve problems on your own instead of rushing for the solution. Once you have a fair understanding of DS and have got some confidence in solving problems, jump to online portals and start solving problems from topic of your choice. GeeksforGeeks is good to start with.

For Algorithms, Introduction to Algorithms by Cormen is a must read.

Advanced Data Structures

Sometimes, basic DS don’t serve the purpose to solve problems and you need to know advanced DS. Day to day problems like implementing a prefix based search for a phone contact list to finding the dictionary word from a jumbled sequence of characters need special kind of DS. There are many of them – TST, Trie, Suffix tree, Suffix array, Fibonacci heap, Segment tree, Gap buffer, Rope, Skip list, K Dimensional tree and so on. While it is good to know the implementation of these DS, I would suggest to also know when to use one.

Problem solving

So you got a gun, understand how to use it, probably have used it before. If you are going to fight a war, you won’t like to rely upon your amateur experience. You would prefer to practice hard to save your ass. Now try to think it in perspective of problem solving. You know what DS are. But you also need to know when to use one. Welcome to the world of problem solving. You are given a problem and you are asked to solve it. That problem can be anything starting from a simple puzzle to implementing a user scenario. You must have noticed degree of connection feature in LinkedIn. How will you implement it? Does your approach take care of scalability? Will your code crumble when user base increases ten folds? This is the most important skill top MNCs usually look for. How do you approach a problem? How do  you divide it into modules? How do you solve each of them and then combine them?

Dynamic Programming

I separated out DP because it is one monster which is difficult to master upon. No matter how many problems did you solve in the past, a new DP problem can always surprise you. The more you will practice, higher the chances will be to find out patterns. Google is peculiar about DP. You should expect at least one DP problem per interview round  if you are preparing for Google. Practice DP section from:

Competitive Programming

Competitive Programming plays a very important role in boosting problem solving skills and ability to perform under time pressure. Do participate in various online portals like TopCoder, CodeChef, SPOJ. Here is a post on Getting started in sport of programming.

Design and testing

So you are good in DS and Algos. You are probably good in problem solving as well and you come up with different approaches with varying time and space complexity. The problem which you solve in Competitive Programming is well defined and has to work under an environment which nobody will probably use. What if you are asked to implement a user scenario. The problem statement is usually vague and you need to discuss a lot to resolve ambiguities. This is where design comes into picture. How will you design a redo-undo feature? What data structures will you use to store history in a web browser? How will you implement auto-complete feature in address bar? Let’s say Amazon wants to build a feature that would resume a video stored in cloud from any device. What data structures will you use? How will you scale up things? Does your design take care of concurrency issues? What about the performance? What if you and your girlfriend share the same cloud account and are trying to play the same video from different devices?

Now you have thought through the design well, have come up with different data structures to use with pros and cons in mind. While implementing, you must take care of corner cases. You must be aware about the integer overflow issue in Youtube video view count. While implementing, they never really thought that the view count can exceed what an integer variable can hold and BOOM, the view count cycled back to zero.

Before a feature goes live, it must be tested well. It is good to practice some test questions as well. How will you test a Insert image feature in MS Word? What about a cut-copy-paste feature? How will you test Temple Run game? Try to write all the possible test cases and how you are going to handle this in your code. Writing a robust code is very important. If you take care of these things at an earlier stage, you can avoid silly bugs (and boost your chances of getting selected in interviews).

What else?

Have a sound understanding of Operating System. The dinosaur book by Galvin is a good read. Know how networking works and have insights on DBMS.

Resume building

First impression is the best. Resume is the first thing that HR will use to decide whether to call you for interview or not. And they have got hundreds of them. So they will usually scan it for 20 seconds to 2 minutes. It should be clean, concise and elegant. Each word mentioned should worth the space it eats. The rule of thumb is if you have less than one year of experience, the size of resume should not exceed a page (with few exceptions).

Few points to note:

  • Maintain a header to fit info like name, email id, address and contact number
  • Mention level of expertise corresponding to each language. Example: Proficient in C and good at Java
  • If you are mentioning a project, write your key learning, impact in the team and . If this project is online (an app), don’t forget to include the link. This will show that you built something that is being used by people . Guess what, this is what companies do, building a product, stabilizing it as per user feedback, taking in new feature requests and so on.

Here are few useful tips from Gayle – What are common mistakes that applicants make when writing their resumes for tech companies?

How to apply for Microsoft?

I get many messages asking me for a favour to refer them. When I ask them how much comfortable they are with DS and Algos, they say good enough. Then I rephrase my question to how do they feel when they solve interview experiences at GeeksforGeeks. Either they haven’t heard of GeeksforGeeks or they never read. This is not a surprise. GeeksforGeeks is still growing. But when I ask them a problem on DS by tweaking already existing famous ones, all they say is they haven’t solved this problem before. Please do NOT do that. Dreaming is good, but it will come true only when you work towards making it a reality.

If you are not able to clear the interviews, you will have wait again for 6-12 months depending on the company policy before you can apply again. Now coming to the point,  you can apply for a position at Microsoft either through Careers page or through referral. Referral usually bumps chances of getting an interview call because your resume gets to the system through a person Microsoft trusts to be a good engineer. How do you ask for a referral? It’s simple. Forward your resume to someone you know working there. No one will say NO unless your resume is filled with something which doesn’t fit company requirements. Rule of thumb is we believe in solving problems and if you are good at it, we would love to see you here. Remember, everyone wants to work with a smart person. And this is usually true for any company, not just for Microsoft.

Do’s and Don’ts

  • Practice, practice and practice
  • Make a habit of writing clean and readable code (avoid variables names like i, j)
  • Make sure to handle all corner cases
  • Use pen and paper to practice code. In interviews you have NO access to a compiler
  • Don’t mug up the solutions. Try to solve on your own
  • Think of different ways of solving a problem and thoughts on why one should be preferred over the other

Resources

I have answered few questions related to interview preparation on Quora. You might find some content missing here in blog and it is intentional to avoid the duplication of efforts. Please read my technical answers here.

Resources (which I haven’t talked about):

  • Cracking the coding interview by Gayle Laakmann: A must read once before interviews. It covers aspects like what interviewers expect from you, how to deal with behavioral questions and few interesting problems. It will change your thoughts about design and test problems for good
  • GeeksforGeeks: A bible of problems (with well explained solutions). Make sure you do NOT rush for solutions. Try to solve problems on your own no matter how much time does it take. With time and honest practice, you should get better
  • CareerCup: A huge collection of problems. Though you can’t rely upon solutions, it provides a rich community for discussing problems. I found it good for discussing design problems
  • Project Euler: A heaven for mathematics lovers. You solve the problems using some formulas on paper and then write code to get the final solution. Solve at least 40 problems from this site.

You might like following write ups:

PS: This blog is published on GeeksforGeeks.

Good luck!

If you like my writing, please follow my:

Copyright © 2016, Aashish Barnwal,  All rights reserved.

Stranger. Friend. Lover. Acquaintance. – Part 1

love-pse-copy

A thousand memories rolled down like a motion picture in his eyes when he heard her name after all those years.
“Just an acquaintance”, he whispered with a hard smile as his eyes were strong enough to hold the tears.
He always found challenging to express his feelings for her. How life could have changed if he would have dared once, had spoken those feelings ballooned inside the heart, he was wondering. He knew, somewhere she too had a soft corner for him.
Someone has rightly said, When in love, express it, keeping it to yourself doesn’t help either.
All those memories started playing like a flash motion. He was time travelling in the memory chains.
How can he forget the very first, all of a sudden, small chit chat with her. He still remembers that evening in the library, that she had turned from boring monotonous into a beautiful memory that he still cherishes.
“Hey! I am Ritika”, she said in a joyous tone and moved her hand in an amicable gesture. I am not sure if we know each other, but we are in the same section.
Well it was sort of most unexpected event one could have ever imagined. His eyes grew wide in surprise and he felt like someone has poured bucket filled ice inside his stomach.
Did she catch him looking at her from the corner of book? It was true that he visited library in evening hours just to see her, to see her smile. Her smile that always seemed to hypnotise him. There was such an enchantment she had in her sapphire blue eyes. He could feel his tongue magically glued with some invisible string.
“Hey! I am Ritika”, she chirped again. This time she was smiling. He guessed she had figured out he was not expecting her, at least not at this point of time, when there were people around, sitting in couples, reading, teaching and whispering so called romantic talks.

Somewhere on another thread in his mind was executing few poetic lines…
He kept looking at her and time flew by,
He wondered why he couldn’t take his eyes off her face,
Like the moon and its moonlight,
He kept looking at her with awe,
But never imagined he would get to see her so closely.

“Oh Hi!”, he replied briskly.
“I am Siddhartha”, he was very quick and nervous. “You can call me Sid”, he further added.
“If you don’t mind, can you please help me with few questions? Exams are near and there is so much to read and I haven’t got many friends”, she was somehow able to bind all these words in a deep single breathe. He didn’t need to be very observant to say she had prepared this in prior. She indeed knew well how to break the ice.
“Yeah! Sure”, he still couldn’t believe all this was happening in reality.
She pulled a chair and sit beside him opening the book. His senses were lulled by her ravishing perfume as she pushed herself closer to point to the problems she was finding difficulty into.
“What will he do when he is not able to solve the problem? No, it won’t be good to loose impression in the first encounter itself. She had confidence in him and what will happen if he breaks it. Won’t she think he is just a show off?”, his head was spinning with many questions. Fear seemed to wrap him under her arms.
“But he hardly faced problem in maths before. After all it was his favorite subject and he could spent hours solving equations and all as if it were his girlfriend”, another voice was overpowering the cold fear.
The problems turned out to be a cake walk. There were few instances when he felt she already knew the solution. “Is she testing his intelligence?”, He spoke to himself.
He didn’t have to think much. It was already 6 in the evening and she needed to rush for the hostel. She broke his reverie by snapping her fingers.
“It was nice to meet you Siddy. Hope to see you soon”, she said in sugar coated voice and hurried herself outside the library room before he could say anything. “And thanks”, a distant voice broke the grave silence.
That evening was different. He could feel it. And he realized it when his roomie asked, “Why are you smiling on your own?”
“Just remembered an old joke on pudding”, he replied trying to hide what had just happened.

Few moments no matter how long, give you the best smile, the best happiness.   He spent whole night awake listening to “Only you” in loop.
Looking from a window above, it’s like a story of love
Can you hear me
Came back only yesterday
I’m moving further away
Want you near me

All I need is you to stay
All I need you for another day
And all I ever knew
Only you

To be continued…
Signing off for now. Hope you enjoyed reading this. Next part coming soon. Stay tuned!
-AB

If you like my writing, please follow my:

Copyright © 2016, Aashish Barnwal,  All rights reserved.

12 things I learnt last year

Life is all about how you live it. We all have got same 24 hours in a day. Some achieve much. Some achieve less. Some do wonders. Some do blunders. It’s about what we learn from our mistakes. This is the top 12 list of things I learnt last year.

1. Be brave. Pretend to be, even you are not. Nobody will know the difference. People cannot read your mind.6G4Ij41463673941

2. Dare to take risks. You would regret less about the things you did than the things you didn’t.vU4EhV1466787770

3. Your virtual life is not going to help you in your physical problems. Find some time out of your busy schedule and meet people you care about.

4. Learn to say NO.Learn to say No

5. Don’t waste time worrying about the people who don’t spend time worrying about you.

6. When angry, count ten.qnycg31466791917.jpg

7. Don’t do bad to people if you can’t do good. You will feel good in the long run.

8. Keep smiling. A simple smile could have you looking several years younger in an instant.Smile

9. Don’t compare your life with the people around you. You have no idea what their journey is all about. l-12487

10. When in love, express it. Keeping it to yourself doesn’t help either.Express love

11. There will be times when you would feel like king of the world. Be patient, humble and down to earth, because that is how people will remember you.hijuoZ1466790187

12. You can sometimes be wrong. Apologize for your mistakes and learn to appreciate people for things they do.8GcIao1466789510

Copyright © 2016, Aashish Barnwal,  All rights reserved.