r/learnjava • u/everythingido65 • Jul 01 '19
I'm quite slow at solving problems and it is kind of worrying me.
I'm extremely slow at understanding problems and developing solutions for the problems.For example the easy level problems in Hackerrank on an average takes me 1-2 hr to complete.I cannot understand how to improve my time.
18
u/carrdinal-dnb Jul 01 '19
You have to solve lots of different types of problems before you are able to solve new problems quickly. This is simply because lot's of problems have similar solutions. Try researching programming patterns as this will add a bunch of generic solutions to problems you will encounter often.
11
u/AxelCS Jul 01 '19
Back when I was in college I would sit in the library for like 8 hours+ just trying to figure out super simple problems. Now after having fully learnt the basics, figuring out how to pose questions and knowing when to take a break, I'm significantly faster at solving problems I don't originally know the answer to. Just keep at it, it gets better, everyone started in the same spot don't worry, you shouldn't be competing with everyone else, just with yourself. Do better than yesterday's you.
6
u/jkuhl_prog Jul 01 '19
If you aren't slow when solving your first programming problems, you came into this world a genius.
11
u/Naesme Jul 01 '19
Practice makes perfect.
Just keep working. Speed is a passive skill that increases in time and is influenced by several things. It should never be a focus when programming.
Focus on understanding what you're learning. That'll be the biggest factor in how fast you program. An exercise I use is to always think of how I would write a program for just about anything I do. I don't always end up following through with a program, but always being in that mindset helps ideas flow quicker when I do program.
When you're doing coding challenges, make notes of the ones that give you trouble. Do some research on different ways to approach the problems and work on understanding the idea behind each solution. In a week, go back and work it again. You'll start improving slowly but surely.
1
4
u/Nelabasis Jul 01 '19
Don't worry, I feel the same after work today... The simpliest bugfix solutions takes me hours to think of...
2
u/Java_Junior Jul 02 '19
i spent the last two days trying to solve a problem at work.
i just needed to delete one line of code.
2
1
u/___catalyst___ Jul 01 '19
It may be helpful to take an Algorithms course starting from Basic to Advanced. Algorithms teach you how to think about problems in programming terms very efficiently.
1
u/everythingido65 Jul 01 '19
can u suggest one
2
u/___catalyst___ Jul 02 '19
Here are two:
https://www.udemy.com/course/learn-data-structure-algorithms-with-java-interview/
https://www.udemy.com/course/data-structures-and-algorithms-deep-dive-using-java/
Coursera also has some if you search on "Algorithms" after logging in. I am not sure if they are paid or free, though. They are most likely free unless you want a certificate of completion.
2
u/spidermancy612 Jul 01 '19
To add onto the already good feedback here: Whenever I'm trying to solve a problem I like to have a notepad or whiteboard around to help break the problem into its simplest parts and then solve from there.
A good example from work I was doing yesterday; I needed to handle generating a board for a card game. I broke the steps into creating the visual objects, recording the data about those objects, and providing a way to interact with those objects. The larger problem was rather complex, but each small part was fairly easy to solve.
2
u/seanprefect Jul 01 '19
None of us started out fast or good, problem solving is a skill like anything else. You get good at it by doing it. The more problems you solve, the more ways you learn to solve problems, with those patterns you'll eventually become fast. Don't let it get your down.
2
u/Duckboy_Flaccidpus Jul 01 '19
Solve some of the problems in a different way, after you've found the solution. Looking at a problem in different ways, over time, will aid in optimizing your approach in the future.
2
u/HaMMeReD Jul 01 '19
Work on fundamentals more.
E.g. implement sorting algorithms, searching algorithms, data structures, work on your syntax, etc.
If you want to implement problems quickly, you need to not only have a well stocked toolbox, but you also need to know when to use each tool and how to use it efficiently.
2
0
u/lank81 Jul 01 '19
As the others of stated, don't worry, it'll come with time and practice. Like the age old addage "Practice Makes Perfect". To throw in some other metaphors / widoms.
It takes 10,000 hours to master an instrument
Stephen Curry didn't become the best shooter within a few weeks, days, months, or even years of starting.
Think of the Tortoise and the Hare "Slow and Steady wins the race."
Ok, I've given enough Dad wisdom for the day. Keep at it!! If you need help, just ask, and I'm sure the Java army will help out.
0
u/sternone_2 Jul 01 '19
Not everybody is fit to become a good developer.
I worked with numerous people who knew the language inside out but were basically shit devs.
Coding is the ability to problem solve. Not to be able to learn a syntax.
3
u/PlanZSmiles Jul 01 '19
This isn't an exactly useful comment. He's asking for help on how to improve the speed in solving problems, not that he can't solve problems.
1
u/sternone_2 Jul 02 '19
He is worried, I confirm he should be, so he can save time, effort and broken dreams. That sounds extremely useful to me.
30
u/[deleted] Jul 01 '19
I mean if you are pretty new, its understandable and nothing to worry about. I sometimes look back on my old stackoverflow questions and laugh at the questions I used to ask. It just comes with time, don't worry, we've all been there.