How to Keep Problem Solving Skills Up to date?

Hello everybody, this is an article about how to keep yourself up to date with problem solving skills. It doesn’t have secret recipes or what so ever, but some advice from experiences.

I see so many people asking the question “I am going to start the automation, which tool should I use?” in LinkedIn or in other platforms. That kind of questions is coming mostly from people how never did less of any coding in their professional career. Fewer people ask “Which language should I use?”, this is also not a good question but at least better than the first one.

What should we do to improve problem solving skills?

My advice, don’t care about the tools or libraries when you start your automation journey. Those things tend to change over time like any tool that we use. They evolve from time to time. But mainly we use our problem-solving skills while using a tool or library. When you work as a test automation engineer,  you will face similar challenges in any project. You will stick to one solution and after a while, you will complain by asking yourself “What am I doing now, it’s always the same problem and solution”. This is where keeping your self up to date comes in to play.

Let’s think about the below question.

Given a string, , matching the regular expression [A-Za-z !,?._'@]+, split the string into tokens. We define a token to be one or more consecutive English alphabetic letters. Then, print each token on a new line.

The string is

He is a very very good boy, isn't he?

And The Result should be

He
is
a
very
very
good
boy
isn
t
he

How would you solve the problem?

Let’s start with silly ones.

  • You might clean the string by a special character.
  • You split the input by blank spaces.
  • Then print the result.
String input = "He is a very very good boy, isn't he?";
input = input.replace("?","");
input = input.replace("!","");
input = input.replace(",","");
input = input.replace("'"," ");

String tokens[] = input.split(" ");

String output = "";
       for (String sample: tokens
	) {
		System.out.println(sample);
	}

But it is really silly. There is always other, better ways to solve any problem. I just improvised.

How we can solve the problem in a better way. Let’s try new methodologies.

  • Do some regular expression to tokenize our input string to an array.
  • Convert the array to a collection
  • Eliminate  empty values and print the tokens
String regex = "!|\\,|\\?|\\.|\\_|\\'|\\@|\\+|\\s+";
String input = "He is a very very good boy, isn't he?";
String token[] = input.trim().split(regex);

Collection<String> coll = Arrays.asList(token);
coll.stream().filter(item-> !item.isEmpty()).forEach(System.out::println);

No for each loop or no additional lines for removing specific characters from your string. Just pure Java8 stream functions and some regular expression. It also reduced the code complexity.

Finally

  • Keep your programming skills at best, not automation skills. They will eventually get better.
  • Always keep your self up-to-date with the new feature of the libraries you use. Don’t stick to Java7, Java8, etc. If you can update everything in the project, update them and use new features.
  • Use hackerrank or similar web site to master your algorithm skills. Right now, most of the companies conduct online exam for automation engineers also.

Thanks.
Canberk

1 thought on “How to Keep Problem Solving Skills Up to date?”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.