The 10 Most Popular Coding Challenge Websites [Updated for 2021]

Daniel Borowski

A great way to improve your skills when learning to code is by solving coding challenges. Solving different types of challenges and puzzles can help you become a better problem solver, learn the intricacies of a programming language, prepare for job interviews, learn new algorithms, and more.

Below is a list of some popular coding challenge websites with a short description of what each one offers.

1. TopCoder

MTryRL4uVza1V87ERWY26L4cFeqD2rgAnW1f

TopCoder is one of the original platforms for competitive programming online. It provides a list of algorithmic challenges from the past that you can complete on your own directly online using their code editor. Their popular Single Round Matches are offered a few times per month at a specific time where you compete against others to solve challenges the fastest with the best score.

The top ranked users on TopCoder are very good competitive programmers and regularly compete in programming competitions. The top ranked user maintains his own blog titled Algorithms weekly by Petr Mitrichev where he writes about coding competitions, algorithms, math, and more.

2. Coderbyte

sP6ow4n2alliqp5L-p5fVRQC9W0GTws1B9Ig

Coderbyte provides 200+ coding challenges you can solve directly online in one of 10 programming languages (check out this example ). The challenges range from easy (finding the largest word in a string) to hard (print the maximum cardinality matching of a graph).

They also provide a collection of algorithm tutorials , introductory videos, and interview preparation courses . Unlike HackerRank and other similar websites, you are able to view the solutions other users provide for any challenge aside from the official solutions posted by Coderbyte.

3. Project Euler

plhA-E3btLLYRvc4hi3WxmUpAhu3aoef1o0V

Project Euler provides a large collection of challenges in the domain of computer science and mathematics. The challenges typically involve writing a small program to figure out the solution to a clever mathematical formula or equation, such as finding the sum of digits of all numbers preceding each number in a series.

You cannot directly code on the website in an editor, so you would need to write a solution on your own computer and then provide the solution on their website.

4. HackerRank

dOpMtufto0gLZiyDOHZ4BVF58S-z393wRlcu

HackerRank provides challenges for several different domains such as Algorithms, Mathematics, SQL, Functional Programming, AI, and more. You can solve all the challenge directly online (check out this example ).

They provide a discussion and leaderboard for every challenge, and most challenges come with an editorial that explains more about the challenge and how to approach it to come up with a solution.

Currently, if you don't solve the problem, then you can't see the solution of others. If you also try to check the editorial before solving the problem, then you won't get the point for solving the problem at all.

As an example, here I haven't solved the problem, and I am trying to check others' submissions:

problem-not-solved-yet

And here, I haven't solved the problem, and I am trying to check the editorial:

problem-not-solved-lost-point

HackerRank also provides the ability for users to submit applications and apply to jobs by solving company-sponsored coding challenges.

5. CodeChef

81eunsDYPAqBSC8KwPpBxhPFTHiqGXp70kMa

CodeChef is an Indian-based competitive programming website that provides hundreds of challenges. You are able to write code in their online editor and view a collections of challenges that are separated into different categories depending on your skill level (check out this example ). They have a large community of coders that contribute to the forums, write tutorials , and take part in CodeChef’s coding competitions .

6. Exercism.io

Screen-Shot-2019-12-11-at-8.14.45-AM

Exercism is a coding challenge website that offers 3100+ challenges spanning 52 different programming languages. After picking a language that you'd like to master, you tackle the coding challenges right on your machine (Exercism has their own command line interface that you can download from GitHub).

It is a bit different from other challenge websites, however, because you work with a mentor after completing each challenge. The mentor reviews your answers online and helps you improve them if needed. Once your answers have been approved and submitted, you unlock more challenges.

7. Codewars

QR7cVhZ7FGb6HjaEDu4N5Co1eTMNTbo1JFzq

Codewars provides a large collection of coding challenges submitted and edited by their own community. You can solve the challenges directly online in their editor in one of several languages. You can view a discussion for each challenges as well as user solutions.

8. LeetCode

RzWKVwPaLY2SRsWFWk93ZNlzcg8V0Yeav5t7

LeetCode is a popular Online Judge that provides a list of 190+ challenges that can help you prepare for technical job interviews. You can solve the challenges directly online in one of 9 programming languages. You are not able to view other users' solutions, but you are provided statistics for your own solutions such as how fast your code ran when compared to other users' code.

They also have a Mock Interview section that is specifically for job interview preparation, they host their own coding contests , and they have a section for articles to help you better understand certain problems.

MF3wP06V24C7jal2f8NRvAVhS-tAA2vbNDTL

Sphere Online Judge (SPOJ) is an online judge that provides over 20k coding challenges. You are able to submit your code in an online editor . SPOJ also hosts their own contests and has an area for users to discuss coding challenges. They do not currently provide any official solutions or editorials like some other websites do, though.

10. CodinGame

6l08ZCKDOaoY1TH-PHHHac26McA-c1tIDOPU

CodinGame is a bit different from the other websites, because instead of simply solving coding challenges in an editor, you actually take part in writing the code for games that you play directly online. You can see a list of games currently offered here and an example of one here . The game comes with a problem description, test cases, and an editor where you can write your code in one of 20+ programming languages.

Although this website is different than typical competitive programming websites such as the ones mentioned above, it is still popular amongst programmers who enjoy solving challenges and taking part in contests.

This list was based on a few things: my own experiences using the websites, some Google searches , Quora posts , and articles such as this one and this one . I also frequented some forums and subreddits such as r/learnprogramming to see what websites were usually recommended by the users there. Disclaimer: I work at Coderbyte which is one of the websites mentioned above.

CEO & Founder at Coderbyte.

If this article was helpful, share it .

Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started

Achieve mastery through challenge

Improve your development skills by training with your peers on code kata that continuously challenge and push your coding practice.

problem solving for programming

Sharpen your coding skills

Challenge yourself on small coding exercises called "kata". Each kata is crafted by the community to help you strengthen different coding techniques. Master your current language of choice, or quickly pick up any of the 55+ programming languages supported.

problem solving for programming

Get instant feedback

Solve kata with your coding style right in the browser and use test cases (TDD) to check it as you progress. Retrain with new, creative, and optimized approaches. Find all of the bugs in your programming practice.

problem solving for programming

Earn ranks and honor

Kata code challenges are ranked from beginner to expert level. As you complete higher-ranked kata, you level up your profile and push your software development skills to your highest potential.

problem solving for programming

An engaged software development community

Codewars is a collective effort by its users. They are creators—authoring kata to teach various techniques, solving kata with solutions that enlighten others, and commenting with constructive feedback.

Community members added every month

Kata completed every month

Kata created by our community

Tap into the collective wisdom

Compare your solution with others after each kata for greater understanding. Discuss kata, best practices, and innovative techniques with the community. Have your mind blown by how different other solutions can be from your own.

problem solving for programming

Create your own kata

Author kata that focus on your interests and train specific skill sets. Challenge the community with your insight and code understanding. Create everything from common developer interview questions to challenges that push the limits of your creativity. Gain honor within the coding dojo.

problem solving for programming

What can I use Codewars for?

From beginner to expert and beyond...

Get new perspectives

Solve challenges then view how others solved the same challenge. Pickup new techniques from some of the most skilled developers in the world.

Learn new languages

Solve challenges in a language you are comfortable with, then do it in a language you want to improve with. Level up across different languages.

Compete with peers

Compete against your friends, colleagues, and the community at large. Allow competition to motivate you  towards mastering your craft.

Extremely well done and an excellent example of mastery learning.

problem solving for programming

Ahmed Omran

@this_ahmed

Accidentally got addicted to codewars, oops.

problem solving for programming

Kelly Williams

Build self-confidence

Not sure if you are progressing well as a programmer? Push yourself to your limits and show yourself what you are really made of.

Become a mentor

Lend your expertise to others, either indirectly by contributing great solutions or directly by creating your own kata and reviewing code.

Insights from Codewars staff and community.

Introducing the EPIC Challenge 2024

Introducing the EPIC Challenge 2024

problem solving for programming

What's new in Codewars: March highlights

problem solving for programming

What's new in Codewars: February highlights

Codewars is built on.

The world's most advanced coding assessment platform for organizations looking to scale their hiring, upskilling, and certification programs.

Achieve mastery through challenge.

Top languages

Problem Solving

Foundations course, introduction.

Before we start digging into some pretty nifty JavaScript, we need to begin talking about problem solving : the most important skill a developer needs.

Problem solving is the core thing software developers do. The programming languages and tools they use are secondary to this fundamental skill.

From his book, “Think Like a Programmer” , V. Anton Spraul defines problem solving in programming as:

Problem solving is writing an original program that performs a particular set of tasks and meets all stated constraints.

The set of tasks can range from solving small coding exercises all the way up to building a social network site like Facebook or a search engine like Google. Each problem has its own set of constraints, for example, high performance and scalability may not matter too much in a coding exercise but it will be vital in apps like Google that need to service billions of search queries each day.

New programmers often find problem solving the hardest skill to build. It’s not uncommon for budding programmers to breeze through learning syntax and programming concepts, yet when trying to code something on their own, they find themselves staring blankly at their text editor not knowing where to start.

The best way to improve your problem solving ability is by building experience by making lots and lots of programs. The more practice you have the better you’ll be prepared to solve real world problems.

In this lesson we will walk through a few techniques that can be used to help with the problem solving process.

Lesson overview

This section contains a general overview of topics that you will learn in this lesson.

  • Explain the three steps in the problem solving process.
  • Explain what pseudocode is and be able to use it to solve problems.
  • Be able to break a problem down into subproblems.

Understand the problem

The first step to solving a problem is understanding exactly what the problem is. If you don’t understand the problem, you won’t know when you’ve successfully solved it and may waste a lot of time on a wrong solution .

To gain clarity and understanding of the problem, write it down on paper, reword it in plain English until it makes sense to you, and draw diagrams if that helps. When you can explain the problem to someone else in plain English, you understand it.

Now that you know what you’re aiming to solve, don’t jump into coding just yet. It’s time to plan out how you’re going to solve it first. Some of the questions you should answer at this stage of the process:

  • Does your program have a user interface? What will it look like? What functionality will the interface have? Sketch this out on paper.
  • What inputs will your program have? Will the user enter data or will you get input from somewhere else?
  • What’s the desired output?
  • Given your inputs, what are the steps necessary to return the desired output?

The last question is where you will write out an algorithm to solve the problem. You can think of an algorithm as a recipe for solving a particular problem. It defines the steps that need to be taken by the computer to solve a problem in pseudocode.

Pseudocode is writing out the logic for your program in natural language instead of code. It helps you slow down and think through the steps your program will have to go through to solve the problem.

Here’s an example of what the pseudocode for a program that prints all numbers up to an inputted number might look like:

This is a basic program to demonstrate how pseudocode looks. There will be more examples of pseudocode included in the assignments.

Divide and conquer

From your planning, you should have identified some subproblems of the big problem you’re solving. Each of the steps in the algorithm we wrote out in the last section are subproblems. Pick the smallest or simplest one and start there with coding.

It’s important to remember that you might not know all the steps that you might need up front, so your algorithm may be incomplete -— this is fine. Getting started with and solving one of the subproblems you have identified in the planning stage often reveals the next subproblem you can work on. Or, if you already know the next subproblem, it’s often simpler with the first subproblem solved.

Many beginners try to solve the big problem in one go. Don’t do this . If the problem is sufficiently complex, you’ll get yourself tied in knots and make life a lot harder for yourself. Decomposing problems into smaller and easier to solve subproblems is a much better approach. Decomposition is the main way to deal with complexity, making problems easier and more approachable to solve and understand.

In short, break the big problem down and solve each of the smaller problems until you’ve solved the big problem.

Solving Fizz Buzz

To demonstrate this workflow in action, let’s solve Fizz Buzz

Understanding the problem

Write a program that takes a user’s input and prints the numbers from one to the number the user entered. However, for multiples of three print Fizz instead of the number and for the multiples of five print Buzz . For numbers which are multiples of both three and five print FizzBuzz .

This is the big picture problem we will be solving. But we can always make it clearer by rewording it.

Write a program that allows the user to enter a number, print each number between one and the number the user entered, but for numbers that divide by 3 without a remainder print Fizz instead. For numbers that divide by 5 without a remainder print Buzz and finally for numbers that divide by both 3 and 5 without a remainder print FizzBuzz .

Does your program have an interface? What will it look like? Our FizzBuzz solution will be a browser console program, so we don’t need an interface. The only user interaction will be allowing users to enter a number.

What inputs will your program have? Will the user enter data or will you get input from somewhere else? The user will enter a number from a prompt (popup box).

What’s the desired output? The desired output is a list of numbers from 1 to the number the user entered. But each number that is divisible by 3 will output Fizz , each number that is divisible by 5 will output Buzz and each number that is divisible by both 3 and 5 will output FizzBuzz .

Writing the pseudocode

What are the steps necessary to return the desired output? Here is an algorithm in pseudocode for this problem:

Dividing and conquering

As we can see from the algorithm we developed, the first subproblem we can solve is getting input from the user. So let’s start there and verify it works by printing the entered number.

With JavaScript, we’ll use the “prompt” method.

The above code should create a little popup box that asks the user for a number. The input we get back will be stored in our variable answer .

We wrapped the prompt call in a parseInt function so that a number is returned from the user’s input.

With that done, let’s move on to the next subproblem: “Loop from 1 to the entered number”. There are many ways to do this in JavaScript. One of the common ways - that you actually see in many other languages like Java, C++, and Ruby - is with the for loop :

If you haven’t seen this before and it looks strange, it’s actually straightforward. We declare a variable i and assign it 1: the initial value of the variable i in our loop. The second clause, i <= answer is our condition. We want to loop until i is greater than answer . The third clause, i++ , tells our loop to increment i by 1 every iteration. As a result, if the user inputs 10, this loop would print numbers 1 - 10 to the console.

Most of the time, programmers find themselves looping from 0. Due to the needs of our program, we’re starting from 1

With that working, let’s move on to the next problem: If the current number is divisible by 3, then print Fizz .

We are using the modulus operator ( % ) here to divide the current number by three. If you recall from a previous lesson, the modulus operator returns the remainder of a division. So if a remainder of 0 is returned from the division, it means the current number is divisible by 3.

After this change the program will now output this when you run it and the user inputs 10:

The program is starting to take shape. The final few subproblems should be easy to solve as the basic structure is in place and they are just different variations of the condition we’ve already got in place. Let’s tackle the next one: If the current number is divisible by 5 then print Buzz .

When you run the program now, you should see this output if the user inputs 10:

We have one more subproblem to solve to complete the program: If the current number is divisible by 3 and 5 then print FizzBuzz .

We’ve had to move the conditionals around a little to get it to work. The first condition now checks if i is divisible by 3 and 5 instead of checking if i is just divisible by 3. We’ve had to do this because if we kept it the way it was, it would run the first condition if (i % 3 === 0) , so that if i was divisible by 3, it would print Fizz and then move on to the next number in the iteration, even if i was divisible by 5 as well.

With the condition if (i % 3 === 0 && i % 5 === 0) coming first, we check that i is divisible by both 3 and 5 before moving on to check if it is divisible by 3 or 5 individually in the else if conditions.

The program is now complete! If you run it now you should get this output when the user inputs 20:

  • Read How to Think Like a Programmer - Lessons in Problem Solving by Richard Reis.
  • Watch How to Begin Thinking Like a Programmer by Coding Tech. It’s an hour long but packed full of information and definitely worth your time watching.
  • Read this Pseudocode: What It Is and How to Write It article from Built In.

Knowledge check

The following questions are an opportunity to reflect on key topics in this lesson. If you can’t answer a question, click on it to review the material, but keep in mind you are not expected to memorize or master this knowledge.

  • What are the three stages in the problem solving process?
  • Why is it important to clearly understand the problem first?
  • What can you do to help get a clearer understanding of the problem?
  • What are some of the things you should do in the planning stage of the problem solving process?
  • What is an algorithm?
  • What is pseudocode?
  • What are the advantages of breaking a problem down and solving the smaller problems?

Additional resources

This section contains helpful links to related content. It isn’t required, so consider it supplemental.

  • Read the first chapter in Think Like a Programmer: An Introduction to Creative Problem Solving ( not free ). This book’s examples are in C++, but you will understand everything since the main idea of the book is to teach programmers to better solve problems. It’s an amazing book and worth every penny. It will make you a better programmer.
  • Watch this video on repetitive programming techniques .
  • Watch Jonathan Blow on solving hard problems where he gives sage advice on how to approach problem solving in software projects.

Support us!

The odin project is funded by the community. join us in empowering learners around the globe by supporting the odin project.

problem solving for programming

Member-only story

10 Steps to Solving a Programming Problem

Tips for new developers staring at a blank screen, unsure of where to start.

Valinda Chan

Valinda Chan

Some of the feedback I hear from new developers working on a programming problem revolves around uncertainty of where to start. You understand the problem, the logic, basics of the syntax, etc. If you see someone else’s code or have someone to guide you, you can follow along. But maybe you feel uncertain about doing it yourself and have trouble turning your thoughts into code at first even though you understand the syntax or logic. Here’s my process and some tips to tackling a sample problem that hopefully some of you may find helpful in your journey.

1. Read the problem at least three times (or however many makes you feel comfortable)

You can’t solve a problem you don’t understand. There is a difference between the problem and the problem you think you are solving. It’s easy to start reading the first few lines in a problem and assume the rest of it because it’s similar to something you’ve seen in the past. If you are making even a popular game like Hangman, be sure to read through any rules even if you’ve played it before. I once was asked to make a game like Hangman that I realized was “Evil Hangman” only after I read through the instructions (it was a trick!).

Sometimes I’ll even try explaining the problem to a friend and see if her understanding of my explanation matches the problem I am tasked with. You don’t want to find out halfway through that you misunderstood the problem. Taking extra time in the beginning is worth it. The better you understand the problem, the easier it will be to solve it.

Let’s pretend we are creating a simple function selectEvenNumbers that will take in an array of numbers and return an array evenNumbers of only even numbers. If there are no even numbers, return the empty array evenNumbers .

Here are some questions that run through my mind:

  • How can a computer tell what is an even number? Divide that number by 2 and see if its remainder is 0.
  • What am I passing into this function? An array
  • What will that array contain? One or more numbers
  • What are the data types of the elements in the array? Numbers
  • What is the goal of this function? What am I returning at the end of this function? The goal is to take all the even numbers and return them in an array. If there are no even numbers, return an empty array.

2. Work through the problem manually with at least three sets of sample data

Take out a piece of paper and work through the problem manually. Think of at least three sets of sample data you can use. Consider corner and edge cases as well.

Corner case : a problem or situation that occurs outside of normal operating parameters, specifically when multiple environmental variables or conditions are simultaneously at extreme levels, even though each parameter is within the specified range for that parameter. Edge case : problem or situation that occurs only at an extreme (maximum or minimum) operating parameter

For example, below are some sets of sample data to use:

When you are first starting out, it is easy to gloss over the steps. Because your brain may already be familiar with even numbers, you may just look at a sample set of data and pull out numbers like 2 , 4 , 6 and so forth in the array without fully being aware of each and every step your brain is taking to solve it. If this is challenging, try using large sets of data as it will override your brain’s ability to naturally solve the problem just by looking at it. That helps you work through the real algorithm.

Let’s go through the first array [1]

  • Look at the only element in the array [1]
  • Decide if it is even. It is not
  • Notice that there are no more elements in this array
  • Determine there are no even numbers in this provided array
  • Return an empty array

Let’s go through the array [1, 2]

  • Look at the first element in array [1, 2]
  • Look at the next element in the array
  • Decide if it is even. It is even
  • Make an array evenNumbers and add 2 to this array
  • Return the array evenNumbers which is [2]

I go through this a few more times. Notice how the steps I wrote down for [1] varies slightly from [1, 2] . That is why I try to go through a couple of different sets. I have some sets with just one element, some with floats instead of just integers, some with multiple digits in an element, and some with negatives just to be safe.

3. Simplify and optimize your steps

Look for patterns and see if there’s anything you can generalize. See if you can reduce any steps or if you are repeating any steps.

  • Create a function selectEvenNumbers
  • Create a new empty array evenNumbers where I store even numbers, if any
  • Go through each element in the array [1, 2]
  • Find the first element
  • Decide if it is even by seeing if it is divisible by 2. If it is even, I add that to evenNumbers
  • Find the next element
  • Repeat step #4
  • Repeat step #5 and #4 until there are no more elements in this array
  • Return the array evenNumbers , regardless of whether it has anything in it

This approach may remind you of Mathematical Induction in that you:

  • Show it is true for n = 1 , n = 2 , ...
  • Suppose it is true for n = k
  • Prove it is true for n = k + 1

4. Write pseudocode

Even after you’ve worked out general steps, writing out pseudocode that you can translate into code will help with defining the structure of your code and make coding a lot easier. Write pseudocode line by line. You can do this either on paper or as comments in your code editor. If you’re starting out and find blank screens to be daunting or distracting, I recommend doing it on paper.

Pseudocode generally does not actually have specific rules in particular but sometimes, I might end up including some syntax from a language just because I am familiar enough with an aspect of the programming language. Don’t get caught up with the syntax. Focus on the logic and steps.

For our problem, there are many different ways to do this. For example, you can use filter but for the sake of keeping this example as easy to follow along as possible, we will use a basic for loop for now (but we will use filter later when we refactor our code).

Here is an example of pseudocode that has more words:

Here is an example of pseudocode that has fewer words:

Either way is fine as long as you are writing it out line-by-line and understand the logic on each line.

Refer back to the problem to make sure you are on track.

5. Translate pseudocode into code and debug

When you have your pseudocode ready, translate each line into real code in the language you are working on. We will use JavaScript for this example.

If you wrote it out on paper, type this up as comments in your code editor. Then replace each line in your pseudocode.

Then I call the function and give it some sample sets of data we used earlier. I use them to see if my code returns the results I want. You can also write tests to check if the actual output is equal to the expected output.

I generally use console.log() after each variable or line or so. This helps me check if the values and code are behaving as expected before I move on . By doing this, I catch any issues before I get too far. Below is an example of what values I would check when I am first starting out. I do this throughout my code as I type it out.

After working though each line of my pseudocode, below is what we end up with. // is what the line was in pseudocode. Text that is bolded is the actual code in JavaScript.

I get rid of the pseudocode to avoid confusion.

Sometimes new developers will get hung up with the syntax that it becomes difficult to move forward. Remember that syntax will come more naturally over time and there is no shame in referencing material for the correct syntax later on when coding.

6. Simplify and optimize your code

You’ve probably noticed by now that simplifying and optimizing are recurring themes.

“Simplicity is prerequisite for reliability.” — Edsger W. Dijkstra, Dutch computer scientist and early pioneer in many research areas of computing science

In this example, one way of optimizing it would be to filter out items from an array by returning a new array using filter . This way, we don’t have to define another variable evenNumbers because filter will return a new array with copies of elements that match the filter. This will not change the original array. We also don’t need to use a for loop with this approach. filter will go through each item, return either true , to have that element in the array, or false to skip it.

Simplifying and optimizing your code may require you to iterate a few times, identifying ways to further simplify and optimize code.

Here are some questions to keep in mind:

  • What are your goals for simplifying and optimizing? The goals will depend on your team’s style or your personal preference. Are you trying to condense the code as much as possible? Is the goal to make it the code more readable? If that’s the case, you may prefer taking that extra line to define the variable or compute something rather than trying to define and compute all in one line.
  • How else can you make the code more readable?
  • Are there any more extra steps you can take out?
  • Are there any variables or functions you ended up not even needing or using?
  • Are you repeating some steps a lot? See if you can define in another function.
  • Are there better ways to handle edge cases?
“Programs must be written for people to read, and only incidentally for machines to execute.” — Gerald Jay Sussman and Hal Abelson, Authors of “Structure and Interpretation of Computer Programs”

This step really should be throughout the process. Debugging throughout will help you catch any syntax errors or gaps in logic sooner rather than later. Take advantage of your Integrated Development Environment (IDE) and debugger. When I encounter bugs, I trace the code line-by-line to see if there was anything that did not go as expected. Here are some techniques I use:

  • Check the console to see what the error message says. Sometimes it’ll point out a line number I need to check. This gives me a rough idea of where to start, although the issue sometimes may not be at this line at all.
  • Comment out chunks or lines of code and output what I have so far to quickly see if the code is behaving how I expected. I can always uncomment the code as needed.
  • Use other sample data if there are scenarios I did not think of and see if the code will still work.
  • Save different versions of my file if I am trying out a completely different approach. I don’t want to lose any of my work if I end up wanting to revert back to it!
“The most effective debugging tool is still careful thought, coupled with judiciously placed print statements.” — Brian W. Kernighan, Computer Science Professor at Princeton University

8. Write useful comments

You may not always remember what every single line meant a month later. And someone else working on your code may not know either. That’s why it’s important to write useful comments to avoid problems and save time later on if you need to come back to it.

Stay away from comments such as:

// This is an array. Iterate through it.

// This is a variable

I try to write brief, high-level comments that help me understand what’s going on if it is not obvious. This comes in handy when I am working on more complex problems. It helps understand what a particular function is doing and why. Through the use of clear variable names, function names, and comments, you (and others) should be able to understand:

  • What is this code for?
  • What is it doing?

9. Get feedback through code reviews

Get feedback from your teammates, professors, and other developers. Check out Stack Overflow . See how others tackled the problem and learn from them. There are sometimes several ways to approach a problem. Find out what they are and you’ll get better and quicker at coming up with them yourself.

“No matter how slow you are writing clean code, you will always be slower if you make a mess.” — Uncle Bob Martin, Software Engineer and Co-author of the Agile Manifesto

10. Practice, practice, practice

Even experienced developers are always practicing and learning. If you get helpful feedback, implement it. Redo a problem or do similar problems. Keep pushing yourself. With each problem you solve, the better a developer you become. Celebrate each success and be sure to remember how far you’ve come. Remember that programming, like with anything, comes easier and more naturally with time.

“Take pride in how far you’ve come. Have faith in how far you can go. But don’t forget to enjoy the journey.” — Michael Josephson, Founder of Joseph and Edna Josephson Institute of Ethics

Thanks Gavin Stark

Valinda Chan

Written by Valinda Chan

Product & UX Design

More from Valinda Chan and codeburst

Must-Read Books for Software Developers

DataDrivenInvestor

Must-Read Books for Software Developers

60+ books on programming, computer science, algorithms and data structures, linear algebra, discrete mathematics, computer systems….

How To Create Horizontal Scrolling Containers

How To Create Horizontal Scrolling Containers

As a front end developer, more and more frequently i am given designs that include a horizontal scrolling component. this has become….

Top 50 Java Interview Questions for Beginners and Junior Developers

Top 50 Java Interview Questions for Beginners and Junior Developers

A list of frequently asked java questions and answers from programming job interviews of java developers of different experience..

Leading with the Power of Influence vs. Positional Power

ThinkGrowth.org

Leading with the Power of Influence vs. Positional Power

Getting people to take risks in a risk-averse environment, recommended from medium.

Advice From a Software Engineer With 8 Years of Experience

Benoit Ruiz

Better Programming

Advice From a Software Engineer With 8 Years of Experience

Practical tips for those who want to advance in their careers.

I Built an App in 6 Hours that Makes $1,500/Mo

Artturi Jalli

I Built an App in 6 Hours that Makes $1,500/Mo

Copy my strategy.

problem solving for programming

General Coding Knowledge

problem solving for programming

Stories to Help You Grow as a Software Developer

problem solving for programming

Coding & Development

problem solving for programming

ChatGPT prompts

Grokking the Coding Interview

Arslan Ahmad

Level Up Coding

Don’t Just LeetCode; Follow the Coding Patterns Instead

What if you don’t like to practice 100s of coding questions before the interview.

How I Create Passive Income With No Money

Hazel Paradise

How I Create Passive Income With No Money

Many ways to start a passive income today.

Rohit Verma

Rohit Verma

My Interview Experience at Google [L5 Offer]

Comprehensive insights: a deep dive into the journey from preparation through interviews to securing the offer..

Apps I Use And Why You Should Too.

Gowtham Oleti

Apps I Use And Why You Should Too.

Let’s skip past the usual suspects like youtube, whatsapp and instagram. i want to share with you some less familiar apps that have become….

Text to speech

Codemonk

  • Basics of Input/Output
  • Time and Space Complexity
  • Basics of Implementation
  • Basics of Operators
  • Basics of Bit Manipulation
  • Recursion and Backtracking
  • Multi-dimensional
  • Basics of Stacks
  • Basics of Queues
  • Basics of Hash Tables
  • Singly Linked List
  • Binary/ N-ary Trees
  • Binary Search Tree
  • Heaps/Priority Queues
  • Trie (Keyword Tree)
  • Segment Trees
  • Fenwick (Binary Indexed) Trees
  • Suffix Trees
  • Suffix Arrays
  • Basics of Disjoint Data Structures
  • Linear Search
  • Binary Search
  • Ternary Search
  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Counting Sort
  • Bucket Sort
  • Basics of Greedy Algorithms
  • Graph Representation
  • Breadth First Search
  • Depth First Search
  • Minimum Spanning Tree
  • Shortest Path Algorithms
  • Flood-fill Algorithm
  • Articulation Points and Bridges
  • Biconnected Components
  • Strongly Connected Components
  • Topological Sort
  • Hamiltonian Path
  • Maximum flow
  • Minimum Cost Maximum Flow
  • Basics of String Manipulation
  • String Searching
  • Z Algorithm
  • Manachar’s Algorithm
  • Introduction to Dynamic Programming 1
  • 2 Dimensional
  • State space reduction
  • Dynamic Programming and Bit Masking
  • Basic Number Theory-1
  • Basic Number Theory-2
  • Primality Tests
  • Totient Function
  • Basics of Combinatorics
  • Inclusion-Exclusion
  • Line Sweep Technique
  • Line Intersection using Bentley Ottmann Algorithm
  • Basic Probability Models and Rules
  • Bayes’ rules, Conditional probability, Chain rule
  • Discrete Random Variables
  • Continuous Random Variables
  • Practical Tutorial on Data Manipulation with Numpy and Pandas in Python
  • Beginners Guide to Regression Analysis and Plot Interpretations
  • Practical Guide to Logistic Regression Analysis in R
  • Practical Tutorial on Random Forest and Parameter Tuning in R
  • Practical Guide to Clustering Algorithms & Evaluation in R
  • Beginners Tutorial on XGBoost and Parameter Tuning in R
  • Deep Learning & Parameter Tuning with MXnet, H2o Package in R
  • Decision Tree
  • Simple Tutorial on Regular Expressions and String Manipulations in R
  • Practical Guide to Text Mining and Feature Engineering in R
  • Winning Tips on Machine Learning Competitions by Kazanova, Current Kaggle #3
  • Practical Machine Learning Project in Python on House Prices Data
  • Challenge #1 - Machine Learning
  • Challenge #3 - Machine Learning
  • Challenge #2 - Deep Learning
  • Transfer Learning Introduction
  • Input and Output
  • Python Variables
  • Conditionals
  • Expressions
  • Classes and Objects I
  • Classes and Objects II (Inheritance and Composition)
  • Errors and Exceptions
  • Iterators and Generators
  • Functional Programming
  • Higher Order Functions and Decorators
  • +1-650-461-4192
  • For sales enquiry [email protected]
  • For support [email protected]
  • Campus Ambassadors
  • Assessments
  • Learning and Development
  • Interview Prep
  • Engineering Blog
  • Privacy Policy
  • © 2024 HackerEarth All rights reserved
  • Terms of Service

Say "Hello, World!" With Python Easy Max Score: 5 Success Rate: 96.25%

Python if-else easy python (basic) max score: 10 success rate: 89.71%, arithmetic operators easy python (basic) max score: 10 success rate: 97.41%, python: division easy python (basic) max score: 10 success rate: 98.68%, loops easy python (basic) max score: 10 success rate: 98.10%, write a function medium python (basic) max score: 10 success rate: 90.31%, print function easy python (basic) max score: 20 success rate: 97.27%, list comprehensions easy python (basic) max score: 10 success rate: 97.69%, find the runner-up score easy python (basic) max score: 10 success rate: 94.16%, nested lists easy python (basic) max score: 10 success rate: 91.68%, cookie support is required to access hackerrank.

Seems like cookies are disabled on this browser, please enable them to open this website

Tutorial Playlist

Programming tutorial, your guide to the best backend languages for 2024, an ultimate guide that helps you to start learn coding 2024, what is backend development: the ultimate guide for beginners, all you need to know for choosing the first programming language to learn, here’s all you need to know about coding, decoding, and reasoning with examples, understanding what is xml: the best guide to xml and its concepts., an ultimate guide to learn the importance of low-code and no-code development, top frontend languages that you should know about, top 75+ frontend developer interview questions and answers, the ultimate guide to learn typescript generics, the most comprehensive guide for beginners to know ‘what is typescript’.

The Ultimate Guide on Introduction to Competitive Programming

Top 60+ TCS NQT Interview Questions and Answers for 2024

Most commonly asked logical reasoning questions in an aptitude test, everything you need to know about advanced typescript concepts, an absolute guide to build c hello world program, a one-stop solution guide to learn how to create a game in unity, what is nat significance of nat for translating ip addresses in the network model, data science vs software engineering: key differences, a real-time chat application typescript project using node.js as a server, what is raspberry pi here’s the best guide to get started, what is arduino here’s the best beginners guide to get started, arduino vs. raspberry pi: which is the better board, the perfect guide for all you need to learn about mean stack, software developer resume: a comprehensive guide, here’s everything all you need to know about the programming roadmap, an ultimate guide that helps you to develop and improve problem solving in programming, the top 10 awesome arduino projects of all time, roles of product managers, pyspark rdd: everything you need to know about pyspark rdd, wipro interview questions and answers that you should know before going for an interview, how to use typescript with nodejs: the ultimate guide, what is rust programming language why is it so popular, software terminologies, an ultimate guide that helps you to develop and improve problem solving in programming.

Lesson 27 of 34 By Hemant Deshpande

An Ultimate Guide That Helps You to Develop and Improve Problem Solving in Programming

Table of Contents

Coding and Programming skills hold a significant and critical role in implementing and developing various technologies and software. They add more value to the future and development. These programming and coding skills are essential for every person to improve problem solving skills. So, we brought you this article to help you learn and know the importance of these skills in the future. 

Want a Top Software Development Job? Start Here!

Want a Top Software Development Job? Start Here!

Topics covered in this problem solving in programming article are:

  • What is Problem Solving in Programming? 
  • Problem Solving skills in Programming
  • How does it impact your career ?
  • Steps involved in Problem Solving
  • Steps to improve Problem Solving in programming

What is Problem Solving in Programming?

Computers are used to solve various problems in day-to-day life. Problem Solving is an essential skill that helps to solve problems in programming. There are specific steps to be carried out to solve problems in computer programming, and the success depends on how correctly and precisely we define a problem. This involves designing, identifying and implementing problems using certain steps to develop a computer.

When we know what exactly problem solving in programming is, let us learn how it impacts your career growth.

How Does It Impact Your Career?

Many companies look for candidates with excellent problem solving skills. These skills help people manage the work and make candidates put more effort into the work, which results in finding solutions for complex problems in unexpected situations. These skills also help to identify quick solutions when they arise and are identified. 

People with great problem solving skills also possess more thinking and analytical skills, which makes them much more successful and confident in their career and able to work in any kind of environment. 

The above section gives you an idea of how problem solving in programming impacts your career and growth. Now, let's understand what problem solving skills mean.

Problem Solving Skills in Programming

Solving a question that is related to computers is more complicated than finding the solutions for other questions. It requires excellent knowledge and much thinking power. Problem solving in programming skills is much needed for a person and holds a major advantage. For every question, there are specific steps to be followed to get a perfect solution. By using those steps, it is possible to find a solution quickly.

The above section is covered with an explanation of problem solving in programming skills. Now let's learn some steps involved in problem solving.

Steps Involved in Problem Solving

Before being ready to solve a problem, there are some steps and procedures to be followed to find the solution. Let's have a look at them in this problem solving in programming article.

Basically, they are divided into four categories:

  • Analysing the problem
  • Developing the algorithm
  • Testing and debugging

Analysing the Problem

Every problem has a perfect solution; before we are ready to solve a problem, we must look over the question and understand it. When we know the question, it is easy to find the solution for it. If we are not ready with what we have to solve, then we end up with the question and cannot find the answer as expected. By analysing it, we can figure out the outputs and inputs to be carried out. Thus, when we analyse and are ready with the list, it is easy and helps us find the solution easily. 

Developing the Algorithm

It is required to decide a solution before writing a program. The procedure of representing the solution  in a natural language called an algorithm. We must design, develop and decide the final approach after a number of trials and errors, before actually writing the final code on an algorithm before we write the code. It captures and refines all the aspects of the desired solution.

Once we finalise the algorithm, we must convert the decided algorithm into a code or program using a dedicated programming language that is understandable by the computer to find a desired solution. In this stage, a wide variety of programming languages are used to convert the algorithm into code. 

Testing and Debugging

The designed and developed program undergoes several rigorous tests based on various real-time parameters and the program undergoes various levels of simulations. It must meet the user's requirements, which have to respond with the required time. It should generate all expected outputs to all the possible inputs. The program should also undergo bug fixing and all possible exception handling. If it fails to show the possible results, it should be checked for logical errors.

Industries follow some testing methods like system testing, component testing and acceptance testing while developing complex applications. The errors identified while testing are debugged or rectified and tested again until all errors are removed from the program.

The steps mentioned above are involved in problem solving in programming. Now let's see some more detailed information about the steps to improve problem solving in programming.

Steps to Improve Problem Solving in Programming

Right mindset.

The way to approach problems is the key to improving the skills. To find a solution, a positive mindset helps to solve problems quickly. If you think something is impossible, then it is hard to achieve. When you feel free and focus with a positive attitude, even complex problems will have a perfect solution.

Making Right Decisions

When we need to solve a problem, we must be clear with the solution. The perfect solution helps to get success in a shorter period. Making the right decisions in the right situation helps to find the perfect solution quickly and efficiently. These skills also help to get more command over the subject.

Keeping Ideas on Track

Ideas always help much in improving the skills; they also help to gain more knowledge and more command over things. In problem solving situations, these ideas help much and help to develop more skills. Give opportunities for the mind and keep on noting the ideas.

Learning from Feedbacks

A crucial part of learning is from the feedback. Mistakes help you to gain more knowledge and have much growth. When you have a solution for a problem, go for the feedback from the experienced or the professionals. It helps you get success within a shorter period and enables you to find other solutions easily.

Asking Questions

Questions are an incredible part of life. While searching for solutions, there are a lot of questions that arise in our minds. Once you know the question correctly, then you are able to find answers quickly. In coding or programming, we must have a clear idea about the problem. Then, you can find the perfect solution for it. Raising questions can help to understand the problem.

These are a few reasons and tips to improve problem solving in programming skills. Now let's see some major benefits in this article.

  • Problem solving in programming skills helps to gain more knowledge over coding and programming, which is a major benefit.
  • These problem solving skills also help to develop more skills in a person and build a promising career.
  • These skills also help to find the solutions for critical and complex problems in a perfect way.
  • Learning and developing problem solving in programming helps in building a good foundation.
  • Most of the companies are looking for people with good problem solving skills, and these play an important role when it comes to job opportunities 
Don't miss out on the opportunity to become a Certified Professional with Simplilearn's Post Graduate Program in Full Stack Web Development . Enroll Today!

Problem solving in programming skills is important in this modern world; these skills build a great career and hold a great advantage. This article on problem solving in programming provides you with an idea of how it plays a massive role in the present world. In this problem solving in programming article, the skills and the ways to improve more command on problem solving in programming are mentioned and explained in a proper way.

If you are looking to advance in your career. Simplilearn provides training and certification courses on various programming languages - Python , Java , Javascript , and many more. Check out our Post Graduate Program in Full Stack Web Development course that will help you excel in your career.

If you have any questions for us on the problem solving in programming article. Do let us know in the comments section below; we have our experts answer it right away.

Find our Full Stack Developer - MERN Stack Online Bootcamp in top cities:

About the author.

Hemant Deshpande

Hemant Deshpande, PMP has more than 17 years of experience working for various global MNC's. He has more than 10 years of experience in managing large transformation programs for Fortune 500 clients across verticals such as Banking, Finance, Insurance, Healthcare, Telecom and others. During his career he has worked across the geographies - North America, Europe, Middle East, and Asia Pacific. Hemant is an internationally Certified Executive Coach (CCA/ICF Approved) working with corporate leaders. He also provides Management Consulting and Training services. He is passionate about writing and regularly blogs and writes content for top websites. His motto in life - Making a positive difference.

Recommended Resources

Your One-Stop Solution to Understand Coin Change Problem

Your One-Stop Solution to Understand Coin Change Problem

Combating the Global Talent Shortage Through Skill Development Programs

Combating the Global Talent Shortage Through Skill Development Programs

What Is Problem Solving? Steps, Techniques, and Best Practices Explained

What Is Problem Solving? Steps, Techniques, and Best Practices Explained

One Stop Solution to All the Dynamic Programming Problems

One Stop Solution to All the Dynamic Programming Problems

The Ultimate Guide on Introduction to Competitive Programming

The Ultimate Guide to Top Front End and Back End Programming Languages for 2021

  • PMP, PMI, PMBOK, CAPM, PgMP, PfMP, ACP, PBA, RMP, SP, and OPM3 are registered marks of the Project Management Institute, Inc.

problem solving for programming

  • Latest Articles
  • Top Articles
  • Posting/Update Guidelines
  • Article Help Forum

problem solving for programming

  • View Unanswered Questions
  • View All Questions
  • View C# questions
  • View C++ questions
  • View Javascript questions
  • View Visual Basic questions
  • View Python questions
  • CodeProject.AI Server
  • All Message Boards...
  • Running a Business
  • Sales / Marketing
  • Collaboration / Beta Testing
  • Work Issues
  • Design and Architecture
  • Artificial Intelligence
  • Internet of Things
  • ATL / WTL / STL
  • Managed C++/CLI
  • Objective-C and Swift
  • System Admin
  • Hosting and Servers
  • Linux Programming
  • .NET (Core and Framework)
  • Visual Basic
  • Web Development
  • Site Bugs / Suggestions
  • Spam and Abuse Watch
  • Competitions
  • The Insider Newsletter
  • The Daily Build Newsletter
  • Newsletter archive
  • CodeProject Stuff
  • Most Valuable Professionals
  • The Lounge  
  • The CodeProject Blog
  • Where I Am: Member Photos
  • The Insider News
  • The Weird & The Wonderful
  • What is 'CodeProject'?
  • General FAQ
  • Ask a Question
  • Bugs and Suggestions

problem solving for programming

The Beginner Programmer's guide to Problem Solving [With Example]

problem solving for programming

Have you got this feeling that you are able to grasp the concepts of programming and  you are able to understand what’s a variable, what’s a function, what are data types, etc. yet you find it difficult to solve problems in programming.  Every beginner gets this feeling.  I did too when starting out.

It is important to overcome this feeling at the earliest, otherwise it can form a mental block for you.

Image 1

How it can be a mental block to you?  Common sense says that the more you practice a certain skill, you get better at that skill as time progresses.  Same goes with problem solving too.  The more problems you solve, the better you become at problem solving.  But when you get a feel that you are trying hard and still unable to solve a problem or find it extremely difficult, your confidence lowers.  At this stage, either you stop solving problems or try to solve lesser number of problems.

The point is your curriculum or your professional work is generally designed in such a manner that the order of difficulty increases as time progresses.  So, you are in a situation where you feel less confident in solving small problems but now tasked with solving bigger problems.  And the cycle continues till it becomes a permanent mental block in you.

Is it too late to start solving problems?

No.  If you have come to the realization that you need to improve your problem solving skills, you have made that good first step.  Quite often our egos don’t let us accept the obvious.  It is good to accept certain truth because that is the only way that we can improve ourselves.

What can I do to become better at solving problems?

Remove the mental block first – exercise your mind.

Your mind is your most powerful weapon.  So you have to think you can actually solve the problem.  So from today, think positively that you can solve any problem.  But you will obviously start with small problems and go on to solve bigger problems.

As with every aspect in life, it starts with conditioning the mind.  So, starting today, tell yourselves the following:

  • I can solve any problem that is put at me
  • I will commit at least 1-2 hours per day on solving problems alone for the next 30 days
  • I will never give up on any problem that is put at me, I will ask for help if required.1

Understand the basic approach to problem solving

Do you know one of the reasons for your struggle with problem solving?  One reason might be due to lack of practice.  But the main reason is because you have not understood the basics of problem solving especially in programming.  Once you understand the approach to problem solving to the smallest of things, you can go ahead and solve bigger and more complex problems with confidence.1

Ever wondered how top tech companies like Google, Amazon solved the internet’s biggest & hardest problems?  The answer is simplicity.  They solved problems at the basic level and then went on to solve bigger and bigger problems.  You can do it too.  But you need to be good at the basics.

What do I need to understand before even trying to solve the problem?

Understand the problem clearly – the power of clarity.

You need to understand your problem clearly before even trying to solve it1.  Lack of clarity at this stage will put you down.  So make a conscious effort in understanding the problem more clearly.  Ask questions like What, Why, When, Where, What if and How.  Not all questions might be applicable to your problem, but it is important to ask questions to yourself at this stage before you go ahead trying to solve the problem.

Visualize – The Power of visualization

I am sure everyone of you is aware of what visualization is.  Trying to picturize your thoughts.  Have you ever imagined how some people can solve extra ordinary problems just by looking into those problems and they will instantly have a solution to it?  And we don’t even understand the problem fully?  It is because they do it with their mind.  They visualize the problem in their minds and they solve it in their minds itself.  Visualization is a powerful tool in your mind.

But in order to get to that state, first you need to visualize the problem externally.  That is where a pen and a paper/notebook (or) a white board comes into play1.  Try to visualize the problem at hand and try to picturize the problem.  That is also one of the steps to make sure that you understand the problem clearly.

There was a situation when I and my dear friend & colleague were discussing about a problem and we were literally going nowhere.  This was actually when we each had around 7 years of experience in the industry.  At that point, my friend said “Let’s put our points in board.  If we don’t put it on the board, we will never get started”.  And we started putting things on board.  Things started to get more clear and raised more questions and ultimately became more clear.

That is the power of visualization.  It really helps us to get started with our thinking. This visual thing works.  Just try it out.

Your next question might be “I kinda get it, but I don’t.  How do I visualize? What exactly do I visualize?”.  Please read on to find out the answers.

What is the basic approach to problem solving

Step 1:  identify small problems.

The major trick in problem solving is to identify and solve the smallest problem and then moving ahead with bigger ones.  So how do you do it?

The answer is division of responsibility.  Simply put, we need to identify parts that can stand on its own and identify a sequence in those responsibilities.  And once you start breaking down the problems into smaller ones, then you can go ahead with the next step.

Step 2:  Solve the smaller problems one at a time

Now that you have identified the smaller problems, try to solve them.  While solving them, make sure that you are focussing only on one problem at a time.  That makes life much simpler for us.  If you feel that this smaller problem is too big to solve on its own, try to break it down further.  You need to iterate steps 1 to step 3 for each smaller problem.  But for now, ignore the bigger problem and solve the rest of the problems.

  • It is ok to assume that other problems are solved
  • It is ok to hardcode when coding a particular problem, but later you will resolve it in step 3.
  • Solve the easier problems first, that will give you confidence and momentum until you get the confidence to solve the hardest problem first.

Step 3: Connect the dots (Integration)

You have solved individual problems.  Now it is time to connect the dots by connecting the individual solution.  Identify those steps which will make the solution or the program complete.  Typically in programming, the dots are connected by passing data that is stored in variables.

Step 4: Try to optimize each step & across steps

Once you are completed with a working solution, try to optimize the solution with the best code that you can write.  This comes only with practice.  This trick can make a difference between a good programmer and a great programmer.  But to get to this step, you need to be first good at steps 1 to 3.

Let’s take an example & walkthrough the problem solving approach

Problem:  check if a user given string is a palindrome or not.

I will be using Python for this exercise (Although I have experience in1 C# and JAVA, I am also a Python beginner, so pardon any bad code).  Let’s iterate through our steps:

Let’s call this as Level 1:

Step 1:  Identify smaller problems:

Image 2

Step 2: Solve the small problems

So each small problem will map to its corresponding solution as below:

Image 3

Note: When solving the step (3.  Compare the variables), I am doing 2 things:

  • I am making an assumption that reversed is the variable name of the reversed string.
  • I am hardcoding the variable name reversed to ‘madam’ to avoid compile time error
  • If you execute the program at this state, you can input ‘madam’ and check if it is printing ‘The given string is a palindrome’ (And) you can input something else like ‘dog’ and check if it is printing ‘The given string is not a palindrome’

When we are trying to connect the dots, the only thing that is missing now is the variable reversed is hardcoded.  For that to be set to the correct value, we need to break the small problem (Reverse the user input and store in a separate variable) into further smaller problems.  Till that point we need to mark it as incomplete.

2 things still remain unsolved in Level 1:

  • Solution for step 2 in the diagram (Reverse the user input and store in a separate variable)
  • Connecting the dots once the solution for step 2 is found

Iterating small problem 2 through our problem solving steps:

Let’s call this Level 2:

Step 1: Identify smaller problems

Image 4

Step 3: Connect the dots

Here, we have already connected the dots.  So we need not do anything extra in this step.

Now we have solved the smaller problems, which means Level 2 is over.  Now we need to come back to Level 1.

If you remember, 2 things remain in Level 1.  One is solution for step 2 which we have found now.  Two is connecting the dots.

Now if we substitute the small problem 2 with the solution that we derived just now, we get something like this:

Image 6

The thing that remains is connecting the dots.

So if we see what is the missing connection, the variable reversed is set twice.  One to the solution of step 2 and another is hardcoded in step 3.  So we can now remove the hardcoded value in step 3, in which case our code will become like this

Image 7

If you see, we have actually solved our problem.

We are left with step 4 – Optimize each step and across steps

Step 4: Try to optimize each step and across steps

As you can see, there are many things that needs to be optimized for this code.  I would leave you to optimize the code further.  Come on, put on your thinking cap and try different solutions.

BONUS STEP 5:  Make the code robust

By robust I mean,

  • Adding error & exception handling
  • Using better variable names
  • Adding user defined functions
  • Adding comments where necessary

Again, I would leave you to figure out how to do this step.

  • We saw just how we can solve problems using a step by step approach
  • By solving smaller problems, I get into a momentum for solving bigger & tougher problems
  • By focussing one problem at a time, I am eliminating distractions, thus allowing to better direct your efforts for that one problem rather than getting confused with many small problems at hand.
  • If you understand this approach and practice, you will definitely go on to solve bigger problems and your confidence will raise.
  • Beauty about breaking down the problem is that we can further convert each problem and sub problem into separate functions/modules thus making the code more modularized and maintainable.

Wait, You can’t leave yet:

Now dear beginner programmers, take any problem and try to apply this approach.  See the results for yourselves.  Now, describe the following in the comments section:

  • What problem you are solving?
  • How did you break it down? (Even a snap of your notebook page or board will do!)
  • The final code
  • How did you feel and what did you learn from this exercise?

Also remember, I am challenging you for the 30 day problem solving challenge.

If you liked this blog post, please feel free to share it with your circles in social media.

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Twitter

Comments and Discussions

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

problem solving for programming

  • All Articles List
  • 15 April 2024
  • 14304 views

Problem-Solving. How to Boost Your Ability to Solve Programing Tasks and Challenges

Problem-Solving. How to Boost Your Ability to Solve Programing Tasks and Challenges - 1

8 Steps to Improve Your Problem-Solving Skills as a Rookie Programmer

1. make sure you understand the problem, 2. break down the problem into smaller ones, 3. plan the solution first, 4. solve programming problems on various preparation platforms.

Java webinar

One of the most popular tech interview platforms with a huge community and over 1650 problems for you to practice. Supports 14 programming languages including Java.

Interview Cake

Another well-known website with all kinds of content for programmers, including programming tasks, articles, tips and lots of interview questions.

HackerEarth

Besides programming problems, this platform allows you to test yourself in mock interviews, as well as to participate in coding competitions and hackathons.

5. Use CodeGym to practice and learn how to approach programming problems

6. play coding games to practice problem-solving while having fun, 7. extend your knowledge of design patterns, algorithms, and data structures, 8. get feedback, 4 major applied programming techniques for problem solving, 1. debugging, 2. code refactoring, 3. using data structures & algorithms, 4. using version control systems.

Java university

Expert advice

Problem-Solving. How to Boost Your Ability to Solve Programing Tasks and Challenges - 2

For IEEE Members

Ieee spectrum, follow ieee spectrum, support ieee spectrum, enjoy more free content and benefits by creating an account, saving articles to read later requires an ieee spectrum account, the institute content is only available for members, downloading full pdf issues is exclusive for ieee members, downloading this e-book is exclusive for ieee members, access to spectrum 's digital edition is exclusive for ieee members, following topics is a feature exclusive for ieee members, adding your response to an article requires an ieee spectrum account, create an account to access more content and features on ieee spectrum , including the ability to save articles to read later, download spectrum collections, and participate in conversations with readers and editors. for more exclusive content and features, consider joining ieee ., join the world’s largest professional organization devoted to engineering and applied sciences and get access to all of spectrum’s articles, archives, pdf downloads, and other benefits. learn more →, join the world’s largest professional organization devoted to engineering and applied sciences and get access to this e-book plus all of ieee spectrum’s articles, archives, pdf downloads, and other benefits. learn more →, access thousands of articles — completely free, create an account and get exclusive content and features: save articles, download collections, and talk to tech insiders — all free for full access and benefits, join ieee as a paying member., ai copilots are changing how coding is taught, professors are shifting away from syntax and emphasizing higher-level skills.

Photo-illustration of a mini AI bot looking at a laptop atop a stock of books, sitting next to human hands on a laptop.

Generative AI is transforming the software development industry. AI-powered coding tools are assisting programmers in their workflows, while jobs in AI continue to increase. But the shift is also evident in academia—one of the major avenues through which the next generation of software engineers learn how to code.

Computer science students are embracing the technology, using generative AI to help them understand complex concepts, summarize complicated research papers, brainstorm ways to solve a problem, come up with new research directions, and, of course, learn how to code.

“Students are early adopters and have been actively testing these tools,” says Johnny Chang , a teaching assistant at Stanford University pursuing a master’s degree in computer science. He also founded the AI x Education conference in 2023, a virtual gathering of students and educators to discuss the impact of AI on education.

So as not to be left behind, educators are also experimenting with generative AI. But they’re grappling with techniques to adopt the technology while still ensuring students learn the foundations of computer science.

“It’s a difficult balancing act,” says Ooi Wei Tsang , an associate professor in the School of Computing at the National University of Singapore . “Given that large language models are evolving rapidly, we are still learning how to do this.”

Less Emphasis on Syntax, More on Problem Solving

The fundamentals and skills themselves are evolving. Most introductory computer science courses focus on code syntax and getting programs to run, and while knowing how to read and write code is still essential, testing and debugging—which aren’t commonly part of the syllabus—now need to be taught more explicitly.

“We’re seeing a little upping of that skill, where students are getting code snippets from generative AI that they need to test for correctness,” says Jeanna Matthews , a professor of computer science at Clarkson University in Potsdam, N.Y.

Another vital expertise is problem decomposition. “This is a skill to know early on because you need to break a large problem into smaller pieces that an LLM can solve,” says Leo Porter , an associate teaching professor of computer science at the University of California, San Diego . “It’s hard to find where in the curriculum that’s taught—maybe in an algorithms or software engineering class, but those are advanced classes. Now, it becomes a priority in introductory classes.”

“Given that large language models are evolving rapidly, we are still learning how to do this.” —Ooi Wei Tsang, National University of Singapore

As a result, educators are modifying their teaching strategies. “I used to have this singular focus on students writing code that they submit, and then I run test cases on the code to determine what their grade is,” says Daniel Zingaro , an associate professor of computer science at the University of Toronto Mississauga . “This is such a narrow view of what it means to be a software engineer, and I just felt that with generative AI, I’ve managed to overcome that restrictive view.”

Zingaro, who coauthored a book on AI-assisted Python programming with Porter, now has his students work in groups and submit a video explaining how their code works. Through these walk-throughs, he gets a sense of how students use AI to generate code, what they struggle with, and how they approach design, testing, and teamwork.

“It’s an opportunity for me to assess their learning process of the whole software development [life cycle]—not just code,” Zingaro says. “And I feel like my courses have opened up more and they’re much broader than they used to be. I can make students work on larger and more advanced projects.”

Ooi echoes that sentiment, noting that generative AI tools “will free up time for us to teach higher-level thinking—for example, how to design software, what is the right problem to solve, and what are the solutions. Students can spend more time on optimization, ethical issues, and the user-friendliness of a system rather than focusing on the syntax of the code.”

Avoiding AI’s Coding Pitfalls

But educators are cautious given an LLM’s tendency to hallucinate . “We need to be teaching students to be skeptical of the results and take ownership of verifying and validating them,” says Matthews.

Matthews adds that generative AI “can short-circuit the learning process of students relying on it too much.” Chang agrees that this overreliance can be a pitfall and advises his fellow students to explore possible solutions to problems by themselves so they don’t lose out on that critical thinking or effective learning process. “We should be making AI a copilot—not the autopilot—for learning,” he says.

“We should be making AI a copilot—not the autopilot—for learning.” —Johnny Chang, Stanford University

Other drawbacks include copyright and bias. “I teach my students about the ethical constraints—that this is a model built off other people’s code and we’d recognize the ownership of that,” Porter says. “We also have to recognize that models are going to represent the bias that’s already in society.”

Adapting to the rise of generative AI involves students and educators working together and learning from each other. For her colleagues, Matthews’s advice is to “try to foster an environment where you encourage students to tell you when and how they’re using these tools. Ultimately, we are preparing our students for the real world, and the real world is shifting, so sticking with what you’ve always done may not be the recipe that best serves students in this transition.”

Porter is optimistic that the changes they’re applying now will serve students well in the future. “There’s this long history of a gap between what we teach in academia and what’s actually needed as skills when students arrive in the industry,” he says. “There’s hope on my part that we might help close the gap if we embrace LLMs.”

  • How Coders Can Survive—and Thrive—in a ChatGPT World ›
  • AI Coding Is Going From Copilot to Autopilot ›
  • OpenAI Codex ›

Rina Diane Caballar is a writer covering tech and its intersections with science, society, and the environment. An IEEE Spectrum Contributing Editor, she's a former software engineer based in Wellington, New Zealand.

Bruce Benson

Yes! Great summary of how things are evolving with AI. I’m a retired coder (BS comp sci) and understand the fundamentals of developing systems. Learning the lastest systems is now the greatest challenge. I was intrigued by Ansible to help me manage my homelab cluster, but who wants to learn one more scripting language? Turns out ChatGPT4 knows the syntax, semantics, and work flow of Ansible and all I do is tell is to “install log2ram on all my proxmox servers” and I get a playbook that does just that. The same with Docker Compose scripts. Wow.

Video Friday: Robot Bees

The new shadow hand can take a beating, commercial space stations approach launch phase, related stories, ai spam threatens the internet—ai can also protect it, what is generative ai, generative ai has a visual plagiarism problem.

  • Guidelines to Write Experiences
  • Write Interview Experience
  • Write Work Experience
  • Write Admission Experience
  • Write Campus Experience
  • Write Engineering Experience
  • Write Coaching Experience
  • Write Professional Degree Experience
  • Write Govt. Exam Experiences
  • JP Morgan Interview Experience Through Code For Good(CFG)
  • Contest Experiences | My first Leetcode Coding Contest Experince
  • Contest Experience - How to begin Coding on GeeksforGeeks
  • What coding habits improve timing in coding contest?
  • How to Write Coding Contest Experiences on GeeksForGeeks
  • Contest Experiences: Beginner's Guide to Coding Contests
  • Contest Experience - My First Coding Contest
  • Contest Experiences | GeeksforGeeks Weekly Coding Contest
  • Most Popular Weekly Coding Contest Platforms
  • My Code Frenzy Experience: Challenging Rounds and a Valuable Learning Journey
  • How to use Chat-GPT to solve Coding Problems?
  • Can ChatGPT be used to solve Competitive Coding Problems?
  • Contest Experience - GeeksForGeeks Weekly Coding Contest 119
  • Contest Experience - Google Summer of Code (GSoC)
  • Contest Experiences | Geeksforgeeks: Bi-Wizard School Coding Tournament 16.0
  • Contest Experiences | Geeksforgeeks GFG Weekly Coding Contest - 105
  • Google's Coding Competitions You Can Consider
  • Code India Code - Challenge Your Coding Skills with GeeksforGeeks
  • Contest Experiences | Bi-Wizard School Coding Tournament 17.0

My Journey of Learning Problem-Solving Skills through Coding Contests

I still remember the day I gave my first coding contest because I learned many things afterwards. when I was in my first year I didn’t know how to strengthen my problem-solving skills so I went to my seniors and ask a solution for it and then they gave a solution if you want to test your problem-solving skills you should participate in weekly coding contests. but firstly you should have learned some basic patterns of DSA . it will enhance your problem-solving skills and your speed will gradually increase do not overthink if you are not able to solve the problem you can see the solution after the contest and learn how the problem will solved. I took this advice seriously.

My first coding contest

when I was in my first year I knew that Geeksforgeeks conducted a weekly coding contest and it also provided amazing goodies who scored a good rank in the contest so I registered for the contest there were 4 questions in the contest and I solved the first question easily because it is related to a prime number which I recently learned but the second question seems tough to me I find the right approach but not able to implement it during the contest. After all, it is related to an array and at that time did not know the concept of prefix sum . but was not demotivated by this because it was the first time I had given such kind of contest and remembered what my senior said to me after the contest ended I saw the solution and learned the concept of prefix sum and the next time I gave the contest this approach helped a lot of times.

Tips I want to give from my learnings

  • Participate in weekly contests will give you different benefits
  • Your timing and problem-solving speed will be increased by giving weekly contest
  • And never demotivated when a new question comes and you are not able to solve it just see the solution after the contest ends and learn how the question solved
  • Whenever you learn a new concept like binary search, sliding window or two pointers solve different questions using these concepts and you never forget these concepts
  • Remember you can not become a proficient problem solver in a day it takes time so trust the process and believe in consistency.

Please Login to comment...

Similar reads.

  • Write It Up 2024
  • Experiences

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

Solving the Car Sequencing Problem with Cross-Ratio Constraints Using Constraint Programming Approach

  • Conference paper
  • First Online: 11 May 2024
  • Cite this conference paper

problem solving for programming

  • Sana Jalilvand   ORCID: orcid.org/0009-0006-0304-9960 7 ,
  • Ali Bozorgi-Amiri   ORCID: orcid.org/0000-0002-1180-9572 8 ,
  • Mehdi Mamoodjanloo   ORCID: orcid.org/0000-0003-0928-5834 7 &
  • Armand Baboli   ORCID: orcid.org/0000-0003-0542-3566 7  

Part of the book series: Lecture Notes in Business Information Processing ((LNBIP,volume 507))

Included in the following conference series:

  • International Conference on Industrial Engineering and Applications

The rise of mass-individualization has underscored the significance of Mixed-Model Assembly Lines (MMALs) for producing diverse products on the same line. The Car Sequencing Problem (CSP) tackles short-term balancing in an MMAL by emphasizing the use of spacing rules to manage the space between each pair of work-intensive products that possess specific characteristics. In this study, we tackle two challenges within the CSP context. The first challenge involves exploring CSP with cross-ratio constraints that takes into account the dependency between different characteristics. As the second challenge, we study the CSP under two states where spacing rule violations are not allowed (hard) and allowed (soft). We develop two constraint programming models for the mentioned states and evaluate the performance of the models using several real-world assembly lines’ instances. The findings enhance understanding of each model’s strengths and weaknesses. Given the inherent complexity of real-world problems, the soft model may find more practical and effective application. This research enriches the realm of problem-solving in MMALs by offering valuable insights and introducing the main challenges in the CSP.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
  • Available as EPUB and PDF
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Delice, Y., Aydoğan, E.K., Himmetoğlu, S., Özcan, U.: Integrated mixed-model assembly line balancing and parts feeding with supermarkets. CIRP J. Manuf. Sci. Technol. 41 , 1–18 (2023)

Article   Google Scholar  

Koren, Y., Shpitalni, M., Gu, P., Hu, S.J.: Product design for mass-individualization. Procedia Cirp 36 , 64–71 (2015)

Boysen, N., Fliedner, M., Scholl, A.: Sequencing mixed-model assembly lines: survey, classification and model critique. Eur. J. Oper. Res. 192 (2), 349–373 (2009)

Article   MathSciNet   Google Scholar  

Mahmoodjanloo, M., Baboli, A., Ruhla, M.: Car sequencing problem with cross-ratio constraints: a multi-start parallel local search. IFAC-PapersOnLine 55 (10), 1255–1260 (2022)

Brailsford, S.C., Potts, C.N., Smith, B.M.: Constraint satisfaction problems: algorithms and applications. Eur. J. Oper. Res. 119 (3), 557–581 (1999)

Gottlieb, J., Puchta, M., Solnon, C.: A study of greedy, local search, and ant colony optimization approaches for car sequencing problems. In: Cagnoni, S., et al. (eds.) EvoWorkshops 2003. LNCS, vol. 2611, pp. 246–257. Springer, Heidelberg (2003). https://doi.org/10.1007/3-540-36605-9_23

Chapter   Google Scholar  

Gravel, M., Gagne, C., Price, W.L.: Review and comparison of three methods for the solution of the car sequencing problem. J. Oper. Res. Soc. 56 (11), 1287–1295 (2005)

Bautista, J., Pereira, J., Adenso-Díaz, B.: A beam search approach for the optimization version of the car sequencing problem. Ann. Oper. Res. 159 , 233–244 (2008)

Vahedi-Nouri, B., Tavakkoli-Moghaddam, R., Hanzálek, Z., Dolgui, A.: Production scheduling in a reconfigurable manufacturing system benefiting from human-robot collaboration. Int. J. Prod. Res. 1–17 (2023)

Google Scholar  

Butaru, M., Habbas, Z.: The car-sequencing problem as n-ary CSP–sequential and parallel solving. In: Zhang, S., Jarvis, R. (eds.) AI 2005. LNCS, vol. 3809, pp. 875–878. Springer, Heidelberg (2005). https://doi.org/10.1007/11589990_100

Siala, M., Hebrard, E., Huguet, M.J.: A study of constraint programming heuristics for the car-sequencing problem. Eng. Appl. Artif. Intell. 38 , 34–44 (2015)

Dincbas, M., Simonis, H., Van Hentenryck, P.: Solving the car-sequencing problem in constraint logic programming. In: ECAI, vol. 88, pp. 290–295 (1988)

Kis, T.: On the complexity of the car sequencing problem. Oper. Res. Lett. 32 (4), 331–335 (2004)

Bysko, S., Krystek, J., Bysko, S.: Automotive paint shop 4.0. Comput. Industr. Eng. 139 , 105546 (2020)

Zinflou, A., Gagné, C., Gravel, M.: Design of an Efficient Genetic Algorithm to Solve the Industrial Car Sequencing Problem. IntechOpen (2008)

Briant, O., Naddef, D., Mounié, G.: Greedy approach and multi-criteria simulated annealing for the car sequencing problem. Eur. J. Oper. Res. 191 (3), 993–1003 (2008)

Moya, I., Chica, M., Bautista, J.: Constructive metaheuristics for solving the car sequencing problem under uncertain partial demand. Comput. Ind. Eng. 137 , 106048 (2019)

Wu, J., Ding, Y., Shi, L.: Mathematical modeling and heuristic approaches for a multi-stage car sequencing problem. Comput. Ind. Eng. 152 , 107008 (2021)

Souza, F., Grimes, D., O’Sullivan, B.: Variable-relationship guided LNS for the car sequencing problem. In: Longo, L., O’Reilly, R. (eds.) AICS 2022. CCIS, vol. 1662, pp. 437–449. Springer, Cham (2023). https://doi.org/10.1007/978-3-031-26438-2_34

Download references

Author information

Authors and affiliations.

LIRIS Laboratory, UMR 5205 CNRS, INSA of Lyon, Villeurbanne, France

Sana Jalilvand, Mehdi Mamoodjanloo & Armand Baboli

School of Industrial Engineering, College of Engineering, University of Tehran, Tehran, Iran

Ali Bozorgi-Amiri

You can also search for this author in PubMed   Google Scholar

Corresponding author

Correspondence to Armand Baboli .

Editor information

Editors and affiliations.

Asian University, Taichung, Taiwan

Shey-Huei Sheu

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Cite this paper.

Jalilvand, S., Bozorgi-Amiri, A., Mamoodjanloo, M., Baboli, A. (2024). Solving the Car Sequencing Problem with Cross-Ratio Constraints Using Constraint Programming Approach. In: Sheu, SH. (eds) Industrial Engineering and Applications – Europe. ICIEA-EU 2024. Lecture Notes in Business Information Processing, vol 507. Springer, Cham. https://doi.org/10.1007/978-3-031-58113-7_11

Download citation

DOI : https://doi.org/10.1007/978-3-031-58113-7_11

Published : 11 May 2024

Publisher Name : Springer, Cham

Print ISBN : 978-3-031-58112-0

Online ISBN : 978-3-031-58113-7

eBook Packages : Computer Science Computer Science (R0)

Share this paper

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

  • Publish with us

Policies and ethics

  • Find a journal
  • Track your research

Watch CBS News

Teens come up with trigonometry proof for Pythagorean Theorem, a problem that stumped math world for centuries

By Bill Whitaker

May 5, 2024 / 7:00 PM EDT / CBS News

As the school year ends, many students will be only too happy to see math classes in their rearview mirrors. It may seem to some of us non-mathematicians that geometry and trigonometry were created by the Greeks as a form of torture, so imagine our amazement when we heard two high school seniors had proved a mathematical puzzle that was thought to be impossible for 2,000 years. 

We met Calcea Johnson and Ne'Kiya Jackson at their all-girls Catholic high school in New Orleans. We expected to find two mathematical prodigies.

Instead, we found at St. Mary's Academy , all students are told their possibilities are boundless.

Come Mardi Gras season, New Orleans is alive with colorful parades, replete with floats, and beads, and high school marching bands.

In a city where uniqueness is celebrated, St. Mary's stands out – with young African American women playing trombones and tubas, twirling batons and dancing - doing it all, which defines St. Mary's, students told us.

Junior Christina Blazio says the school instills in them they have the ability to accomplish anything. 

Christina Blazio: That is kinda a standard here. So we aim very high - like, our aim is excellence for all students. 

The private Catholic elementary and high school sits behind the Sisters of the Holy Family Convent in New Orleans East. The academy was started by an African American nun for young Black women just after the Civil War. The church still supports the school with the help of alumni.

In December 2022, seniors Ne'Kiya Jackson and Calcea Johnson were working on a school-wide math contest that came with a cash prize.

Ne'Kiya Jackson and Calcea Johnson

Ne'Kiya Jackson: I was motivated because there was a monetary incentive.

Calcea Johnson: 'Cause I was like, "$500 is a lot of money. So I-- I would like to at least try."

Both were staring down the thorny bonus question.

Bill Whitaker: So tell me, what was this bonus question?

Calcea Johnson: It was to create a new proof of the Pythagorean Theorem. And it kind of gave you a few guidelines on how would you start a proof.

The seniors were familiar with the Pythagorean Theorem, a fundamental principle of geometry. You may remember it from high school: a² + b² = c². In plain English, when you know the length of two sides of a right triangle, you can figure out the length of the third.

Both had studied geometry and some trigonometry, and both told us math was not easy. What no one told  them  was there had been more than 300 documented proofs of the Pythagorean Theorem using algebra and geometry, but for 2,000 years a proof using trigonometry was thought to be impossible, … and that was the bonus question facing them.

Bill Whitaker: When you looked at the question did you think, "Boy, this is hard"?

Ne'Kiya Jackson: Yeah. 

Bill Whitaker: What motivated you to say, "Well, I'm going to try this"?

Calcea Johnson: I think I was like, "I started something. I need to finish it." 

Bill Whitaker: So you just kept on going.

Calcea Johnson: Yeah.

For two months that winter, they spent almost all their free time working on the proof.

CeCe Johnson: She was like, "Mom, this is a little bit too much."

CeCe and Cal Johnson are Calcea's parents.

CeCe Johnson:   So then I started looking at what she really was doing. And it was pages and pages and pages of, like, over 20 or 30 pages for this one problem.

Cal Johnson: Yeah, the garbage can was full of papers, which she would, you know, work out the problems and-- if that didn't work she would ball it up, throw it in the trash. 

Bill Whitaker: Did you look at the problem? 

Neliska Jackson is Ne'Kiya's mother.

Neliska Jackson: Personally I did not. 'Cause most of the time I don't understand what she's doing (laughter).

Michelle Blouin Williams: What if we did this, what if I write this? Does this help? ax² plus ….

Their math teacher, Michelle Blouin Williams, initiated the math contest.

Michelle Blouin Williams

Bill Whitaker: And did you think anyone would solve it?

Michelle Blouin Williams: Well, I wasn't necessarily looking for a solve. So, no, I didn't—

Bill Whitaker: What were you looking for?

Michelle Blouin Williams: I was just looking for some ingenuity, you know—

Calcea and Ne'Kiya delivered on that! They tried to explain their groundbreaking work to 60 Minutes. Calcea's proof is appropriately titled the Waffle Cone.

Calcea Johnson: So to start the proof, we start with just a regular right triangle where the angle in the corner is 90°. And the two angles are alpha and beta.

Bill Whitaker: Uh-huh

Calcea Johnson: So then what we do next is we draw a second congruent, which means they're equal in size. But then we start creating similar but smaller right triangles going in a pattern like this. And then it continues for infinity. And eventually it creates this larger waffle cone shape.

Calcea Johnson: Am I going a little too—

Bill Whitaker: You've been beyond me since the beginning. (laughter) 

Bill Whitaker: So how did you figure out the proof?

Ne'Kiya Jackson: Okay. So you have a right triangle, 90° angle, alpha and beta.

Bill Whitaker: Then what did you do?

Bill Whitaker with Calcea Johnson and Ne'Kiya Jackson

Ne'Kiya Jackson: Okay, I have a right triangle inside of the circle. And I have a perpendicular bisector at OP to divide the triangle to make that small right triangle. And that's basically what I used for the proof. That's the proof.

Bill Whitaker: That's what I call amazing.

Ne'Kiya Jackson: Well, thank you.

There had been one other documented proof of the theorem using trigonometry by mathematician Jason Zimba in 2009 – one in 2,000 years. Now it seems Ne'Kiya and Calcea have joined perhaps the most exclusive club in mathematics. 

Bill Whitaker: So you both independently came up with proof that only used trigonometry.

Ne'Kiya Jackson: Yes.

Bill Whitaker: So are you math geniuses?

Calcea Johnson: I think that's a stretch. 

Bill Whitaker: If not genius, you're really smart at math.

Ne'Kiya Jackson: Not at all. (laugh) 

To document Calcea and Ne'Kiya's work, math teachers at St. Mary's submitted their proofs to an American Mathematical Society conference in Atlanta in March 2023.

Ne'Kiya Jackson: Well, our teacher approached us and was like, "Hey, you might be able to actually present this," I was like, "Are you joking?" But she wasn't. So we went. I got up there. We presented and it went well, and it blew up.

Bill Whitaker: It blew up.

Calcea Johnson: Yeah. 

Ne'Kiya Jackson: It blew up.

Bill Whitaker: Yeah. What was the blowup like?

Calcea Johnson: Insane, unexpected, crazy, honestly.

It took millenia to prove, but just a minute for word of their accomplishment to go around the world. They got a write-up in South Korea and a shout-out from former first lady Michelle Obama, a commendation from the governor and keys to the city of New Orleans. 

Bill Whitaker: Why do you think so many people found what you did to be so impressive?

Ne'Kiya Jackson: Probably because we're African American, one. And we're also women. So I think-- oh, and our age. Of course our ages probably played a big part.

Bill Whitaker: So you think people were surprised that young African American women, could do such a thing?

Calcea Johnson: Yeah, definitely.

Ne'Kiya Jackson: I'd like to actually be celebrated for what it is. Like, it's a great mathematical achievement.

Achievement, that's a word you hear often around St. Mary's academy. Calcea and Ne'Kiya follow a long line of barrier-breaking graduates. 

The late queen of Creole cooking, Leah Chase , was an alum. so was the first African-American female New Orleans police chief, Michelle Woodfork …

And judge for the Fifth Circuit Court of Appeals, Dana Douglas. Math teacher Michelle Blouin Williams told us Calcea and Ne'Kiya are typical St. Mary's students.  

Bill Whitaker: They're not unicorns.

Michelle Blouin Williams: Oh, no no. If they are unicorns, then every single lady that has matriculated through this school is a beautiful, Black unicorn.

Pamela Rogers: You're good?

Pamela Rogers, St. Mary's president and interim principal, told us the students hear that message from the moment they walk in the door.

St. Mary's Academy president and interim principal Pamela Rogers

Pamela Rogers: We believe all students can succeed, all students can learn. It does not matter the environment that you live in. 

Bill Whitaker: So when word went out that two of your students had solved this almost impossible math problem, were they universally applauded?

Pamela Rogers: In this community, they were greatly applauded. Across the country, there were many naysayers.

Bill Whitaker: What were they saying?

Pamela Rogers: They were saying, "Oh, they could not have done it. African Americans don't have the brains to do it." Of course, we sheltered our girls from that. But we absolutely did not expect it to come in the volume that it came.  

Bill Whitaker: And after such a wonderful achievement.

Pamela Rogers: People-- have a vision of who can be successful. And-- to some people, it is not always an African American female. And to us, it's always an African American female.

Gloria Ladson-Billings: What we know is when teachers lay out some expectations that say, "You can do this," kids will work as hard as they can to do it.

Gloria Ladson-Billings, professor emeritus at the University of Wisconsin, has studied how best to teach African American students. She told us an encouraging teacher can change a life.

Bill Whitaker: And what's the difference, say, between having a teacher like that and a whole school dedicated to the excellence of these students?

Gloria Ladson-Billings: So a whole school is almost like being in Heaven. 

Bill Whitaker: What do you mean by that?

Bill Whitaker and Gloria Ladson-Billings

Gloria Ladson-Billings: Many of our young people have their ceilings lowered, that somewhere around fourth or fifth grade, their thoughts are, "I'm not going to be anything special." What I think is probably happening at St. Mary's is young women come in as, perhaps, ninth graders and are told, "Here's what we expect to happen. And here's how we're going to help you get there."

At St. Mary's, half the students get scholarships, subsidized by fundraising to defray the $8,000 a year tuition. Here, there's no test to get in, but expectations are high and rules are strict: no cellphones, modest skirts, hair must be its natural color.

Students Rayah Siddiq, Summer Forde, Carissa Washington, Tatum Williams and Christina Blazio told us they appreciate the rules and rigor.

Rayah Siddiq: Especially the standards that they set for us. They're very high. And I don't think that's ever going to change.

Bill Whitaker: So is there a heart, a philosophy, an essence to St. Mary's?

Summer Forde: The sisterhood—

Carissa Washington: Sisterhood.

Tatum Williams: Sisterhood.

Bill Whitaker: The sisterhood?

Voices: Yes.

Bill Whitaker: And you don't mean the nuns. You mean-- (laughter)

Christina Blazio: I mean, yeah. The community—

Bill Whitaker: So when you're here, there's just no question that you're going to go on to college.

Rayah Siddiq: College is all they talk about. (laughter) 

Pamela Rogers: … and Arizona State University (Cheering)

Principal Rogers announces to her 615 students the colleges where every senior has been accepted.

Bill Whitaker: So for 17 years, you've had a 100% graduation rate—

Pamela Rogers: Yes.

Bill Whitaker: --and a 100% college acceptance rate?

Pamela Rogers: That's correct.

Last year when Ne'Kiya and Calcea graduated, all their classmates went to college and got scholarships. Ne'Kiya got a full ride to the pharmacy school at Xavier University in New Orleans. Calcea, the class valedictorian, is studying environmental engineering at Louisiana State University.

Bill Whitaker: So wait a minute. Neither one of you is going to pursue a career in math?

Both: No. (laugh)

Calcea Johnson: I may take up a minor in math. But I don't want that to be my job job.

Ne'Kiya Jackson: Yeah. People might expect too much out of me if (laugh) I become a mathematician. (laugh)

But math is not completely in their rear-view mirrors. This spring they submitted their high school proofs for final peer review and publication … and are still working on further proofs of the Pythagorean Theorem. Since their first two …

Calcea Johnson: We found five. And then we found a general format that could potentially produce at least five additional proofs.

Bill Whitaker: And you're not math geniuses?

Bill Whitaker: I'm not buying it. (laughs)

Produced by Sara Kuzmarov. Associate producer, Mariah B. Campbell. Edited by Daniel J. Glucksman.

Bill Whitaker

Bill Whitaker is an award-winning journalist and 60 Minutes correspondent who has covered major news stories, domestically and across the globe, for more than four decades with CBS News.

More from CBS News

As a Social Security cut looms, should seniors buy long-term care insurance now?

"Absolutely stunning" rare electric blue lobster caught in England

Transborder students who crossed from Mexico to U.S. set to graduate

"Operation Catch a Toe" leads to murder suspect with distinctive foot

IMAGES

  1. 6 Ways to Improve Your Programming Problem Solving

    problem solving for programming

  2. Six Steps to Solving a Programming Problem Infographic

    problem solving for programming

  3. Programming for Problem Solving

    problem solving for programming

  4. Problem Solving In Programming

    problem solving for programming

  5. Tips to Improve Problem-Solving Skills in Programming

    problem solving for programming

  6. Programming of Problem Solving [RTU]

    problem solving for programming

VIDEO

  1. Techniques of Problem solving in Programming

  2. Double in C

  3. Number Theory -GCD -LCM-Sieve of eratosthenes- Prime factorization شرح

  4. Prefix sum array شرح || Problem solving

  5. Partial Sum شرح || Problem Solving

  6. Competitive Programming Training: Beginner to Specialist at Codeforces

COMMENTS

  1. Problems

    Our platform offers a range of essential problems for practice, as well as the latest questions being asked by top-tier companies. ... Interview. Store Study Plan. See all. Array 1633. String 696. Hash Table 589. Dynamic Programming 496. Math 496. Sorting 399. Greedy 362. Depth-First Search 286. Database 266. Binary Search 262. Tree 228 ...

  2. How to Solve Coding Problems with a Simple Four Step Method

    In this post, we've gone over the four-step problem-solving strategy for solving coding problems. Let's review them here: Step 1: understand the problem. Step 2: create a step-by-step plan for how you'll solve it. Step 3: carry out the plan and write the actual code.

  3. How to think like a programmer

    Problem-solving skills are almost unanimously the most important qualification that employers look for….more than programming languages proficiency, debugging, and system design. Demonstrating computational thinking or the ability to break down large, complex problems is just as valuable (if not more so) than the baseline technical skills ...

  4. The 10 Most Popular Coding Challenge Websites [Updated for 2021]

    A great way to improve your skills when learning to code is by solving coding challenges. Solving different types of challenges and puzzles can help you become a better problem solver, learn the intricacies of a programming language, prepare for job interviews, learn new algorithms, and more. Below is a

  5. Online Coding Practice Problems & Challenges

    Dynamic programming is a method for efficiently solving a broad range of search and optimization problems by breaking them down into simpler subproblems. It allows you to write more efficient, optimized code for complex problems.

  6. What is Problem Solving? An Introduction

    As you can see, problem solving plays a pivotal role in software engineering. Far from being an occasional requirement, it is the lifeblood that drives development forward, catalyzes innovation, and delivers of quality software. By leveraging problem-solving techniques, software engineers employ a powerful suite of strategies to overcome ...

  7. Codewars

    codewars IS BUILT ON. The world's most advanced coding assessment platform for organizations looking to scale their hiring, upskilling, and certification programs. through challenge. A coding practice website for all programming levels - Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!

  8. Problem Solving

    Problem solving is the core thing software developers do. The programming languages and tools they use are secondary to this fundamental skill. From his book, "Think Like a Programmer", V. Anton Spraul defines problem solving in programming as:

  9. Hands-on Tutorial: How To Improve Your Problem-Solving Skills As A

    Programming is ultimately problem-solving. We only apply the programming language to express how we've thought about a problem and the approach we're using to solve it. The worst thing you could do is to start chipping away at the problem once it's presented. This is where most newbie programmers get stuck and give up.

  10. 10 Steps to Solving a Programming Problem

    The goal is to take all the even numbers and return them in an array. If there are no even numbers, return an empty array. 2. Work through the problem manually with at least three sets of sample data. Take out a piece of paper and work through the problem manually.

  11. Programming Tutorials and Practice Problems

    Functional Programming. Higher Order Functions and Decorators. Practice programming skills with tutorials and practice problems of Basic Programming, Data Structures, Algorithms, Math, Machine Learning, Python. HackerEarth is a global hub of 5M+ developers.

  12. Solve Python

    Join over 23 million developers in solving code challenges on HackerRank, one of the best ways to prepare for programming interviews. ... Problem Solving (Basic) Python (Basic) Problem Solving (Advanced) Python (Intermediate) Difficulty. Easy. Medium. Hard. Subdomains. Introduction. Basic Data Types. Strings. Sets. Math.

  13. Programming Fundamentals Course by Duke University

    This is because programming is fundamentally about figuring out how to solve a class of problems and writing the algorithm, a clear set of steps to solve any problem in its class. This course will introduce you to a powerful problem-solving process—the Seven Steps—which you can use to solve any programming problem.

  14. How to Develop Problem Solving Skills in Programming

    What is Problem Solving in Programming? Computers are used to solve various problems in day-to-day life. Problem Solving is an essential skill that helps to solve problems in programming. There are specific steps to be carried out to solve problems in computer programming, and the success depends on how correctly and precisely we define a problem.

  15. Problem-Solving for Developers

    How to approach problem-solving as a developer 🤔. Seven steps and strategies to solve software development challenges faster. 1:45 Identify the problem2:52 ...

  16. 10,000+ Coding Practice Challenges // Edabit

    functional_programming. math. numbers. Very Easy. Add to bookmarks. Add to collection. Basketball Points. You are counting points for a basketball game, given the amount of 2-pointers scored and 3-pointers scored, find the final points for the team and return that value. Examples points(1, 1) 5 points(7, 5) 29 points(38, 8) 100 Notes N/A

  17. 3 Tips to Solve Problems Like an Expert

    Interactive debugging. Log-file analysis. Unit and integration test. Analyze the bundle file if the problem is related to the web performance. 3. Use Spectrum Thinking Instead of Binary Thinking. Binary thinking is always putting things in terms of two alternatives that are usually mutually exclusive.

  18. The Beginner Programmer's guide to Problem Solving [With Example]

    Step 3: Connect the dots (Integration) You have solved individual problems. Now it is time to connect the dots by connecting the individual solution. Identify those steps which will make the solution or the program complete. Typically in programming, the dots are connected by passing data that is stored in variables.

  19. Learn Essential Problem Solving Skills

    Skills you'll gain: Computational Thinking, Computer Programming, Problem Solving, Algorithms, Computational Logic, Critical Thinking, Programming Principles, Python Programming, Theoretical Computer Science, Computer Programming Tools. 4.7 (1.4K reviews) Beginner · Course · 1 - 4 Weeks. C.

  20. Problem Solving, Python Programming, and Video Games

    This course is an introduction to computer science and programming in Python. Upon successful completion of this course, you will be able to: 1. Take a new computational problem and solve it, using several problem solving techniques including abstraction and problem decomposition. 2. Follow a design creation process that includes: descriptions ...

  21. Practice

    Platform to practice programming problems. Solve company interview questions and improve your coding intellect We use cookies to ensure you have the best browsing experience on our website.

  22. Problem-Solving. How to Boost Your Ability to Solve ...

    4. Solve programming problems on various preparation platforms. Practicing on various preparation platforms for programmers and programming interviews also will be really helpful in improving your problem-solving skills. Especially if you will use a number of platforms to diversify the problems you are working on as much as possible.

  23. PDF Problem Solving Basics and Computer Programming

    First, lay out your starting node, as every one of your programs will have these. Start. Next, begin adding your program elements sequentially, in the order that your problem description indicated. Connect the elements of your flowchart by uni-directional arrows that indicate the flow of your program.

  24. DSA

    A problem-solving technique called problem decomposition involves breaking down a complex problem into smaller, more manageable parts. By dividing a problem into smaller components, it becomes easier to understand, solve, and implement. Problem decomposition is a fundamental skill in programming and computer science, allowing developers to ...

  25. AI Copilots Are Changing How Coding Is Taught

    Less Emphasis on Syntax, More on Problem Solving. The fundamentals and skills themselves are evolving. Most introductory computer science courses focus on code syntax and getting programs to run ...

  26. My Journey of Learning Problem-Solving Skills through ...

    Solved. Summer-time is here and so is the time to skill-up! More than 5,000 learners have now completed their journey from basics of DSA to advanced level development programs such as Full-Stack, Backend Development, Data Science. And why go anywhere else when our DSA to Development: Coding Guide will help you master all this in a few months!

  27. Solving Clustering and Allocation Problems of Human-Robot Collaboration

    Nunkaew, W. and M. Kimaporn, Lexicographic Goal Programming Model for Solving Multi-Objective Worker Assignment Problems with Grey Relational Analysis, in The Annual Conference on Engineering and Information Technology. 2023: Osaka, Japan. Google Scholar; Attia, E.A., 2022.

  28. Lower time bounds for parallel solving of the subset sum problem by a

    Lower time bounds for parallel solving of the subset sum problem by a dynamic programming algorithm. Roman Kolpakov, Corresponding Author. Roman Kolpakov ... we compute some lower bounds on time of parallel solving of the subset sum problem on a big number of processors by several versions of dynamic programming algorithm Balsub proposed before ...

  29. Solving the Car Sequencing Problem with Cross-Ratio ...

    We proceed to propose two models of the problem utilizing the Constraint Programming (CP) approach. 2.1 Problem Definition. CSP-CR involves finding a sequence for products with different characteristics to enter the assembly line, while adhering to predefined spacing rules. In this constraint satisfaction problem, products are treated as ...

  30. Teens come up with trigonometry proof for Pythagorean Theorem, a

    A high school teacher didn't expect a solution when she set a 2,000-year-old Pythagorean Theorem problem in front of her students. Then Calcea Johnson and Ne'Kiya Jackson stepped up to the challenge.