Achieve mastery through challenge

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

solving problems 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.

solving problems 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.

solving problems 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.

solving problems 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.

solving problems 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.

solving problems 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.

solving problems for programming

Ahmed Omran


Accidentally got addicted to codewars, oops.

solving problems 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.

Release notes: issue 1: Q4 2023 to January 2024

Release notes: issue 1: Q4 2023 to January 2024

solving problems for programming

Codewarriors, it's time to build your personal brand!

solving problems for programming

Andela and Codewars Join Forces

solving problems for programming

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

solving problems 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

Getting it right: why infographics are not the same as data visualizations

Getting it right: why infographics are not the same as data visualizations

A rundown on the key differences and ideas for when to use each.

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..

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….

Leading with the Power of Influence vs. Positional Power


Leading with the Power of Influence vs. Positional Power

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

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.

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.

solving problems for programming

General Coding Knowledge

solving problems for programming

Stories to Help You Grow as a Software Developer

solving problems for programming

Coding & Development

solving problems for programming

ChatGPT prompts

Jacob Bennett

Jacob Bennett

Level Up Coding

The 5 paid subscriptions I actually use in 2024 as a software engineer

Tools i use that are cheaper than netflix.

These Words Make it Obvious That Your Text is Written By AI

James Presbitero Jr.

Practice in Public

These Words Make it Obvious That Your Text is Written By AI

These 7 words are painfully obvious. they make me cringe. they will make your reader cringe..

JSON is incredibly slow: Here’s What’s Faster!

Vaishnav Manoj

DataX Journal

JSON is incredibly slow: Here’s What’s Faster!

Unlocking the need for speed: optimizing json performance for lightning-fast apps and finding alternatives to it.

My favorite coding question to give candidates

Carlos Arguelles

My favorite coding question to give candidates

A coding question, from the viewpoint of an google/amazon/microsoft interviewer.

Text to speech


  • 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
  • Online Degree Explore Bachelor’s & Master’s degrees
  • MasterTrack™ Earn credit towards a Master’s degree
  • University Certificates Advance your career with graduate-level learning
  • Top Courses
  • Join for Free

Duke University

Java Programming: Solving Problems with Software

This course is part of multiple programs. Learn more

This course is part of multiple programs

Taught in English

Some content may not be translated

Owen Astrachan

Instructors: Owen Astrachan +3 more


Instructor ratings

We asked all learners to give feedback on our instructors based on the quality of their teaching style.

Susan H. Rodger

Financial aid available

371,004 already enrolled

Coursera Plus

(7,833 reviews)

Skills you'll gain

  • Problem Solving
  • String (Computer Science)
  • Java Programming

Details to know

solving problems for programming

Add to your LinkedIn profile

See how employees at top companies are mastering in-demand skills


Build your subject-matter expertise

  • Learn new concepts from industry experts
  • Gain a foundational understanding of a subject or tool
  • Develop job-relevant skills with hands-on projects
  • Earn a shareable career certificate


Earn a career certificate

Add this credential to your LinkedIn profile, resume, or CV

Share it on social media and in your performance review


There are 5 modules in this course

Learn to code in Java and improve your programming and problem-solving skills. You will learn to design algorithms as well as develop and debug programs. Using custom open-source classes, you will write programs that access and transform images, websites, and other types of data. At the end of the course you will build a program that determines the popularity of different baby names in the US over time by analyzing comma separated value (CSV) files.

After completing this course you will be able to: 1. Edit, compile, and run a Java program; 2. Use conditionals and loops in a Java program; 3. Use Java API documentation in writing programs. 4. Debug a Java program using the scientific method; 5. Write a Java method to solve a specific problem; 6. Develop a set of test cases as part of developing a program; 7. Create a class with multiple methods that work together to solve a problem; and 8. Use divide-and-conquer design techniques for a program that uses multiple methods.

Introduction to the Course

Welcome to “Java Programming: Solving Problems with Software”! We are excited that you are starting our course to learn how to write programs in Java, one of the most popular programming languages in the world. In this introductory module, you will get to meet the instructor team from Duke University and have an overview of the course. Have fun!

What's included

5 videos 1 reading

5 videos • Total 12 minutes

  • Introduction to the Course • 2 minutes • Preview module
  • Resources to Help You Succeed • 1 minute
  • Tips for Learning Programming • 1 minute
  • Using Forums: How to Ask for Help Effectively • 3 minutes
  • Object Oriented Programming with Java Specialization • 2 minutes

1 reading • Total 10 minutes

  • Programming Resources • 10 minutes

Fundamental Java Syntax and Semantics

In this module, you will learn to write and run your first Java programs, including one program that prints “Hello!” in various countries’ languages and another where you will analyze the perimeters and other information of shapes. To accomplish these tasks, you will learn the basics of Java syntax and how to design stepwise solutions with programs. By the end of this module, you will be able to: (1) Download and run BlueJ, the Java programming environment for this course; (2) Access the documentation for the Java libraries specially designed for this course; (3) Edit, compile, and run a Java program; (4) Construct methods, variables, if else statements, and for each loops in Java; and (5) Use Iterables (like DirectoryResource) to run a program that iterates over multiples lines in a document or webpage or multiple files in a directory.

17 videos 8 readings 5 quizzes

17 videos • Total 76 minutes

  • Why Use Java? • 1 minute • Preview module
  • Using BlueJ to Program in Java • 6 minutes
  • Shapes: Collections of Points • 2 minutes
  • Why Semantics: Motivation to Read Code • 1 minute
  • Variables • 2 minutes
  • Mathematical Operators • 2 minutes
  • Functions • 4 minutes
  • Conditionals • 3 minutes
  • Classes • 4 minutes
  • New • 4 minutes
  • Methods • 5 minutes
  • Types • 5 minutes
  • For Each Loops • 7 minutes
  • Solving Programming: A Seven Step Approach • 6 minutes
  • Seven Steps in Action: Developing an Algorithm • 7 minutes
  • Seven Steps in Action: Testing the Algorithm • 4 minutes
  • Seven Steps in Action: Translating to Code • 5 minutes

8 readings • Total 201 minutes

  • Module Learning Outcomes • 10 minutes
  • Download BlueJ and Open Your First BlueJ Project • 10 minutes
  • Let's learn some basic Java syntax! • 1 minute
  • A Brief Note on Documentation • 10 minutes
  • Perimeter Assignment Introduction/Code Review • 45 minutes
  • Perimeter Assignment: Part One • 50 minutes
  • Perimeter Assignment: Part Two • 30 minutes
  • Perimeter Assignment: Part Three • 45 minutes

5 quizzes • Total 95 minutes

  • Getting Started with BlueJ • 10 minutes
  • Variables and Mathematical Operators • 10 minutes
  • Functions and Conditionals • 15 minutes
  • Classes, Types, and For Each Loops • 30 minutes
  • Calculating the Perimeter of a Shape • 30 minutes

Strings in Java

This module begins with a short presentation from Raluca Gordân, an assistant professor in Duke University’s Center for Genomic and Computational Biology, about an important problem genomics scientists encounter regularly: how to identify genes in a strand of DNA. To tackle this problem, you will need to understand strings: series of characters such as letters, digits, punctuation, etc. After learning about Java methods that work with strings, you will be able to find genes within a DNA string as well as tackle other string related problems, such as finding all of the links in a web page. By the end of this module, you will be able to: (1) Use important methods for the Java String class; (2) Use conditionals, for loops, and while loops appropriately in a Java program; (3) Find patterns in the data represented by strings to help develop the algorithm for your program; (4) Understand the importance of designing programs that keep different data processing steps separate; (5) Use the StorageResource iterable for this course to store some data for further processing; and (6) Rely on Java documentation to better understand how to use different Java packages and classes.

21 videos 3 readings 6 quizzes 1 discussion prompt

21 videos • Total 121 minutes

  • What is a String • 2 minutes • Preview module
  • Understanding Strings • 3 minutes
  • Developing an Algorithm • 5 minutes
  • Positions in Strings • 8 minutes
  • Translating into Code • 11 minutes
  • Java Math • 8 minutes
  • Introduction • 0 minutes
  • Conceptual Understanding • 4 minutes
  • While Loops • 9 minutes
  • While Loop Syntax and Semantics • 3 minutes
  • Coding While Loops • 6 minutes
  • Three Stop Codons • 5 minutes
  • Coding Three Stop Codons - Part I • 7 minutes
  • Coding Three Stop Codons - Part II • 4 minutes
  • Logical And / Or • 8 minutes
  • Coding And / Or • 6 minutes
  • Finding Multiple Genes • 5 minutes
  • Translating to Code • 8 minutes
  • Separation of Concerns • 5 minutes
  • StorageResource Class • 3 minutes
  • Coding StorageResource Class • 4 minutes

3 readings • Total 30 minutes

  • Programming Exercise: Finding a Gene and Web Links • 10 minutes
  • Programming Exercise: Finding Many Genes • 10 minutes
  • Programming Exercise: Storing All Genes • 10 minutes

6 quizzes • Total 180 minutes

  • Finding a Gene in DNA • 30 minutes
  • Finding All Genes in DNA • 30 minutes
  • Debugging: Part 1 • 30 minutes
  • Debugging: Part 2 • 30 minutes
  • Using StorageResource • 30 minutes
  • Strings in Java • 30 minutes

1 discussion prompt • Total 10 minutes

  • Debugging First Steps • 10 minutes

CSV Files and Basic Statistics in Java

A common format for storing tabular data (any data organized into columns and rows) is in comma separated values (CSV) files. In this module, you will learn how to analyze and manipulate data from multiple CSV data files using a powerful open-source software package: Apache Commons CSV. Using this library will empower you to solve problems that could prove too complex to solve with a spreadsheet. By the end of this module, you will be able to: (1) Use the open-source Apache Commons CSV package in your own Java programs; (2) Access data from one or many CSV files using Java; (3) Convert strings into numbers; (4) Understand how to use “null” in Java programs (when you want to represent “nothing”); (5) Devise an algorithm (and implement in Java) to answer questions about CSV data; and (6) Analyze CSV data across multiple CSV files (for example, find maximums, minimums, averages, and other simple statistical results).

14 videos 3 readings 3 quizzes

14 videos • Total 55 minutes

  • CSV Data: Comma Separated Values • 2 minutes • Preview module
  • Using CSV Libraries • 7 minutes
  • Which Countries Export...? Developing an Algorithm • 4 minutes
  • Which Countries Export...? Translating into Code • 5 minutes
  • CSVExport: Summary • 0 minutes
  • Hottest Day in a Year: Comma Separated Values • 2 minutes
  • Converting Strings to Numbers • 4 minutes
  • Maximum Temperature: Developing an Algorithm • 5 minutes
  • Java for Nothing—null: When You Don't Have an Object • 4 minutes
  • Maximum Temperature: Translating into Code • 4 minutes
  • Maximum Temperature: Testing Code • 3 minutes
  • Maximum Temperature from Multiple Datasets • 5 minutes
  • Maximum Temperature Refactored • 4 minutes
  • CSVMax: Summary • 0 minutes
  • Programming Exercise: Parsing Export Data • 10 minutes
  • Programming Exercise: Parsing Weather Data • 10 minutes

3 quizzes • Total 90 minutes

  • Which Countries Export...? • 30 minutes
  • Weather Data • 30 minutes
  • CSV Files and Basic Statistics in Java • 30 minutes

MiniProject: Baby Names

This module wraps up the course with a mini project that ties together the different practices, skills, and libraries you have gained across the course! Using data on the popularity of different baby names in the United States from the past several decades, you will be able to compare different names’ popularity over time. While the data we have collected for this course is from the United States, we welcome you to share data from other countries in the course discussion forums. Good luck with the mini project!

9 videos 3 readings 2 quizzes

9 videos • Total 47 minutes

  • Baby Names MiniProject: Overview • 4 minutes • Preview module
  • Baby Names MiniProject: Data Overview • 6 minutes
  • Baby Names MiniProject: Total Births • 7 minutes
  • Batch Grayscale: Converting Many Files • 2 minutes
  • Grayscale Algorithm: Seven Step Approach • 4 minutes
  • Image Iterable in BlueJ: Grayscale • 5 minutes
  • Batch Processing Grayscale • 3 minutes
  • Saving Images with New Names • 11 minutes
  • Batch Grayscale Summary: Converting Many Files • 1 minute
  • MiniProject Exercise Guide • 10 minutes
  • Extend Your Program • 10 minutes
  • Programming Exercise: Batch Grayscale and Image Inversion • 10 minutes

2 quizzes • Total 60 minutes

  • Baby Names • 30 minutes
  • Batch Grayscale Images • 30 minutes

solving problems for programming

Duke University has about 13,000 undergraduate and graduate students and a world-class faculty helping to expand the frontiers of knowledge. The university has a strong commitment to applying knowledge in service to society, both near its North Carolina campus and around the world.

Recommended if you're interested in Software Development

solving problems for programming

Duke University

Java Programming: Arrays, Lists, and Structured Data

solving problems for programming

University of California San Diego

Data Structures and Performance

solving problems for programming

Java Programming: Principles of Software Design

solving problems for programming

Object Oriented Programming in Java

Why people choose coursera for their career.

solving problems for programming

Learner reviews

Showing 3 of 7833

7,833 reviews

Reviewed on Feb 26, 2019

A basic practice approach for solving problems with a 7step formula for any kind of problem set, for any kind of programming language you use. A very basic approach to JAVA syntax and semantics.

Reviewed on May 19, 2019

Really practical course content with great tutorials. The programming assignments are fun and challenging and deal with real world data and problems which makes the course all the more useful!

Reviewed on Feb 8, 2019

Excellent course as the Instructors teach building algorithm and then coding it line by line. I highly recommend taking this course as it helps you moving one step ahead in learning Java.

New to Software Development? Start here.


Open new doors with Coursera Plus

Unlimited access to 7,000+ world-class courses, hands-on projects, and job-ready certificate programs - all included in your subscription

Advance your career with an online degree

Earn a degree from world-class universities - 100% online

Join over 3,400 global companies that choose Coursera for Business

Upskill your employees to excel in the digital economy

Frequently asked questions

Will i receive a transcript from duke university for completing this course.

No. Completion of a Coursera course does not earn you academic credit from Duke; therefore, Duke is not able to provide you with a university transcript. However, your electronic Certificate will be added to your Accomplishments page - from there, you can print your Certificate or add it to your LinkedIn profile.

When will I have access to the lectures and assignments?

Access to lectures and assignments depends on your type of enrollment. If you take a course in audit mode, you will be able to see most course materials for free. To access graded assignments and to earn a Certificate, you will need to purchase the Certificate experience, during or after your audit. If you don't see the audit option:

The course may not offer an audit option. You can try a Free Trial instead, or apply for Financial Aid.

The course may offer 'Full Course, No Certificate' instead. This option lets you see all course materials, submit required assessments, and get a final grade. This also means that you will not be able to purchase a Certificate experience.

What will I get if I subscribe to this Specialization?

When you enroll in the course, you get access to all of the courses in the Specialization, and you earn a certificate when you complete the work. Your electronic Certificate will be added to your Accomplishments page - from there, you can print your Certificate or add it to your LinkedIn profile. If you only want to read and view the course content, you can audit the course for free.

What is the refund policy?

If you subscribed, you get a 7-day free trial during which you can cancel at no penalty. After that, we don’t give refunds, but you can cancel your subscription at any time. See our full refund policy Opens in a new tab .

Is financial aid available?

Yes. In select learning programs, you can apply for financial aid or a scholarship if you can’t afford the enrollment fee. If fin aid or scholarship is available for your learning program selection, you’ll find a link to apply on the description page.

More questions

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 a common programming exercise: Fizz Buzz, explained in this wiki article .

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

This section contains questions for you to check your understanding of this lesson on your own. If you’re having trouble answering a question, click it and review the material it links to.

  • 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 other 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.

Welcome to Java! Easy Max Score: 3 Success Rate: 97.06%

Java stdin and stdout i easy java (basic) max score: 5 success rate: 96.93%, java if-else easy java (basic) max score: 10 success rate: 91.30%, java stdin and stdout ii easy java (basic) max score: 10 success rate: 92.58%, java output formatting easy java (basic) max score: 10 success rate: 96.58%, java loops i easy java (basic) max score: 10 success rate: 97.69%, java loops ii easy java (basic) max score: 10 success rate: 97.33%, java datatypes easy java (basic) max score: 10 success rate: 93.67%, java end-of-file easy java (basic) max score: 10 success rate: 97.92%, java static initializer block easy java (basic) max score: 10 success rate: 96.17%.

DEV Community

DEV Community

Christopher Glikpo

Posted on Jul 27, 2021

5 Steps to Solving Programming Problems

We solve issues all the time as people, and developers are no different. Problem-solving-focused classes aren't particularly popular or frequent, and many developers prefer to study tools, languages, and frameworks over learning how to think like a problem solver or a programmer.

Problem solving is a programmer's bread and butter, and while everyone has their own technique, I've discovered five methods that will most certainly help you not only solve issues faster and more efficiently.

What is Problem Solving?

Problem-solving can mean different things for different people or situations so it is good to clarify what this article means when “problem-solving” is mentioned.

When you bring your broken automobile to the shop, they may decide to fix what's broken, replace the broken part, or offer you the option of purchasing a new car. Even though all of these alternatives appear to be “solutions,” only the first one truly addresses the issue. Everything else is an attempt to avoid dealing with the issue.

You solve a problem when given a set of constraints and having to follow some rules you come up with a solution that meets all the constraints and does not break the rules. As programmers, we write a program, a set of instructions that solves the problem.

To Code is different than To Solve Problem

Anyone who invests the effort to learn how to code will eventually be able to program. It's similar to learning a new language to learn to code. It is the ability to provide instructions for a computer to follow using a language that can be understood or compiled by a computer.

Problem-solving is a separate skill set, and we are inherently adept at it as humans. I mean, by solving problem after problem, we constructed the world around us. Connecting these two skill sets is something that many developers struggle with. Solving programming issues improves your ability to solve real-world problems, and if you're excellent at them, programming may come easy to you.

1. Read the problem several times until you can explain it to someone else


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. Manually solve the problem 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, here are some sample data sets to use:

When you are first starting out, it is easy to gloss over the steps.

Because your brain is already accustomed with even numbers, you may easily glance at a sample set of data and pluck out numbers like 2 , 4 , 6 , and so on in the array without realizing it. If you're having trouble, consider using massive quantities of data, which will overcome your brain's natural ability to answer the problem simply 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] 1.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.

1.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: 1.Show it is true for n = 1, n = 2, ...

2.Suppose it is true for n = k

3.Prove it is true for n = k + 1

4.Write pseudocode

Even once you've figured out the main processes, developing pseudocode that you can translate into code can help you define your code's structure and make coding a lot easier. Line by line, write pseudocode. You may do this on paper or in your code editor as comments. I recommend doing it on paper if you're just starting off and find blank displays intimidating or distracting.

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.

Let's think about the steps needed to write a function that returns a number's squared value.

Now we know exactly what our code is supposed to do, we have one more step.

5. Translate pseudocode into code

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. Lets use our square example (very simple for demonstration purposes):

Optimize your code:

If you've reached this point, thank you very much. I hope that this tutorial has been helpful for you and I'll see you all in the next.

Buy me a coffee

If you want to learn more about Web Development don't forget to follow me on Youtube!

Top comments (0)


Templates let you quickly answer FAQs or store snippets for re-use.

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink .

Hide child comments as well

For further actions, you may consider blocking this person and/or reporting abuse

mathewthe2 profile image

Resolving next-auth "redirect" error when used with Supabase

Mathew Chan - Feb 5

manthanank profile image

Building an OTP Verification System with Node.js and MongoDB

Manthan Ankolekar - Feb 14

devleader profile image

WebApplicationFactory In ASP.NET Core: Practical Tips For C# Developers

Dev Leader - Feb 13

ashok83 profile image

The Race Is On: How AI Is Transforming Business Processes in 2024 & Beyond

Ashok Sharma - Jan 31

Once suspended, cglikpo will not be able to comment or publish posts until their suspension is removed.

Once unsuspended, cglikpo will be able to comment and publish posts again.

Once unpublished, all posts by cglikpo will become hidden and only accessible to themselves.

If cglikpo is not suspended, they can still re-publish their posts from their dashboard.

Once unpublished, this post will become invisible to the public and only accessible to Christopher Glikpo.

They can still re-publish the post if they are not suspended.

Thanks for keeping DEV Community safe. Here is what you can do to flag cglikpo:

cglikpo consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy.

Unflagging cglikpo will restore default visibility to their posts.

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

  • All Articles
  • Let's Connect
  • Fundamentals
  • Soft Skills
  • Side Projects

A Guide to Problem-Solving for Software Developers with Examples

If I ask you, out of the blue, what’s the role of a developer, what would you answer? Coding all day? Drinking coffee? Complaining about the management?

To me, a developer is first and foremost a problem solver, simply because solving problem is the most important (and the most difficult) part of our job. After all, even if our code is perfect, clear, performing great, a masterpiece of form and meaning, it’s useless if it doesn’t solve the problem it was meant to solve.

So, let’s dive into problem-solving today. More specifically, we’ll see in this article:

  • How to define a problem, and the difference sometimes made between problem-solving and decision-making.
  • Why some problems should not be solved.
  • The two wide categories of problems you can encounter.
  • Why it’s important to correctly define the problem, and how to do so.
  • How to explore the solution space.
  • Why deferring a problem might be the best decision to make in specific situations.
  • Why reflecting on the whole process afterward can help you in the future.

This article is mostly based on my own experience, even if I apply here some ideas I found in books and papers.

We have our plan. Now, it’s time to dive deep into the difficult, but rewarding, process of problem-solving.

Problem-Solving and Decision-Making

“When I use a word,” Humpty Dumpty said in rather a scornful tone, “it means just what I choose it to mean — neither more nor less.” “The question is,” said Alice, “whether you can make words mean so many different things.” “The question is,” said Humpty Dumpty, “which is to be master — that’s all.” Lewis Caroll Source

Words are ambiguous; they can mean different things for each of us. So let’s first begin to agree on the definition of “problem-solving” here, to be sure we’re on the same page.

Let’s first look at the definition of the word “problem” in a dictionary:

  • According to the American Heritage Dictionary , a problem is “a question to be considered, solved, or answered”.
  • According to the Oxford Learner’s dictionary , a problem is “a thing that is difficult to deal with or to understand”.

In short, in any problem, there is some degree of uncertainty. If you’re certain of the solution, the problem is already solved. Nothing would need to be “considered, solved, or answered”.

Information is useful to reduce this uncertainty. The quantity is often not the most important, but the quality will be decisive. If I tell you that 90% of my readers are extremely intelligent, would it help you to solve a problem in your daily job? I bet it wouldn’t. It’s information nonetheless, but its usefulness for you is close to zero.

This is an extreme example, but it highlights an important point: before collecting any data, define your problem clearly; then, according to the problem, decide what data you need. Yet, many companies out there begin to collect the data and then decide what problem to solve. We’ll come back to that soon in this article.

So, to summarize, a problem is a situation with some degree of uncertainty. Sometimes, this uncertainty needs to be reduced to come up with an appropriate solution, or, at least, a decision to move forward to your specific goal.

Is there a Problem to Solve?

Whenever you (or somebody else) see a problem, you should always ask yourself this simple question first: is it really a problem, and should we solve it now ?

In other words, ask yourself the following questions:

  • Why is this problem important to solve?
  • Would be solving the problem creates some value? What value?
  • What would happen if the problem was not solved?
  • What desired outcome do we expect by solving the problem?

If the problem doesn’t bother anybody and solving it doesn’t create any value, why allocating effort and time to solve it?

It sounds obvious, but it’s an important point nonetheless. More often than not, I see developers heading first in solving problems without asking themselves if they should solve them at the first place.

The most common examples I can think of are useless refactoring. I saw developers refactoring parts of codebases which never change, or is rarely executed at runtime. In the mind of the developer, the code itself is the problem: refactoring is the solution.

I remember a similar case: a developer refactored part of the codebase which was basically never used. We discovered, months later, when we had more and more users using this specific part of the codebase, that the refactoring didn’t really simplify anything. To the contrary; we had to refactor the code again. The first refactoring tried to solve a problem which didn’t exists.

Of course, the developer could argue that the value created is a “cleaner” codebase, but it’s arguable, especially when the code is neither often modified nor used. The value created here is not clear, and it would have been easier if the first refactoring never happened. In this specific situation, I recommend refactoring when you actively change part of the codebase for another reason (implementing a new feature for example).

Whether a problem is worthy to be solved is subjective. It also depends on the problem: if the solution is clear and straightforward, it might be useful to solve it, if the consequences of the solution are also clearly known and the risks are low. Unfortunately, these kinds of problems, in practice, are quite rare.

Types of Problems

I would define here two wide categories of problems: the problems with a (or multiple) clear solution (what the literature call “problem-solving”), and the problems without clear solution (it’s sometimes called “decision-making” instead of “problem-solving”).

In fact, if the problem you’re trying to solve has a clear, accepted answer, it’s very likely it has been solved already. It’s often the case for mechanical, technical problems. For example, let’s say that you need to order a list; you just have to search on the wild Internet how to do so in your programming language of choice, and you’re done! You can ask an “AI” too, or stack overflow, or whatever.

In my experience, most technical problems have one (or multiple) accepted solution. I won’t speak about these kinds of problems at length in this article, since they’re the easiest to solve.

When you’re in front of a problem which has no clear solution (even after doing some research), it’s where things get more complicated. I’d argue that most problems you’ll face, as a software developer, are of this category. Problems which are directly linked to the domain of the company you work with are often specific (because they depend on the domain), and complex.

For example, I’m working for a company providing a learning platform for medical students who want to become doctors, among other services. This context is changing because the real world is changing; medicine is no exception.

Recently, we had to create new data structures for the knowledge we provide; these data structures are directly linked to the domain (medicine) here. But what data structures to create? How can they adapt to the ever-changing environment? How to capture the data in the most meaningful way, with understandable naming for other developers?

Decisions had to be made, and when there are no clear solutions, you need to come up with a couple of hypothesizes. They won’t feel necessary like solutions , but rather decisions to take to move forward toward the desired outcome. It often ends up in compromises, especially if you’re working in a team where the members have different opinions .

Also, architectural decisions have often no clear solutions because they depend, again, on the changing context. How to be sure that an architectural decision is good today and in three months? How can we make the architecture flexible enough to adapt to the blurry future?

As developers, we deal with complex codebases, which are somewhat linked to the even more complex real world. It’s difficult to know beforehand the consequences of our decisions, as well as the benefits, the drawback, and the potential bugs we introduce.

Before jumping into the solution space however, we first need a good detour in the problem space.

Defining the Problem

Correctly stating the problem.

After determining that we indeed have some kind of problem, it’s tempting to try to find a solution directly. Be patient: it’s better to look at the problem more closely first.

If you don’t specify well the problem, you might not solve it entirely. It’s also possible that you end up solving the wrong problem, or the symptoms of a problem, that is, other minor problems created by a root problem. Often, the ideal scenario is to find the root problem, even if you don’t want to tackle it first. In any case, it’s always useful information.

For example, not long ago, our users didn’t find the content they were searching for, using our search functionality on our learning platform.

We could have directly solved the problem by asking the search team to adjust that for us, but this problem was only a symptom. It wasn’t the first time that we had to spend time and energy trying to communicate to the search team what we wanted to fix; the real root problem here was that we didn’t have any ownership of our search results.

The solution: we created a better API communicating with the search team, to be able to adjust ourselves the search results in a more flexible manner.

When looking at a problem, a good first step is to write it down. Don’t do it once; try to find different formulations for the same problem.

Writing is nice (I love it!), but other ways to represent ideas can be really useful too. You can try to draw what you understand from the problem: a drawing, a diagram, or even a picture can help you understand the problem.

From there, you can ask yourself: do you have enough information to take a decision? The answer will be mostly based on the experience of the problem solver, there is no magical formula to be sure that you can and will solve the problem.

You should also try to look at the problem from different angles, to really frame it correctly. The best way to do so is to solve problems as a team.

Solving Problems in a Team

Trying to describe and think about a problem is a great beginning, but it’s even better if you do it as a team. You can exchange experience, opinions, and it’s easier to look at a problem from multiple angles when multiple developers are involved.

First, make sure that everybody in the team is aware of the problem. Defining it altogether is the best. If you have a doubt that somebody is not on the same page, you can re-explain it using different words. It might bring more insights and ideas to the discussion.

Don’t assume that everybody understands the problem equally. Words are powerful, but they are also ambiguous; never hesitate to ask questions (even if they seem stupid at first), and encourage the team to do the same. If your colleagues see that you’re not afraid to ask, it will give them confidence to do the same.

The ambiguity can also build overtime, after the problem was discussed. That’s why it’s really important to document the whole process, for anybody to be able to look at it again and fix the possible creeping misconceptions. Don’t try to describe everything, but try to be specific enough. It’s a delicate balance, and you’ll get better at it with experience.

If you don’t like writing, I’d recommend you to try anyway: this is a powerful skill which will be useful in many areas of your life.

Regarding the team of problem solvers, diversity is important. Diversity of opinion, experience, background, you name it. The more diverse the opinions and ideas are, the more chances you’ll have to solve the problem satisfyingly (more on that later). If the members of the team have enough respect, humility, and know how to listen to their colleagues , you’re in the perfect environment to solve problems.

As developers, we’re dealing with moving systems, because they need to reflect the ever-changing business domain of the company you’re working with. These problems are unique, and even if similar problems might have been solved in the past, they’re never the exactly same. The differences can have an impact on the solution, sometimes insignificant (allowing you to re-apply the solution found previously), sometimes important enough to change the solution entirely.

Exploring the Solution Space

Now that we’ve defined the problem, thought about it with our team, tried to look at it from different angles, it’s time to try to find solutions, or at least to make a decision.

What is a good decision? The one which will bring you closer to your desired outcome. It sounds obvious, but there can be some ego involved in discussions, which will push us to try to be right even if it’s not the best solution in the current context. Our personal incentives can conflict with the company’s best interest; it’s always good to try to stay aware of that.

The solution should also be the simplest possible, while still moving forward to the desired outcome. It should also have an acceptable level of risk when we decide to apply the solution. In my experience, complicated solutions are the ones which come up first: don’t stop there. Take some time trying to find the best solution with your team.

For example, here’s what we do with my actual team:

  • We define the problem altogether.
  • We try to think about different hypothesizes. Not only one, but a couple of them.
  • We write the benefits and drawbacks of each hypothesis (which can lead to more ideas, and possibly more hypothesizes).
  • We commit to a hypothesis, which then needs to be implemented.

What I meant by “hypothesis” here is a solution which might work; but only the implementation of the hypothesis can be considered as a solution. Before the implementation, it’s just an informed guess. Many things can go wrong during an implementation.

This process looks simple, but when you have multiple developers involved, it’s not. Again, if each member of the team have good soft skills and some experience, it can be an enjoyable and rewarding process. But you need a good team for it to work efficiently (that’s why it’s so important to ask the good questions when joining a company). It’s even better if the members of the team are used to swim in uncertainty, and take it as a challenge more than a chore.

The process described above is just an example; in practice it’s often more chaotic. For example, even when a decision is made, your brain might still continue to process the problem passively. If you find some flaws in the hypothesis you’ve committed to, congratulations! You have now a brand-new problem.

I can’t emphasize it enough: try to be as detached as possible from your ideas, opinions, and preferred hypothesizes. The goal is not for you to be right and feel good, but for your company to move in the good direction. It’s hard, but with practice it gets easier.

I also want to underline the importance of finding both benefits and drawbacks for the different hypothesizes you (and your team) came up with.

To find good solutions, we might also need to reduce the uncertainty around their possible consequences. Doing some external research can help, like gathering data around the problem and the possible hypothesizes. In the best case scenario, if you can find enough data, and if you feel confident that you can move forward with a hypothesis, that’s already a great victory.

If you don’t have enough external information to reduce the uncertainty to a level you feel comfortable with, look at your past experience. Try to find problems similar to the one your deal with in the present, and try to think about the solutions applied at the time, to see if they could also be applied in your current case. But be careful with this approach: complex problems are context-sensitive, and the context you were in the past will never be exactly the same as the present and future contexts.

For example, I recently changed the way we display search results in our system, because we had some data indicating that some users had difficulties to find what they really wanted to find. The problem: users have difficulties to find the good information; it’s a recurrent problem which might never be 100% solved. That said, thanks to the data gathered, we found an easy way to improve the situation.

The data was very clear and specific, but it’s not always the case. More often than not, your data won’t really prove anything. It might only show correlations without clear causality. It will be even more true if you begin by gathering data without defining first the problem you try to solve. You can find problems looking at some data, that’s true, but it needs care and deep understanding of what you’re doing; looking at data when you know exactly what you want to solve works better.

Using this kind of process, the hypothesis is often some sort of compromise. That’s fine; committing to a hypothesis is not the end of the process, and there will be other occasions to revisit and refine the solution.

If you don’t feel comfortable with the level of uncertainty of the problem (or the risk involved by applying your hypothesis), you need to dig more. Writing a prototype can be useful for example, if you hesitate between two or more approaches. If your prototype is convincing enough, it can also be useful to gather feedback from your users, even if the ones testing your hypothesis will always be more invested if they test a real-life functionality, instead of a prototype which might use dummy data, or be in a context which is too remote from the “real” context.

In my opinion, prototypes are not always useful for complex problems, because a prototype only test a new feature at time T, but doesn’t allow you to see if the solution stay flexible enough overtime. That’s often a big concern: how will the solution evolve?

But prototyping can still help gather information and reduce the uncertainty of the problem, even if the prototype doesn’t really give you the solution on a silver platter. It’s also great for A/B testing, when you’re in the (likely) case when you have not much information about the real needs of your users. You could ask them of course, but nothing guarantee that they know themselves what these needs are.

If you don’t find any satisfying hypothesis to your problem, you might also challenge the desired outcome. Maybe a similar, simplest hypothesis, with slightly different outcomes, could work better? If it makes things easier, faster, and less complex, it could be the best solution. Don’t hesitate to challenge your stakeholders directly on the desired outcomes.

Deferring the Problem

In some cases, you might be hesitant to try to solve a problem if there is still too much uncertainty around it. In that case, it might be best to defer solving the problem altogether.

Deferring the problem means that you don’t solve it now ; you keep things as they are, until you get more information to reduce the uncertainty enough.

We had a problem in the company I worked with some time ago: we have dosages which can be discovered in articles, but users didn’t really find them, and nobody really knew why. Because of this lack of information, the problem was not tackled right away, but differed. From there, data have been collected overtime, allowing us to understand the scope of the problem better.

Don’t forget that deferring a problem is already taking a decision. It might be the less disruptive decision for the application and its codebase, but it’s s decision nonetheless, and it can have consequences. Seeing a differed problem as a decision will push you to think about the possible consequences of your inaction, and you’ll look at it as a partial “solution”, with some uncertainty and risk associated to it.

In my experience, deferring the problem works well only when you try to actively seek more data to solve it later. It can be some monitoring to see how the problem evolves, or some data taken from users’ actions. Sometimes, simply waiting can also give you important information about the nature of the problem.

What you shouldn’t do is try to forget the problem. It might come back in force to haunt your sleepless nightmares later. Avoiding a problem is not deferring it.

Here’s another example: we began recently to build some CMS tooling for medical editors, for them to write and edit content on our learning platform. We had one GraphQL API endpoint at the beginning, providing data to two different part of the application:

  • Our CMS for medical editors.
  • Our learning platform for medical students.

We knew that using one single GraphQL endpoint for these two types of users could cause some problems.

But we didn’t do anything about it, mostly because we didn’t see any real, concrete problem, at least at first. When a minor symptom, related to this unique endpoint, popped up, we spoke about it, and we still chose not to do anything. We preferred deferring the problem once more, to try to solve the real problem (one API for two different kinds of applications) later.

Finally, when we had enough symptoms and some frustration, we decided to split our graphQL API in two different endpoints. It was the best moment to do so: we had enough information to come up with a good decision, we applied it, and we stayed vigilant, to see how our applied hypothesis would evolve.

Moving fast and breaking things is not always the best solution. In some situations, waiting a bit and see how things evolve can allow you to solve your problems in a more effective way. But, as always, it depends on the problem, its context, and so on.

Reading this article, you might have wondered: how much information is enough to be comfortable enough to apply a solution? Well, again, your experience will be the best judge here. You’ll also need to consider carefully risks, benefits, and drawbacks. It doesn’t mean that you need to chicken out if you don’t have 100% certainty about a problem and some hypothesizes; being a software developer implies to have some courage and accept that mistakes will be made. It’s not an easy task, and there is no general process to follow in any possible case.

In short: use your brain. Even if you’re totally wrong, you’ll have the opportunity to fix the bad decisions you’ve made before the implementation, during the implementation, and even after it. We don’t code in stone.

The Implementation: The Value of Iteration

You’ve gathered with your team, tried to define the problem, found multiple hypothesizes, and agreed to try one of them. Great! Problem solved.

Not so fast! We still need to apply the hypothesis, and hope that it will become a good solution to the problem. Doing so, you’ll gather more information along the way, which might change your perspective on the problem, on your hypothesizes, and can even create some baby problems on its own.

It’s where the agile methodology is useful: since we’ll never have 100% certainty regarding a problem and its possible solution, we’ll learn more about both while implementing the hypothesis. That’s why it’s so valuable to iterate on the implementation: it gives you more information to possibly adjust your code, or even the problem, or even switching hypothesizes altogether. Who knows? A solution which is not implemented is just a guess.

If the hypothesis applied is not the ones you would have personally preferred (compromising, or even giving up on your preferred solution is common in a team), only applying it will tell you if you’re right or wrong; that is, if the hypothesis can become a solution solving the problem, at least in the present context.

If you’re worried about how a specific solution will evolve overtime, it’s more complicated, because an implementation won’t give you the information you seek. Still, implementing a hypothesis can be a great source of learning (the most valuable to me is when I’m wrong, because I learn even more). If you think that your hypothesis can have better outcome at time T, you might also try to implement it and compare it. Again, it’s where prototyping is useful.

When applying the solution, you need to look at the details of the implementation, as well as the big picture, to judge if the solution you’re creating is appropriate (leading to the desired outcome). This is a difficult exercise. In general, a developer should be able to reason on different levels of abstraction, more or less at the same time. Again, if you’re aware of it, your experience will help you here, and you can also push yourself to think of all the possible risks and consequences at different levels.

If you work in a team, try to participate (at least a bit) into the implementation of the solution. It’s not good to create silos in teams (that is, only a couple of members have some information others don’t have).

You can go as far as looking at other projects, and ask yourselves these questions:

  • Did we had similar problems on these other projects? How did we solve them?
  • What was the context of these projects? Is it similar to our current context?
  • What did we learn from these other problems, and their implementation? Is the implementation similar to what we’re doing now?

In any case, I would definitely recommend you to write a development journal. I write mine for years, and it has been valuable in many cases. I basically write in there:

  • The interesting problems I had.
  • The decisions made.
  • How the implementation of the solution evolved overtime.
  • The possible mistakes we made along the way.

It’s a great resource when you have a problem and you want to look at your past experience.

To evaluate your decisions overtime, nothing will beat a good monitoring process: logs, tests, and so on. It’s what the book Building Evolutionary Architecture call “fitness functions” for example, some monitoring allowing you to measure how healthy your architecture stays overtime. It doesn’t have to stop to the architecture; you can think about different monitoring system to see how something evolve, especially if the solution has still a lot of uncertainty regarding its benefits, drawbacks, and risks.

You can also do that retrospectively: looking at how the code complexity evolve overtime using Git for example.

Retrospective on the Process

We defined the problem, implemented a solution iteratively, and now the problem is gone. That’s it! We made it! Are we done now?

Decisions are sometimes not optimal, and implementing a solution successfully doesn’t mean that there wasn’t a better (simpler) one to begin with. That’s why it can be beneficial to look back and understand what went right, and what went wrong. For example, we can ask ourselves these questions:

  • Looking at what we learned during the whole process, is there a potentially better hypothesis to solve the problem in a simpler, more robust way?
  • What are the benefits and drawbacks we missed when speaking about the different hypothesizes, but we discovered during the implementation? Why we didn’t think about them beforehand?
  • What other problems did we encounter during the implementation? Did we solve them? Did we differ some? What should be the next steps regarding these new problems?
  • What kind of monitoring did we put in place to make sure that the solution won’t have undesired outcomes overtime? Can we learn something with this data?

Reflecting on past solutions is a difficult thing to do. There is no way to logically assess that the decision taken was better than others, since we didn’t implement the other hypothesizes, and we didn’t look at them overtime to appreciate their consequences. But you can still look at the implementation of the solution overtime, and write in your developer journal each time there is a bug which seems directly related to the solution. Would the bugs be the same if another solution would had been applied?

Bugs are often not an option; they will pop up, eventually. Nonetheless, it’s important to make sure that you can fix them in a reasonable amount of time, and that you don’t see them creeping back in the codebase after being solved. Some metrics, from the DevOps movement (like MTTR for example) can help here. Sometimes, bugs will show you a better, more refined solution to the original problem; after all, bugs can also give you some useful information. They are also the most direct result of the implementation of your solution.

If you want to know more about measuring complexity (which can be also used to measure complexity overtime after applying a solution), I wrote a couple of articles on the subject .

Humility in Problem-Solving

It’s time to do a little summary. What did we see in this article?

  • We need to ensure that the problem we found is really a problem we need to solve. Is there any value to solve the problem? Is it even a problem?
  • Try to determine what kind of problem you have: a problem which can have multiple, specific, known answers (like a technical problem), or a problem which depends on the real-life context, without known solutions?
  • Defining the problem is important. Try to define it using different words. Write these definitions down. Does everybody in your team understand the problem equally?
  • It’s time to explore the solution space. Draft a couple of hypothesizes, their benefits, drawbacks, and risks. You can also do some prototyping if you think it would give you more information to take the best decision.
  • Do you have enough information to implement a hypothesis, becoming effectively a solution? If it’s not the case, it might be better to keep the status quo and try to solve the problem later, when you’ll have more information. But don’t forget the problem!
  • If you decide to implement a solution, do it step by step, especially if you’re unsure about the consequences of your decisions. Implement an independent part of the hypothesis, look at the consequences, adjust if necessary, and re-iterate.
  • When the solution is implemented, it’s time to reflect on the whole process: did we solve the problem? What other problems did we encounter? Maybe another solution would have been better? Why?

As I was writing above, most problems you’ll encounter will be complex ones, embedded into a changing environment with different moving parts. As a result, it’s difficult to train to solve problems in a vacuum; the only good training I know is solving real life problems. That’s why your experience is so important.

Experience build your intuition, which in turn increase your expertise.

You’ll never have 100% certainty that a solution will bring you the desired outcome, especially if you are in front of a complex problem with a blurry context. If you are absolutely convinced that you have the good solution without even beginning to implement it, I’d advise you to stay humber in front of the Gods of Complexity, or they will show you how little you know.

  • How to solve it
  • Hammock Driven Development
  • When Deferring Decisions Leads to Better Codebases
  • Lean Development - deferring decision

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, an ultimate guide that helps you to develop and improve problem solving in programming.

Lesson 27 of 33 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.

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.

Simple Programming Problems

Whenever I’m TA for a introductory CS class where students learn some programming language, I have trouble coming up with good exercises. Problems from Project Euler and the like are usually much too difficult for beginners, especially if they don’t have a strong background in mathematics.

This page is a collection of progressively more difficult exercises that are suitable for people who just started learning. It will be extended as I come up with new exercises. Except for the GUI questions, exercises are generally algorithmic and should be solvable without learning any libraries. The difficulty of the exercises of course somewhat depends on the programming language you use. The List exercises for example are more complicated in languages like C that don’t have build-in support for lists.

I suppose they are also useful, although much easier, whenever an experienced person wants to learn a new language.

This guide has been translated to Chinese by yifeitao Simple Programming Problems in Chinese

Before you begin

Learning to program means learning how to solve problems using code. Conceptually it is not very difficult to write a program that solves a problem that you can solve yourself. The skill you need to acquire is thinking very precisely about how you solve the problem and breaking it down into steps that are so simple that a computer can execute them. I encourage you to first solve a few instances of a problem by hand and think about what you did to find the solution. For example if the task is sorting lists, sort some short lists yourself. A reasonable method would be to find the smallest element, write it down and cross it out of the original list and repeat this process until you have sorted the whole list. Then you have to teach the computer 1) how to find the smallest element, 2) how to write it down, 3) how to cross it out, and wrap this in a loop. Then continue this task breakdown process until you’re confident you know how to write the necessary program.

To make good progress in your programming task, you need to test your work as early and as thoroughly as possible. Everybody makes mistakes while programming and finding mistakes in programs consumes a very large part of a programmer’s work-day. Finding a problem in a small and easy piece of code is much simpler than trying to spot it in a large program. This is why you should try to test each sub task you identified during your task-breakdown by itself. Only after you’re confident that each part works as you expect you can attempt to plug them together. Make sure you test the complete program as well, errors can creep in in the way the different parts interact. You should try to automate your tests. The easier it is to test your program, the freer you are in experimenting with changes.

The last important point is how you express your thoughts as code. In the same way that you can express the same argument in different ways in a normal English essay, you can express the same problem-solving method in different ways in code. Try for brevity. The lines that you don’t write are the lines where you can be sure that the don’t have bugs. Don’t be afraid to Google for idiomatic ways of doing the things you’d like to do (after you tried doing them yourself!). Remember that you don’t write the program for the computer, you write it for other humans (maybe a future you!). Choose names that explain things, add comments where these names don’t suffice. Never comment on what the code is doing, only write comments that explain why .

This is a bad example:

The exact same idea is much easier to understand if you write it like this:

Better naming and a better task breakdown make the comments obsolete. Revise your code just as you would revise an essay. Sketch, write, delete, reformulate, ask others what they think. Repeat until only the crispest possible expression of your idea remains. Revisit code you’ve written a while ago to see whether you can improve it with things you’ve learned since.

  • Write a program that prints ‘Hello World’ to the screen.
  • Write a program that asks the user for their name and greets them with their name.
  • Modify the previous program such that only the users Alice and Bob are greeted with their names.
  • Write a program that asks the user for a number n and prints the sum of the numbers 1 to n
  • Modify the previous program such that only multiples of three or five are considered in the sum, e.g. 3, 5, 6, 9, 10, 12, 15 for n =17
  • Write a program that asks the user for a number n and gives them the possibility to choose between computing the sum and computing the product of 1,…, n .
  • Write a program that prints a multiplication table for numbers up to 12.
  • Write a program that prints all prime numbers. (Note: if your programming language does not support arbitrary size numbers, printing all primes up to the largest number you can easily represent is fine too.)
  • Write a guessing game where the user has to guess a secret number. After every guess the program tells the user whether their number was too large or too small. At the end the number of tries needed should be printed. It counts only as one try if they input the same number multiple times consecutively.
  • Write a program that prints the next 20 leap years.
  • Write a program that computes the sum of an alternating series where each element of the series is an expression of the form ( ( − 1 ) k + 1 ) / ( 2 * k − 1 ) ((-1)^{k+1})/(2 * k-1) for each value of k k from 1 to a million, multiplied by 4. Or, in more mathematical notation

4 ⋅ ∑ k = 1 10 6 ( − 1 ) k + 1 2 k − 1 = 4 ⋅ ( 1 − 1 / 3 + 1 / 5 − 1 / 7 + 1 / 9 − 1 / 11 … ) . 4\cdot \sum_{k=1}^{10^6} \frac{(-1)^{k+1}}{2k-1} = 4\cdot(1-1/3+1/5-1/7+1/9-1/11\ldots).

Lists, Strings

If your language of choice doesn’t have a build in list and/or string type (e.g. you use C), these exercises should also be solvable for arrays. However, some solutions are very different between an array-based list (like C++’s vector ) and a pointer based list (like C++’s list ), at least if you care about the efficiency of your code. So you might want to either find a library, or investigate how to implement your own linked list if your language doesn’t have it.

  • Write a function that returns the largest element in a list.
  • Write function that reverses a list, preferably in place.
  • Write a function that checks whether an element occurs in a list.
  • Write a function that returns the elements on odd positions in a list.
  • Write a function that computes the running total of a list.
  • Write a function that tests whether a string is a palindrome.
  • Write three functions that compute the sum of the numbers in a list: using a for -loop, a while -loop and recursion. (Subject to availability of these constructs in your language of choice.)
  • Write a function on_all that applies a function to every element of a list. Use it to print the first twenty perfect squares. The perfect squares can be found by multiplying each natural number with itself. The first few perfect squares are 1*1= 1 , 2*2=4 , 3*3=9 , 4*4=16 . Twelve for example is not a perfect square because there is no natural number m so that m*m=12 . (This question is tricky if your programming language makes it difficult to pass functions as arguments.)
  • Write a function that concatenates two lists. [a,b,c] , [1,2,3] → [a,b,c,1,2,3]
  • Write a function that combines two lists by alternatingly taking elements, e.g. [a,b,c] , [1,2,3] → [a,1,b,2,c,3] .
  • Write a function that merges two sorted lists into a new sorted list. [1,4,6] , [2,3,5] → [1,2,3,4,5,6] . You can do this quicker than concatenating them followed by a sort.
  • Write a function that rotates a list by k elements. For example [1,2,3,4,5,6] rotated by two becomes [3,4,5,6,1,2] . Try solving this without creating a copy of the list. How many swap or move operations do you need?
  • Write a function that computes the list of the first 100 Fibonacci numbers. The first two Fibonacci numbers are 1 and 1. The n+1 -st Fibonacci number can be computed by adding the n -th and the n-1 -th Fibonacci number. The first few are therefore 1, 1, 1+1=2, 1+2=3, 2+3=5, 3+5=8.
  • Write a function that takes a number and returns a list of its digits. So for 2342 it should return [2,3,4,2] .
  • Write functions that add, subtract, and multiply two numbers in their digit-list representation (and return a new digit list). If you’re ambitious you can implement Karatsuba multiplication . Try different bases . What is the best base if you care about speed? If you couldn’t completely solve the prime number exercise above due to the lack of large numbers in your language, you can now use your own library for this task.
  • Write a function that takes a list of numbers, a starting base b1 and a target base b2 and interprets the list as a number in base b1 and converts it into a number in base b2 (in the form of a list-of-digits). So for example [2,1,0] in base 3 gets converted to base 10 as [2,1] .
  • Implement the following sorting algorithms: Selection sort, Insertion sort, Merge sort, Quick sort, Stooge Sort. Check Wikipedia for descriptions.
  • Implement binary search.

Write a function that takes a list of strings an prints them, one per line, in a rectangular frame. For example the list ["Hello", "World", "in", "a", "frame"] gets printed as:

Write function that translates a text to Pig Latin and back. English is translated to Pig Latin by taking the first letter of every word, moving it to the end of the word and adding ‘ay’. “The quick brown fox” becomes “Hetay uickqay rownbay oxfay”.


  • Write a program that outputs all possibilities to put + or - or nothing between the numbers 1,2,…,9 (in this order) such that the result is 100. For example 1 + 2 + 3 - 4 + 5 + 6 + 78 + 9 = 100.
  • Write a program that takes the duration of a year (in fractional days) for an imaginary planet as an input and produces a leap-year rule that minimizes the difference to the planet’s solar year.
  • Implement a data structure for graphs that allows modification (insertion, deletion). It should be possible to store values at edges and nodes. It might be easiest to use a dictionary of (node, edgelist) to do this.
  • Write a function that generates a DOT representation of a graph.
  • Using a sample text, create a directed (multi-)graph where the words of a text are nodes and there is a directed edge between u and v if u is followed by v in your sample text. Multiple occurrences lead to multiple edges.
  • Do a random walk on this graph: Starting from an arbitrary node choose a random successor. If no successor exists, choose another random node.
  • Write a program that automatically converts English text to Morse code and vice versa.
  • Write a program that finds the longest palindromic substring of a given string. Try to be as efficient as possible!
  • Think of a good interface for a list. What operations do you typically need? You might want to investigate the list interface in your language and in some other popular languages for inspiration.
  • Implement your list interface using a fixed chunk of memory, say an array of size 100. If the user wants to add more stuff to your list than fits in your memory you should produce some kind of error, for example you can throw an exception if your language supports that.
  • Improve your previous implementation such that an arbitrary number of elements can be stored in your list. You can for example allocate bigger and bigger chunks of memory as your list grows, copy the old elements over and release the old storage. You should probably also release this memory eventually if your list shrinks enough not to need it anymore. Think about how much bigger the new chunk of memory should be so that your performance won’t be killed by allocations. Increasing the size by 1 element for example is a bad idea.
  • If you chose your growth right in the previous problem, you typically won’t allocate very often. However, adding to a big list sometimes consumes considerable time. That might be problematic in some applications. Instead try allocating new chunks of memory for new items. So when your list is full and the user wants to add something, allocate a new chunk of 100 elements instead of copying all elements over to a new large chunk. Think about where to do the book-keeping about which chunks you have. Different book keeping strategies can quite dramatically change the performance characteristics of your list.
  • Implement a binary heap. Once using a list as the base data structure and once by implementing a pointer-linked binary tree. Use it for implementing heap-sort.
  • Implement an unbalanced binary search tree.
  • Implement a balanced binary search tree of your choice. I like (a,b)-trees best.
  • Compare the performance of insertion, deletion and search on your unbalanced search tree with your balanced search tree and a sorted list. Think about good input sequences. If you implemented an (a,b)-tree, think about good values of a and b.
  • Given two strings, write a program that efficiently finds the longest common subsequence.
  • Given an array with numbers, write a program that efficiently answers queries of the form: “Which is the nearest larger value for the number at position i ?”, where distance is the difference in array indices. For example in the array [1,4,3,2,5,7] , the nearest larger value for 4 is 5. After linear time preprocessing you should be able to answer queries in constant time.
  • Given two strings, write a program that outputs the shortest sequence of character insertions and deletions that turn one string into the other.
  • Write a function that multiplies two matrices together. Make it as efficient as you can and compare the performance to a polished linear algebra library for your language. You might want to read about Strassen’s algorithm and the effects CPU caches have. Try out different matrix layouts and see what happens.
  • Implement a van Emde Boas tree. Compare it with your previous search tree implementations.
  • Given a set of d-dimensional rectangular boxes, write a program that computes the volume of their union. Start with 2D and work your way up.
  • Write a program that displays a bouncing ball.
  • Write a Memory game.
  • Write a Tetris clone
  • Write a program that plays Hangman as good as possible. For example you can use a large dictionary like this and select the letter that excludes most words that are still possible solutions. Try to make the program as efficient as possible, i.e. don’t scan the whole dictionary in every turn.
  • Write a program that plays Rock, Paper, Scissors better than random against a human. Try to exploit that humans are very bad at generating random numbers.
  • Write a program that plays Battle Ship against human opponents. It takes coordinates as input and outputs whether that was a hit or not and its own shot’s coordinates.

Other Collections

Of course I’m not the first person to come up with the idea of having a list like this.

  • Several small problems Programming Practice
  • CPE 101 Projects
  • 99 Lisp Problems , 99 Haskell Problems . Most of these can also be done in other languages.
  • Rosetta Code Programming Tasks . These come with solutions in many languages!
  • Code Golf Challenges . The goal here is to solve the problem with as few characters as possible.
  • SPOJ Problems . This is a list of more than 13000 Problems!
  • Code Abbey According to Github user RodionGork, this is less mathy than Project Euler.

CC-BY-SA Adrian Neumann (PGP Key A0A8BC98 )


  • 90% Refund @Courses
  • Trending Now
  • Data Structures & Algorithms
  • Foundational Courses
  • Data Science
  • Practice Problem
  • Machine Learning
  • System Design
  • DevOps Tutorial
  • Web Development
  • Web Browser

Related Articles

  • DSA to Development
  • Program to check if a student passes/fails using his grade | Menu Driven
  • Most Famous Online IDE for Programming
  • Program to print first 10 even numbers
  • Program to print all two-digit numbers in descending order
  • Program to print first 10 perfect squares
  • Program to print all three digit numbers in ascending order
  • Learn Programming - How To Code
  • Write a program to convert Uppercase to LowerCase
  • Types of Operators in Programming
  • Program to print the name of month using the month number | Menu-Driven
  • Program to find the sum and difference of two numbers
  • Program to check if a person can vote using his age | Menu-Driven
  • Program to find the average of two numbers
  • Program to count the number of days between two years
  • Program to print all multiples of 7 till 1000
  • Program to convert given weeks to hours
  • Program to find diameter with the given radius of a circle.
  • Program to print numbers having remainder 3 when divided by 11
  • If-Then-___ Trio in Programming

Programming Tutorial | Introduction, Basic Concepts, Getting started, Problems

This comprehensive guide of Programming Tutorial or Coding Tutorial provides an introduction to programming, covering basic concepts, setting up your development environment, and common beginner problems. Learn about variables, data types, control flow statements, functions, and how to write your first code in various languages. Explore resources and tips to help you to begin your programming journey. We designed this Programming Tutorial or Coding Tutorial to empower beginners and equip them with the knowledge and resources they will need to get started with programming.

Programming Tutorial

Programming Tutorial

1. What is Programming?

Programming , also known as coding , is the process of creating a set of instructions that tell a computer how to perform a specific task. These instructions, called programs, are written in a language that the computer can understand and execute.

Table of Content

  • What is Programming?
  • Getting Started with Programming
  • Common Programming Mistakes and How to Avoid Them
  • Basic Programming EssentialsA Beginner’s Guide to Programming Fundamentals
  • Advanced Programming Concepts
  • Writing Your First Code
  • Top 20 Programs to get started with Coding/Programming
  • Next Steps after learning basic Coding/Programming
  • Resources and Further Learning
  • Frequently Asked Questions (FAQs) on Programming Tutorial

Think of programming as giving commands to a robot. You tell the robot what to do, step-by-step, and it follows your instructions precisely. Similarly, you tell the computer what to do through code, and it performs those tasks as instructed.

The purpose of programming is to solve problems and automate tasks. By creating programs, we can instruct computers to perform a wide range of activities, from simple calculations to complex tasks like managing databases and designing video games.

A. How Programming Works:

Programming involves several key steps:

  • Problem definition: Clearly define the problem you want to solve and what you want the program to achieve.
  • Algorithm design: Develop a step-by-step procedure for solving the problem.
  • Coding: Translate the algorithm into a programming language using a text editor or integrated development environment (IDE).
  • Testing and debugging: Run the program and identify and fix any errors.
  • Deployment: Share the program with others or use it for your own purposes.

B. Benefits of Learning to Code:

Learning to code offers numerous benefits, both personal and professional:

  • Develop critical thinking and problem-solving skills: Programming encourages logical thinking, problem decomposition, and finding creative solutions.
  • Boost your creativity and innovation: Coding empowers you to build your own tools and applications, turning ideas into reality.
  • Increase your employability: The demand for skilled programmers is high and growing across various industries.
  • Improve your communication and collaboration skills: Working with code often requires collaboration and clear communication.
  • Gain a deeper understanding of technology: Learning to code gives you a better understanding of how computers work and how they are used in the world around you.
  • Build self-confidence and motivation: Successfully completing programming projects can boost your confidence and motivate you to learn new things.

Whether you’re interested in pursuing a career in technology or simply want to expand your knowledge and skills, learning to code is a valuable investment in your future.

2. Getting Started with Programming Tutorial

A. choosing your first language.

Assess Resource Availability:

  • Free Online Resources: Platforms like Geeksforgeeks, Coursera, edX, and Udemy offer structured learning paths for various languages.
  • Paid Online Courses: Platforms like Geeksforgeeks, Coursera, edX, and Udemy offer structured learning paths for various languages.
  • Books and eBooks: Numerous beginner-friendly books and ebooks are available for most popular languages.
  • Community Support: Look for active online forums, communities, and Stack Overflow for troubleshooting and questions.

B. Which Programming Language should you choose as your First Language?

Here’s a breakdown of popular beginner-friendly languages with their Strengths and Weaknesses:

C. Setting Up Your Development Environment

Choose a Text Editor or IDE :

  • Text Editors: Sublime Text, Atom, Notepad++ (lightweight, good for beginners)
  • Offline IDEs: Visual Studio Code, PyCharm, IntelliJ IDEA (feature-rich, recommended for larger projects)
  • Online IDEs: GeeksforGeeks IDE

Install a Compiler or Interpreter:

  • Compilers: Convert code to machine language (C++, Java)
  • I nterpreters: Execute code line by line (Python, JavaScript)

Download Additional Software (if needed):

  • Web browsers (Chromium, Firefox) for web development
  • Android Studio or Xcode for mobile app development
  • Game engines (Unity, Unreal Engine) for game development

Test Your Environment:

  • Write a simple program (e.g., print “Hello, world!”)
  • Run the program and verify the output
  • Ensure everything is set up correctly
  • Start with a simple editor like Sublime Text for code basics.
  • Use an IDE like Visual Studio Code for larger projects with advanced features.
  • Join online communities or forums for help with setup issues.

3. Common Programming Mistakes and How to Avoid Them

  • Syntax errors: Typographical errors or incorrect grammar in your code.
  • Use syntax highlighting in your editor or IDE.
  • Logical errors: Errors in the logic of your program, causing it to produce the wrong results.
  • Carefully review your code and logic.
  • Test your program thoroughly with different inputs.
  • Use debugging tools to identify and fix issues.
  • Runtime errors: Errors that occur during program execution due to unforeseen circumstances.
  • Seek help from online communities or forums for specific errors.
  • Start with simple programs and gradually increase complexity.
  • Write clean and well-formatted code for better readability.
  • Use comments to explain your code and logic.
  • Practice regularly and don’t be afraid to experiment.
  • Seek help from online communities or mentors when stuck.

4. Basic Programming Essentials – A Beginner’s Guide to Programming Fundamentals:

This section delves deeper into fundamental programming concepts that form the building blocks of any program.

A. Variables and Data Types:

Understanding Variable Declaration and Usage:

  • Variables are containers that hold data and can be assigned different values during program execution.
  • To declare a variable, you specify its name and data type, followed by an optional assignment statement.
  • Example: age = 25 (declares a variable named age of type integer and assigns it the value 25).
  • Variables can be reassigned new values throughout the program.

Exploring Different Data Types:

  • Integers: Whole numbers without decimal points (e.g., 1, 2, -3).
  • Floats: Decimal numbers with a fractional part (e.g., 3.14, 10.5).
  • Booleans: True or False values used for conditions.
  • Characters: Single letters or symbols (‘a’, ‘$’, ‘#’).
  • Strings: Sequences of characters (“Hello, world!”).
  • Other data types: Arrays, lists, dictionaries, etc. (depending on the language).

Operations with Different Data Types:

Each data type has supported operations.

  • Arithmetic operators (+, -, *, /) work with integers and floats.
  • Comparison operators (==, !=, >, <, >=, <=) compare values.
  • Logical operators (&&, ||, !) combine conditions.
  • Concatenation (+) joins strings.
  • Operations with incompatible data types may lead to errors.

B. Operators and Expressions:

Arithmetic Operators:

  • Perform basic mathematical calculations (+, -, *, /, %, **, //).
  • % (modulo) returns the remainder after division.
  • ** (power) raises a number to a certain power.
  • // (floor division) discards the fractional part of the result.

Comparison Operators:

  • Evaluate conditions and return True or False.
  • == (equal), != (not equal), > (greater than), < (less than), >= (greater than or equal), <= (less than or equal).

Logical Operators: Combine conditions and produce True or False.

  • && (and): both conditions must be True.
  • || (or): at least one condition must be True.
  • ! (not): reverses the truth value of a condition.

Building Expressions:

  • Combine variables, operators, and constants to form expressions.
  • Expressions evaluate to a single value. Example: result = age + 10 * 2 (calculates the sum of age and 20).

C. Control Flow Statements:

Conditional Statements: Control the flow of execution based on conditions.

  • if-else: Executes one block of code if the condition is True and another if it’s False.
  • switch-case: Executes different code blocks depending on the value of a variable.

Looping Statements: Repeat a block of code multiple times.

  • for: Executes a block a specific number of times.
  • while: Executes a block while a condition is True.
  • do-while: Executes a block at least once and then repeats while a condition is True.

Nested Loops and Conditional Statements:

  • Can be combined to create complex control flow structures.
  • Inner loops run inside outer loops, allowing for nested logic.

D. Functions:

Defining and Calling Functions:

  • Blocks of code that perform a specific task.
  • Defined with a function name, parameters (optional), and a code block.
  • Called throughout the program to execute the defined functionality.

Passing Arguments to Functions:

  • Values passed to functions for processing.

Returning Values from Functions:

  • Functions can return a value after execution.
  • Useful for collecting results.
  • A function calling itself with a modified input.
  • Useful for solving problems that involve repetitive tasks with smaller inputs.

These topics provide a solid foundation for understanding programming fundamentals. Remember to practice writing code and experiment with different concepts to solidify your learning.

5. Advanced Programming Concepts

This section explores more advanced programming concepts that build upon the foundational knowledge covered earlier.

A. Object-Oriented Programming (OOP)

OOP is a programming paradigm that emphasizes the use of objects to represent real-world entities and their relationships.

1. Classes and Objects:

  • Classes: Define the blueprint for objects, specifying their properties (attributes) and behaviors (methods).
  • Objects: Instances of a class, with their own set of properties and methods.

2. Inheritance and Polymorphism:

  • Inheritance: Allows creating new classes that inherit properties and methods from existing classes (superclasses).
  • Polymorphism: Enables objects to respond differently to the same message depending on their type.

3. Encapsulation and Abstraction:

  • Encapsulation: Encloses an object’s internal state and methods, hiding implementation details and exposing only a public interface.
  • Abstraction: Focuses on the essential features and functionalities of an object, ignoring unnecessary details.

B. Concurrency and Parallelism

Concurrency and parallelism are crucial for improving program efficiency and responsiveness.

1. Multithreading and Multiprocessing:

  • Multithreading: Allows multiple threads of execution within a single process, enabling concurrent tasks.
  • Multiprocessing: Utilizes multiple processors to run different processes simultaneously, achieving true parallelism.

2. Synchronization and Concurrency Control:

Mechanisms to ensure data consistency and prevent conflicts when multiple threads or processes access shared resources.

6. Writing Your First Code

Here is your first code in different languages. These programs all achieve the same goal: printing “ Hello, world! ” to the console. However, they use different syntax and conventions specific to each language.

Printing “Hello world” in C++:

Explanation of above C++ code:

  • #include: This keyword includes the <iostream> library, which provides functions for input and output.
  • int main(): This defines the main function, which is the entry point of the program.
  • std::cout <<: This keyword prints the following expression to the console.
  • “Hello, world!” This is the string that is printed to the console.
  • std::endl: This keyword inserts a newline character after the printed string.
  • return 0; This statement exits the program and returns a success code (0).

Printing “Hello world” in Java:

Explanation of above Java code:

  • public class HelloWorld: This keyword defines a public class named HelloWorld .
  • public static void main(String[] args): This declares the main function, which is the entry point of the program.
  • System.out.println(“Hello, world!”); This statement prints the string “ Hello, world! ” to the console.

Printing “Hello world” in Python:

Explanation of above Python code:

  • print: This keyword prints the following argument to the console.

Printing “Hello world” in Javascript:

Explanation of above Javascript code:

  • console.log: This object’s method prints the following argument to the console.

Printing “Hello world” in PHP:

Explanation of above PHP code:

  • <?php: This tag initiates a PHP code block.
  • echo: This keyword prints the following expression to the console.
  • ?>: This tag ends the PHP code block.

7. Top 20 Programs to get started with Coding/Programming Tutorial:

Here are the list of some basic problem, these problems cover various fundamental programming concepts. Solving them will help you improve your coding skills and understanding of programming fundamentals.

8. Next Steps after learning basic Coding/Programming Tutorial:

Congratulations on taking the first step into the exciting world of programming! You’ve learned the foundational concepts and are ready to explore more. Here’s a comprehensive guide to help you navigate your next steps:

A. Deepen your understanding of Basic Programming Concepts:

  • Practice regularly: Implement what you learn through practice problems and coding exercises.
  • Solve code challenges: Platforms like GeeksforGeeks, HackerRank, LeetCode, and Codewars offer challenges to improve your problem-solving skills and coding speed.

B. Learn advanced concepts:

  • Data structures: Learn about arrays, linked lists, stacks, queues, trees, and graphs for efficient data organization.
  • Algorithms: Explore algorithms for searching, sorting, dynamic programming, and graph traversal.
  • Databases: Learn SQL and NoSQL databases for data storage and retrieval.
  • Version control: Use Git and GitHub for code versioning and collaboration.

C. Choose a focus area:

  • Web development: Learn HTML, CSS, and JavaScript to build interactive web pages and applications.
  • Mobile app development: Choose frameworks like Flutter (Dart) or React Native (JavaScript) to build cross-platform apps.
  • Data science and machine learning: Explore Python libraries like NumPy, pandas, and scikit-learn to analyze data and build machine learning models.
  • Game development: Learn game engines like Unity (C#) or Unreal Engine (C++) to create engaging games.
  • Desktop app development: Explore frameworks like PyQt (Python) or C# to build desktop applications.
  • Other areas: Explore other areas like robotics, embedded systems, cybersecurity, or blockchain development based on your interests.

D. Build projects:

  • Start with small projects: Begin with simple projects to apply your knowledge and gain confidence.
  • Gradually increase complexity: As you progress, tackle more challenging projects that push your boundaries.
  • Contribute to open-source projects: Contributing to open-source projects is a great way to learn from experienced developers and gain valuable experience.
  • Showcase your work: Create a portfolio website or blog to showcase your skills and projects to potential employers or clients.

9. Resources and Further Learning

A. Online Courses and Tutorials:

  • Interactive platforms: GeeksforGeeks, Codecademy, Coursera, edX, Khan Academy
  • Video tutorials: GeeksforGeeks, YouTube channels like FreeCodeCamp, The Coding Train, CS50’s Introduction to Computer Science
  • Language-specific tutorials: GeeksforGeeks, Official documentation websites, blogs, and community-driven resources

B. Books and eBooks:

  • Beginner-friendly books: “Python Crash Course” by Eric Matthes, “Head First Programming” by David Griffiths
  • A dvanced topics: “Clean Code” by Robert C. Martin, “The Pragmatic Programmer” by Andrew Hunt and David Thomas
  • Free ebooks: Many free programming ebooks are available online, such as those on Project Gutenberg

C. Programming Communities and Forums:

  • Stack Overflow: Q&A forum for programming questions
  • GitHub: Open-source platform for hosting and collaborating on code projects
  • Reddit communities: r/learnprogramming, r/python, r/webdev
  • Discord servers: Many languages have dedicated Discord servers for discussions and support

D. Tips for Staying Motivated and Learning Effectively:

  • Set realistic goals and deadlines.
  • Start small and gradually increase complexity.
  • Practice regularly and code consistently.
  • Find a learning buddy or group for accountability.
  • Participate in online communities and forums.
  • Take breaks and avoid burnout.
  • Most importantly, have fun and enjoy the process

10. Frequently Asked Questions (FAQs) on Programming Tutorial:

Question 1: how to learn programming without tutorial.

Answer: Learning programming without tutorials involves a self-directed approach. Start by understanding fundamental concepts, practicing regularly, and working on small projects. Utilize books, documentation, and online resources for reference.

Question 2: How to learn coding tutorial?

Answer: Learning coding through tutorials involves choosing a programming language, finding online tutorials or courses, and following them step by step. Practice coding alongside the tutorial examples and apply the concepts to real-world projects for a hands-on learning experience.

Question 3: What are 3 important things to know about programming?

Answer: Problem Solving: Programming is fundamentally about solving problems. Logic and Algorithms: Understanding logical thinking and creating efficient algorithms is crucial. Practice: Regular practice and hands-on coding improve skills and understanding.

Question 4: How many days do I need to learn programming?

Answer: The time to learn programming varies based on factors like prior experience, the complexity of the language, and the depth of knowledge desired. Learning the basics can take weeks, but mastery requires continuous practice over months.

Question 5: Can tutorials help coding?

Answer: Yes, tutorials are valuable resources for learning coding. They provide structured guidance, examples, and explanations, making it easier to understand and apply Programming Tutorial concepts.

Question 6: How do you use tutorials effectively?

Answer: Use tutorials effectively by following these steps: Set clear learning goals. Work on hands-on exercises and projects. Seek additional resources for deeper understanding. Regularly review and practice concepts learned.

Question 7: Can coding be done on a phone?

Answer: Yes, coding can be done on a phone using coding apps or online platforms that provide mobile-friendly coding environments. However, a computer is generally more practical for extensive coding tasks.

Question 8: Can I learn coding on GeeksforGeeks?

Answer: Yes, GeeksforGeeks is a popular platform for learning coding. Many Tutorials, Courses are provided you to learn various programming languages and concepts.

Question 9: Can we do coding on a laptop?

Answer: Yes, coding can be done on a laptop. Laptops are common tools for coding as they provide a portable and versatile environment for writing, testing, and running code.

Question 10: What is the difference between coding and programming?

Answer: The terms are often used interchangeably, but coding is typically seen as the act of writing code, while programming involves a broader process that includes problem-solving, designing algorithms, and implementing solutions. Programming encompasses coding as one of its stages.

This comprehensive programming tutorial has covered the fundamentals you need to start coding. Stay updated with emerging technologies and keep practicing to achieve your goals. Remember, everyone starts as a beginner. With dedication, you can unlock the world of programming!

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now !

Looking for a place to share your ideas, learn, and connect? Our Community portal is just the spot! Come join us and see what all the buzz is about!

Please Login to comment...

  • Programming
  • Apple's New AI-powered Tool: Editing Through Text Prompts
  • Rebranding Google Bard to Gemini: All You Need to Know, Android App and Advanced subscriptions
  • Youtube TV's Multiview Update: Tailor Your Experience in 4 Easy Steps
  • Kore.ai Secures $150 Million for AI-Powered Growth
  • 10 Best IPTV Service Provider Subscriptions

Improve your Coding Skills with Practice


What kind of Experience do you want to share?

More From Forbes

Programming: the new life skill.

Forbes Technology Council

  • Share to Facebook
  • Share to Twitter
  • Share to Linkedin

Cofounder/CTO at Vymo . Alum Columbia University & BITS, Pilani.

For the longest time, we’ve heard and accepted the left-brain-right-brain theory. Most of us believe that we are inclined one way and that our career choices result from this. But increasingly, neuroscientists are finding that this notion is inaccurate. The human brain doesn’t favor one side to the other.

While the brain does use each half of the brain for specific activities—we can no longer assume that mathematicians are left-brained, and opera singers are right.

Take computer programming, for example. It requires logic, analytical and problem-solving capabilities—typically a left-brained stronghold. But I believe, irrespective of what old research says and what new research tells us, anyone can code and everyone should.

Here’s why.

‘The Tourist’ Dethroned In Netflix’s Top 10 List By A New Show

Ios 17 4 release date awesome iphone update just days away, trump ordered to pay over 350 million in civil fraud case as judge finds ex president knowingly committed fraud, technology and software are pervasive.

We compare insurance plans online, rely on school WhatsApp groups for communication, and reconfirm the steps of a recipe by checking a YouTube video. Every action we take today has technology intertwined with that process. The smallest businesses in the towns and villages in India have a QR code facilitating a UPI transaction! The coconut seller may not know anything other than his vernacular language—but she definitely knows how to transact on the phone. Increasingly, it has become imperative to be digitally literate.

While it may be enough to use an app, spending time understanding how it was built can deepen one’s understanding.

Programming Teaches You Problem-Solving

Programming as a subject requires us to break down a challenge into smaller, solvable parts and then tackle each part to develop a viable solution. Writing algorithms, reasoning out steps and building toward a logical conclusion, identifying patterns, debugging the piece of code you have written, and finally, abstraction are invaluable lessons someone can learn and use effectively in other scenarios!

It Also Encourages Creativity

Is this the best way to solve a problem? Can your steps to concluding become shorter? Take another approach. During my time with the Google mobile team, we were building consumer technology that moved from being reactive ( waiting for the user to ask for information ) to proactive ( what the user needs ). This technological shift required a lot of creative thinking in the background—what kind of data do we need to understand what a user wants, and how do you combine data effectively to gather interesting insights into a customer? You start wearing a creative hat without even realizing it!

Programming Builds Resilience

Leading psychologists say that teaching problem-solving skills is one of the most important cornerstones to building resilience. Other things to learn include building a growth mindset and learning to manage failure. Coders know that trial and error is part of their job. You need to persist through challenges, errors, continuous debugging and adapting your approach. This encourages a growth mindset and builds a certain tenacity that helps individuals view challenges as a stepping stone.

Programming Is Accessible Now—Especially For Kids

The internet has opened up so many avenues for learning programming. Several websites help you learn coding skills. Especially for children—there is a tremendous opportunity to learn and benefit from programming. Close to 50 million children across 200-plus countries and territories use MIT’s Scratch to create projects! Code.org provides some very interesting projects to children based on their favorite animation characters to help them learn code.

And the uptake seems promising—start ’em young, it looks like!

Why Should You And I Care?

As technology leaders, we play a significant role in promoting a culture of code-enablement among children and youth. A few ways I think we can enable this include:

1. Mentor school-going children and high school graduates—give them an overview of coding, expose them to learning resources, guide them to work on small projects.

2. Support not-for-profit institutions that work toward education and volunteer as faculty and mentors.

3. Partner with educational institutions and organize hackathons, coding meets, etc. for children and provide sponsorship, fee discounts and other rewards.

4. Maybe encourage employee children and families to learn coding basics and provide stipends to cover this.

These are ways in which we could be involved in helping future generations pick up computer science skills. Do write to me if you are working toward this in some way and would like to share your ideas.

As the world moves into generative AI and its applications, technology will only advance faster—and it becomes very important to stay tuned. Learn the language! While the World Economic Forum lists computer science skills as essential for employability in its Future of Jobs report , it is beyond that. As a Brookings study quotes, programming is among a broad suite of skills youngsters need to thrive in work, life and citizenship.

Forbes Technology Council is an invitation-only community for world-class CIOs, CTOs and technology executives. Do I qualify?

Venkat Malladi

  • Editorial Standards
  • Reprints & Permissions

MATLAB Answers

  • Trial software

You are now following this question

  • You will see updates in your followed content feed .
  • You may receive emails, depending on your communication preferences .

Solving goal programming problem with MATLAB


Direct link to this question


   0 Comments Show -2 older comments Hide -2 older comments

Sign in to comment.

Sign in to answer this question.

Answers (2)


Direct link to this answer


John D'Errico


   1 Comment Show -1 older comments Hide -1 older comments


Direct link to this comment


  • goal programming
  • MATLAB Coder

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

  • América Latina (Español)
  • Canada (English)
  • United States (English)
  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 简体中文 Chinese
  • 日本 Japanese (日本語)
  • 한국 Korean (한국어)

Contact your local office

Book cover

Handbook of Formal Optimization pp 1–26 Cite as

Solving Cropping Pattern Optimization Problems Using Robust Positive Mathematical Programming

  • Mostafa Mardani Najafabadi 3 &
  • Somayeh Shirzadi Laskookalayeh 4  
  • Living reference work entry
  • First Online: 06 February 2024

Agricultural activities occur in an environment that is constantly changing. In each cropping season, farmers must make management decisions based on numerous factors, some of which are beyond their control and others which are not. The use of mathematical programming models in determining optimal decisions for farmers, predicting the outcomes of policy effects, and the occurrence of uncontrollable factors in the agriculture sector is beneficial. It can provide planners and farmers with appropriate awareness and understanding of the effects of each decision related to resource allocation and cropping patterns before implementing that decision. One of the problems with some cropping pattern models is the consideration of resource amounts as fixed and certain, neglecting the issue of uncertainty. This results in a significant difference between the estimated model and the behavior of the farmers. In this context, the formulation of a mathematical programming model aligned with the real world and considering its uncertainties is highly important. This chapter aims to present an appropriate mathematical programming model for decision-making in determining cropping patterns and optimal resource allocation. This model should be able to model the uncertainties of the real world in the agriculture sector in the best possible way and provide more desirable and practical results. Therefore, while discussing the generalities related to the features and application of mathematical programming models and their types, the chapter elaborates on the basic and extended models of policy analysis using Positive Mathematical Programming (PMP) and the Robust Optimization (RO) approach. Subsequently, the method and a practical example of the combined model of Robust Positive Mathematical Programming (RPMP) in solving cropping pattern optimization problems is explained.

  • Cropping pattern
  • Robust optimization
  • Uncertainty
  • Conservatism

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

Afzali R, GharehBeygi M, Yazdanpanah Dero Q (2020) Climate changes and food policies: economic pathology. Clim Risk Manag 30:100249

Article   Google Scholar  

Aghapour Sabbaghi M, Nazari M, Araghinejad S, Soufizadeh S (2020) Economic impacts of climate change on water resources and agriculture in Zayandehroud river basin in Iran. Agric Water Manag 241:106323

Agudo-Domínguez A, Pérez-Blanco CD, Gil-García L, Ortega JA, Dasgupta S (2022) Climate-sensitive hydrological drought insurance for irrigated agriculture under deep uncertainty. Insightful results from the Cega River Basin in Spain. Agric Water Manag 274:107938

Akbari M, Najafi Alamdarlo H, Mosavi SH (2020) The effects of climate change and groundwater salinity on farmers’ income risk. Ecol Indic 110:105893

Aldaya MM, Gutiérrez-Martín C, Espinosa-Tasón J, Ederra I, Sánchez M (2023) The impact of the territorial gradient and the irrigation water price on agricultural production along the first phase of the Navarra Canal in Spain. Agric Water Manag 281:108245

Anonymous (2016) Agricultural statistics of Mazandaran Province. In: Technology, D.o.S.a.I. (ed) Agriculture Jihad organization

Google Scholar  

Arfini F (2001) Mathematical programming models employed in the analysis of the common agriculture policy. National Institute of Agricultural Economics, Italy, INEA, Osservatorio Sulle Politiche Agricole dell'UE, Working Papers

Ben-Tal A, Nemirovski A (1999) Robust solutions of uncertain linear programs. Oper Res Lett 25(1):1–13

Article   MathSciNet   Google Scholar  

Ben-Tal A, Nemirovski A (2000) Robust solutions of linear programming problems contaminated with uncertain data. Math Program 88(3):411–424

Bertsimas D, Sim M (2004) The price of robustness. Oper Res 52(1):35–53

Buysse J, Van Huylenbroeck G, Lauwers L (2007) Normative, positive and econometric mathematical programming as tools for incorporation of multifunctionality in agricultural policy modelling. Agric Ecosyst Environ 120(1):70–81

Cao Z, Zhu T, Cai X (2023) Hydro-agro-economic optimization for irrigated farming in an arid region: The Hetao Irrigation District, Inner Mongolia. Agric Water Manag 277:108095

Drud A (2010) CONOPT user guide. ARKI consulting and development A/S., Bagsvaerd, Denmark. Last Accessed 14th August 2013

El Ghaoui L, Lebret H (2000) Robust solutions to least-squares problems with uncertain data. SIAM J Matrix Anal Appl 18(4):1035–1064

El Ghaoui L, Oustry F, Lebret H (1998) Robust solutions to uncertain semidefinite programs. SIAM J Optim 9(1):33–52

Fernández FJ, Vásquez-Lavín F, Ponce RD, Garreaud R, Hernández F, Link O, Zambrano F, Hanemann M (2023) The economics impacts of long-run droughts: challenges, gaps, and way forward. J Environ Manag 344:118726

Fragoso R, Marques C, Lucas MR, Martins MB, Jorge R (2011) The economic effects of common agricultural policy on Mediterranean montado/dehesa ecosystem. J Policy Model 33(2):311–327

Frahan B, Buysse J, Polome P, Fernagut B, Harmignie O, Lauwers L, Van Huylenbroeck G, Van Meensel J (2007) Positive mathematical programming for agricultural and environmental policy analysis: review and practice, pp 129–154

Funk B, Amer SA, Ward FA (2023) Sustainable aquifer management for food security. Agric Water Manag 281:108073

Ghaffari A, Nasseri M, Pasebani Someeh A (2022) Assessing the economic effects of drought using Positive Mathematical Planning model under climate change scenarios. Heliyon 8(12):e11941

Gharye-Mirzaei M, Gholami S, Rahmani D (2023) A mathematical model for the optimization of agricultural supply chain under uncertain environmental and financial conditions: the case study of fresh date fruit. Environ Dev Sustain 3(3):519–541

Gohar AA, Ward FA (2010) Gains from expanded irrigation water trading in Egypt: an integrated basin approach. Ecol Econ 69(12):2535–2548

Gohar AA, Ward FA, Amer SA (2013) Economic performance of water storage capacity expansion for food security. J Hydrol 484:16–25

Gohar AA, Amer SA, Ward FA (2015) Irrigation infrastructure and water appropriation rules for food security. J Hydrol 520:85–100

Gorissen BL, Yanıkoğlu İ, den Hertog D (2015) A practical guide to robust optimization. Omega 53:124–137

Graveline N (2020) Combining flexible regulatory and economic instruments for agriculture water demand control under climate change in Beauce. Water Resour Econ 29:100143

Hassani Y, Hashemy Shahdany SM, Maestre JM, Zahraie B, Ghorbani M, Henneberry SR, Kulshreshtha SN (2019) An economic-operational framework for optimum agricultural water distribution in irrigation districts without water marketing. Agric Water Manag 221:348–361

He L, Horbulyk T, Ali MK, Le Roy DG, Klein KK (2012) Proportional water sharing vs. seniority-based allocation in the Bow River basin of Southern Alberta. Agric Water Manag 104:21–31

Housh M, Ostfeld A, Shamir U (2011) optimal multi-year management of a water supply system under uncertainty: robust counterpart approach. Water Resour Res

Howitt RE (1995) A calibration method for agricultural economic production models. J Agric Econ 46(2):147–159

Howitt RE (2005) PMP Based Production Models-Development and Integration. European Association of Agricultural Economists, Copenhagen

Howitt RE, Medellín-Azuara J, MacEwan D, Lund JR (2012) Calibrating disaggregate economic models of agricultural production and water management. Environ Model Softw 38:244–258

Ide J, Schöbel A (2016) Robustness for uncertain multi-objective optimization: a survey and analysis of different concepts. OR Spectr 38(1):235–271

Ji Y, Du J, Wu X, Wu Z, Qu D, Yang D (2021) Robust optimization approach to two-echelon agricultural cold chain logistics considering carbon emission and stochastic demand. Environ Dev Sustain 23(9):13731–13754

José Alem D, Morabito R (2012) Production planning in furniture settings via robust optimization. Comput Oper Res 39(2):139–150

Kalbali E, Ziaee S, Mardani Najafabadi M, Zakerinia M (2021) Approaches to adapting to impacts of climate change in northern Iran: the application of a hydrogy-economics model. J Clean Prod 280:124067

Layani G, Mehrjou S, Farajzadeh Z (2023) Effects of government policies reform on environmental sustainability: an integrated approach of PMP and system dynamics simulation model. J Clean Prod 426:138985

Lee K, Singh VP (2020) Analysis of uncertainty and non-stationarity in probable maximum precipitation in Brazos River basin. J Hydrol 590:125526

Maneta MP, Cobourn K, Kimball JS, He M, Silverman NL, Chaffin BC, Ewing S, Ji X, Maxwell B (2020) A satellite-driven hydro-economic model to support agricultural water resources management. Environ Model Softw 134:104836

Mardani Najafabadi M, Ashktorab N (2022) Mathematical programming approaches for modeling a sustainable cropping pattern under uncertainty: a case study in Southern Iran. Environ Dev Sustain 25:9731–9755

Martínez-Dalmau J, Gutiérrez-Martín C, Kahil T, Berbel J (2023) Impact of alternative water policies for drought adaptation in the Guadalquivir Mediterranean river basin, southern Spain. J Hydrol: Regional Stud 47:101444

Medellín-Azuara J, Harou JJ, Howitt RE (2010) Estimating economic value of agricultural water under changing conditions and the effects of spatial aggregation. Sci Total Environ 408(23):5639–5648

Medellín-Azuara J, Howitt RE, Harou JJ (2012) Predicting farmer responses to water pricing, rationing and subsidies assuming profit maximizing investment in irrigation technology. Agric Water Manag 108:73–82

Mills G (1984) Optimization in economic analysis. HarperCollins Publishers Ltd, London

Mulvey J, Vanderbei R, Zenios S (1995) Robust optimization of large-scale systems. Oper Res 43:264–281

Nahmias S (2005) Production and operations analysis. McGraw-Hill/Irwin, Singapore

Nevo A, Amir I (1991) CROPLOT – an expert system for determining the suitability of crops to plots. Agric Syst 37(3):225–241

Nevo A, Oad R, Podmore TH (1994) An integrated expert system for optimal crop planning. Agric Syst 45(1):73–92

Norton R, Hazell P (1986) Mathematical programming for economic analysis in agriculture

Paris Q (2010) Economic foundations of symmetric programming

Paris Q, Howitt RE (1998) An analysis of ill-posed production problems using maximum entropy: reply. Am J Agric Econ 84

Randall M, Montgomery J, Lewis A (2022) Robust temporal optimisation for a crop planning problem under climate change uncertainty. Operations Res Perspect 9:100219

Rodríguez-Flores JM, Gupta RS, Zeff HB, Reed PM, Medellín-Azuara J (2023) Identifying robust adaptive irrigation operating policies to balance deeply uncertain economic food production and groundwater sustainability trade-offs. J Environ Manag 345:118901

Röhm O, Dabbert S (2003) Integrating agri-environmental programs into regional production models: an extension of positive mathematical programming. Am J Agric Econ 85(1):254–265

Sabouhi M, Mardani M (2017) Linear robust data envelopment analysis: CCR model with uncertain data. Int J Productivity Qual Manage 22(2):262–280

Sahinidis NV (2004) Optimization under uncertainty: state-of-the-art and opportunities. Comput Chem Eng 28(6):971–983

Sapino F, Pérez-Blanco CD, Gutiérrez-Martín C, Frontuto V (2020) An ensemble experiment of mathematical programming models to assess socio-economic effects of agricultural water pricing reform in the Piedmont Region, Italy. J Environ Manag 267:110645

Sapino F, Pérez-Blanco CD, Gutiérrez-Martín C, García-Prats A, Pulido-Velazquez M (2022) Influence of crop-water production functions on the expected performance of water pricing policies in irrigated agriculture. Agric Water Manag 259:107248

Sheffi Y (2005) The resilient enterprise: overcoming vulnerability for competitive advantage. MIT Press, Cambridge, MA

Shirzadi Laskookalayeh S, Mardani Najafabadi M, Shahnazari A (2022) Investigating the effects of management of irrigation water distribution on farmers' gross profit under uncertainty: A new positive mathematical programming model. J Clean Prod 351:131277

Simchi-Levi D, Kaminsky P, Simchi-Levi E (2004) Managing the supply chain: the definitive guide for the business professional. McGraw-Hill, New York

Soyster AL (1973) Convex programming with set-inclusive constraints and applications to inexact linear programming. Oper Res 21(5):1154–1157

Thiele A (2004) A robust optimization approach to supply chains and revenue management. Department of Electrical Engineering and Computer Science. Massachusetts Institute of Technology, Cambridge, p 176

Wang S, Tan Q, Yang P, Zhang T, Zhang T (2023) Development of an inexact simulation-evaluation model for the joint analysis of water pricing and groundwater allocation policies. J Environ Manag 329

Zamani O, Grundmann P, Libra JA, Nikouei A (2019) Limiting and timing water supply for agricultural production – the case of the Zayandeh-Rud River Basin, Iran. Agric Water Manag 222:322–335

Zhu J, Wang X, Zhang L, Cheng H, Yang Z (2015) System dynamics modeling of the influence of the TN/TP concentrations in socioeconomic water on NDVI in shallow lakes. Ecol Eng 76:27–35

Download references

Author information

Authors and affiliations.

Department of Agricultural Economics, Faculty of Agricultural Engineering and Rural Development, Agricultural Sciences and Natural Resources University of Khuzestan, Mollasani, Iran

Mostafa Mardani Najafabadi

Department of Agricultural Economics, Faculty of Agricultural Engineering, Sari Agricultural Sciences and Natural Resources University, Sari, Iran

Somayeh Shirzadi Laskookalayeh

You can also search for this author in PubMed   Google Scholar

Corresponding author

Correspondence to Mostafa Mardani Najafabadi .

Editor information

Editors and affiliations.

Institute of Artificial Intelligence, MIT World Peace University, Pune, Pune, Maharashtra, India

Anand J. Kulkarni

Faculty of Engineering and IT, University of Technology Sydney, Ultimo, NSW, Australia

Amir H. Gandomi

Section Editor information

Institute of Artificial Intelligence, Dr Vishwanath Karad MIT World Peace University, Pune, India

Rights and permissions

Reprints and permissions

Copyright information

© 2024 Springer Nature Singapore Pte Ltd.

About this entry

Cite this entry.

Mardani Najafabadi, M., Shirzadi Laskookalayeh, S. (2024). Solving Cropping Pattern Optimization Problems Using Robust Positive Mathematical Programming. In: Kulkarni, A.J., Gandomi, A.H. (eds) Handbook of Formal Optimization. Springer, Singapore. https://doi.org/10.1007/978-981-19-8851-6_52-1

Download citation

DOI : https://doi.org/10.1007/978-981-19-8851-6_52-1

Received : 18 November 2023

Accepted : 25 November 2023

Published : 06 February 2024

Publisher Name : Springer, Singapore

Print ISBN : 978-981-19-8851-6

Online ISBN : 978-981-19-8851-6

eBook Packages : Springer Reference Intelligent Technologies and Robotics Reference Module Computer Science and Engineering

  • Publish with us

Policies and ethics

  • Find a journal
  • Track your research

The Most Popular Coding Challenge Websites

If you want to improve your analytical skills, there's no better way to do that than solving problems.

If you are a programmer, then this is something you should do for yourself. Programmers need to deal with all sorts of problems almost every day.

Most importantly, solving problems in an efficient manner can make you much more productive. And solving challenging problems helps us do that.

You can watch this complete video on YouTube as well if you like 🎥

Why Should You Develop Your Problem-Solving Skills?

These days, technology is developing rapidly, and we are seeing some amazing changes and improvements almost every day.

Whenever we talk about technology, a buzzword appears in our mind – and that is coding or programming. Now, coding/programming isn't just about solving different kinds of problems using different programming languages, but it's a large part of what you'll do as a developer.

The fields of Web development, Machine Learning, Artificial Intelligence, Augmented Reality, App Development, and many others require strong problem-solving skills.

There are many popular websites that help you do that by providing various types of problems where you need to apply your analytical and mathematical skills to solve each problem using programming languages.

I am going to provide you with a list of coding challenge websites that will help you become more advanced day by day.

Keep in mind that these websites are useful for everybody, whether you are new to coding challenges or you are a professional programmer and so on.

  • Project Euler
  • GeeksforGeeks
  • Online Judge
  • HackerEarth
  • Code Jam - Google's Coding Competitions

Best Coding Challenge Websites

1. beecrowd (formerly uri).

beecrowd banner

beecrowd is perfect for those who have just started solving coding challenges and are looking for a beginner-friendly website. It used to be named URI , so there is a chance that you are already familiar with this site as URI.

If you want to solve problems in a specific category, then you're in luck as this website also offers that.

A dropdown showing the different challenge categories on beercrowd

Here is an image of a Strings problem set. You can also filter the problems by the ID (#), name (NAME), Subject (SUBJECT), solved (SOLVED), and so on. Beginners like these features very much.


On this website, you can also take part in different programming contests, and check your global ranking, country-wide ranking, and university-wide ranking.

Also, you can check your progress, how many days have passed after signing up, how many problems you have solved, how many points you have got, and more.

You will also get a nice profile page that looks beautiful as well. 😊 I used to practice solving problems on this website when I was just starting out my CP (Competitive Programming) journey. Not to mention, I got the 3rd position among 1250 students back then at my university. 🎉

You can also check out my beecrowd profile here .

2. HackerRank


HackerRank is one of the most popular coding practice websites out there. This is a nice platform for everyone, especially beginners.

The website looks nice and polished, and the users who come here the first time don't struggle when navigating throughout the website, so that is definitely a positive thing here.

Login page

HackerRank offers different portals for companies and developers. If you are learning to solve problems, then you will choose the For Developers section.

If you want to learn any specific topics or programming languages, then this website is the perfect place to get started in that. You can prepare yourself by topics. You can also take their certification exam and stand out from the crowd. I have already passed their Python (Basic) certification exam.


You can also choose preparation kits from there, and prepare yourself before your interview if you want. Moreover, you can take part in programming contests.

Here, you will also get a nice personal profile page. You can check out my profile from HackerRank here .

My HackerRank profile

3. Codeforces

Codeforces Banner

Codeforces is one of the most used and well-known coding challenge and practice websites in the world, and it is sponsored by Telegram. Especially if you know about CP (Competitive Programming), then there is a high chance you have heard a lot about this website.

Although the website might look a little bit different to newcomers, you won't need much time to get used to it. You can train yourself by solving problems of different categories, difficulty levels, and so on.

Competitive programmers have ranks based on their successful results in programming contests. If you have heard about the RED coder / PURPLE coder, etc, then it is definitely from Codeforces.

Codeforces Ranking System

You can get the idea of the ranking system on Codeforces from the image above. For more details, you can check out this blog entry .

Codeforces arranges contests regularly each week, and they are categorized into div 1, div 2, div 3 and div 4. They also arrange global round and educational round contests. You can get the timeline of the contests directly from here .

Codeforces also provides a nice user profile on their website. You can check mine here as well.

4. LeetCode

Leetcode banner

If you are familiar with the FAANG (Facebook, Apple, Amazon, Netflix, Google) buzzword, then you should definitely know about this website! If you want to practice for your coding interview for the big giant tech companies like FAANG, then they all do leetcoding .

You might think that I have made a typo in the above paragraph. No, I didn't. LeetCode has become this popular among people who target FAANG and those who are working on their problem solving skills. Taking part in contests on LeetCode has become common, and people call it leetcoding!

Here, you can solve a lot of problems, and filter the problems by the lists, difficulty levels, status, and tags.

LeetCode ProblemSet1

You can also choose problems regarding Arrays, Strings, Hash Tables, Dynamic Programming, and many other categories.

LeetCode ProblemSet2

As I mentioned above, you can also take part in programming contests. The only thing that makes LeetCode different is that it is based on Algorithm practice. Yeah, LeetCode is not like any other coding website, because it focuses on algorithm practice alone.

You do not need to provide the full code for solving a problem here, you just need to crack the solution by providing a valid algorithm using any popular language that can solve the problem.

You also get to see how your code performs among others, how much space and time it takes, and so on.

Most importantly, LeetCode has an amazing discussion group where people talk about their problems, solutions, how to improve their algorithms, how to improve the efficiency of their code, and so on. This is one of the most powerful features of LeetCode.

One sad part about LeetCode is that you will not get every feature for free! Yeah, it's true. You have to pay for it monthly or yearly to unlock all its features. There are a lot of problems you will find locked on the website. You can not unlock them if you do not purchase the premium plan.

LeetCode pricing

If you are just starting your algorithm journey on LeetCode, then actually you don't need to worry about their premium plans as the free version will be more than enough for you.

Later, if you want to become more serious, then paying for their premium subscription will be a big deal actually as you'll get a ton more features. This is very much helpful, and includes things like top interview questions, top FAANG questions, video explanations, and more.

You also get a nice profile page on LeetCode. You can check out mine here .

My LeetCode profile

I was pretty confused before writing this section, as Kaggle is not a typical website for coding practice. This website is basically for Data Science, and it's one of the most popular websites out there for this.

Kaggle is an online community platform for data scientists and machine learning enthusiasts.
It is a popular crowd-sourced platform to attract, nurture, train, and challenge Data Science and Machine Learning enthusiasts from all around the world to come together and solve numerous Data Science, Predictive Analytics, and Machine Learning problems.

So if you are interested in Data Science, then you should check this website. Here you can check others' notebooks, submit your notebook, join in the contests, improve datasets, and so on.

Kaggle allows users to collaborate with other users, find and publish datasets, use GPU integrated notebooks, and compete with other data scientists to solve data science challenges.

Also, if you are interested in data science, but don't know where to start, then don't worry! Kaggle has got you covered. You can check their learning section where they have many free courses which will teach you a lot of stuff from the beginning.

kaggle free courses

✨ BONUS: If you want to learn more then I'd suggest that you complete the data science playlist from freeCodeCamp's YouTube channel.

fcc courses

Kaggle also provides rankings and a nice user profile. You can check out my profile here .

FBA kaggle

6. CodeChef

CodeChef banner image

CodeChef is another popular Indian website like HackerRank where you can solve a lot of problems, take part in contests, and so on.

You can filter the problems based on different categories and solve them using any of the most popular programming languages.

They also have a learning section on their website where you can learn how to solve problems in a systematic way. This is super helpful, especially for beginners.

In their learning section, you can choose self-learning, mentored learning, and doubt support. Some of them are free of charge, but in some courses, you have to pay before you can start them.

mentor price

This website also provides user ranking including the global ranking and country-wide ranking. They also provide a user profile on their website. You can check out mine here although I am not active on most of the websites right now. 😅

codechef fba

AtCoder is a programming contest website based in Japan. Makoto Soejima (rng_58) who is one of the former admins and problem writers from Topcoder is a founding member of AtCoder.

On this website, you can take part in different programming contests. They held regular programming contests on Saturdays and Sundays. Also, you can solve problems from previously held programming contests.

I have seen a lot of people regularly participate in the programming contests and solve problems previously used in the contests regularly by solving problems on AtCoder. I also tried that for a while to check the efficiency, and truth to be told, it was really effective.

Here you can also check the global ranking. Here you will also get your own profile page where you and others can see your global ranking and so on.

8. Topcoder

Topcoder banner image

Topcoder (formerly TopCoder) is a crowdsourcing company with an open global community of designers, developers, data scientists, and competitive programmers. Topcoder pays community members for their work on the projects and sells community services to corporate, mid-size, and small-business clients.

Here you can earn, learn, and do a lot more in their MVP program. For earning, you can participate in five different tracks, become a copilot, become a reviewer, and also get a freelance contract gig through Topcoder Gig Work .

Personally, I feel this website is a little bit overwhelming for beginners. You can get more details in the YouTube videos I have made for you.

9. Coderbyte

Coderbyte banner image

Coderbyte has a huge collection of problems that you can solve. They also offer a challenging library, starter courses, interview kits, career resources and so on.

To get all the features, you need to buy a subscription plan from them. I personally liked their interview kit a lot.

Interview kits

Here you will also get a personal profile page.

10. Project Euler

Project Euler banner image

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve.

Project Euler is a great website for solving mathematical challenging problems. But solving a problem on this website requires more than just simple mathematical knowledge.

If you want to solve mathematical problems in a more analytical way, then this website will come in handy.

Problem set

11. Codewars

Codewars banner image

Codewars is a coding challenge website for people of all programming levels. It claims to have a community of over 3 million developers.

One of the biggest benefits of this website is that it is highly focused on algorithms like LeetCode. Moreover, if your goal is to get very good at writing clean and efficient programs, then this website can be a great asset to you.

In Codewars, you will see Kata and Kyu a lot.

Kyu (or Kyū) indicates the number of degrees away from master level (Dan). This is why they count downward. Once you reach master level, we count upward. Black belts in martial arts are Dan level.
On Codewars, kata are code challenges focused on improving skill and technique. Some train programming fundamentals, while others focus on complex problem solving. Others are puzzles meant to test your creative problem solving, while others are based on real world coding scenarios.

If you want to know more about how the ranking system works on Codewars, then simply check their docs here .

On Codewars you will also get a nice profile page like mine . Keep in mind that I haven't solved that much on this website; therefore my profile page would seem empty. 😅

Additionally, I find their leaderboard page quite amusing.

SPOJ banner image

SPOJ is a website that contains huge problems for solving. It claims to have 315,000 registered users and over 20,000 problems.

According to GFG,

You can start solving problems with maximum submission and follow or check the submission of good coders here. Once you solved around 50-70 problems and build some confidence, you can participate in different contests.

Their problem set is also quite amusing.

SPOJ problem set

You will also get a nice user profile page here which you can use to showcase your problem solve skills.

13. CodinGame

CodinGame banner image

In CodinGame, you can improve your coding skills with fun exercises in more than 25 programming languages.

It is a good website for intermediate and advanced software engineers to have fun while continuing to keep their skills sharp. Also, the challenges are gamified and the multiplayer access means that users can challenge friends and coworkers.

14. GeeksforGeeks (Popularly known as GFG)

GeeksforGeeks banner Image

You might wonder why I am including GFG in this article as it only provides algorithms, tutorials, and so on.

Well, that's not all they offer. Yes, GFG is pretty popular for its tutorials, algorithms, and so on, but they also provide a nice problem-solving platform here .

practice GFG

You can also filter the problems as you see fit for yourself.

GFG filter

You will also get your profile page where you can show your progress in problem solving on the GFG website.

Toph banner image

Competitive programmers participate in programming contests and solve many problems on this website. This website is kind of special to the Bangladeshi people as the Bangladeshi universities arrange many programming contests through it.

You can solve problems in different categories on this website, and they also offer you a nice profile page. They also provide rankings based on your performance in the programming contests.

If you are a complete beginner in problem solving, then this website can help you a lot in starting your problem solving journey.

16. LightOJ

LightOJ banner image

In LightOJ, you can solve a lot of categorized problems. It is highly based on solving algorithmic problems. Their problems are categorized as below:

  • LightOJ Volumes
  • Advanced Search Techniques
  • Data Structures
  • Divide And Conquer
  • Dynamic Programming
  • Fast Fourier Transform
  • Flow/Matching
  • Game Theory
  • Graph Theory
  • Parsing/Grammar
  • Recursion/Branch and Bound

They also provide you with a nice profile page where you can see your activities. It might seem odd, but sometimes I find this website better than LeetCode in some cases. Moreover, everything you do on this website is completely free of cost!

17. Exercism

Exercism banner image

You can develop your programming fluency in 57 different programming languages with their unique blend of learning, practice and mentoring.

Exercism is completely free of cost, and it's built by people like us. You can also contribute or donate to them to support their amazing service for free.

They also provide a very nice user profile page which also shows everything you have done on their website, starting from publishing to maintaining.

On their tracks page, you will get a list of 57 different programming languages where you can start your practice.

Solving problems on their website seems super fun to me. I really liked the way they manage their website.

18. Online Judge (Commonly known as UVa)

Online Judge banner image

This is one of the oldest websites out there for solving programming-related problems. I still find it to be a very hard website for beginners. The UI and navigation of the website are also very old.

All of the questions come with a PDF here. You need to download the PDF file of the problem if you want to solve problems as they do not offer a direct preview of the questions.

They have a lot of problemsets on their website . I still find a lot of users using this website nowadays. Therefore, I mentioned it here.

19. HackerEarth

HackerEarth banner image

HackerEarth is an Indian software company headquartered in San Francisco, US, that provides enterprise software that helps organisations with their technical hiring needs. HackerEarth is used by organizations for technical skill assessment and remote video interviewing.

You can practice your problem solving skills from their practice page. Also, you can participate in programming challenges and hackathons from their challenges page.

HackerEarth challenges page

Their interview prep section is quite amazing. You can take part in the mock assessments for the Adobe Coding Test, Facebook Coding Test, and Amazon Coding Test.

They also provide a nice user profile for everyone.

20. Code Jam - Google's Coding Competitions

Code Jam banner image

Google Code Jam is an international programming competition hosted and administered by Google. The competition began in 2003. The competition consists of a set of algorithmic problems which must be solved in a fixed amount of time.

If you are interested in taking part in the Code Jam contests, then their archive section is full of amazing resources for you where you can get the earlier questions and practice them.

They also offer a lot of prize money in their contests. An example can be:

Out of thousands of participants, only the top 25 will head to the World Finals to compete for the title of World Champion and cash prizes of up to $15,000. And there will be plenty of other prizes to go around — the top 1,000 competitors will win an exclusive Code Jam 2022 t-shirt.

21. ICPC - International Collegiate Programming Contest

ICPC banner image

ICPC is one of the most prestigious programming contests in the world.

The International Collegiate Programming Contest, known as the ICPC, is an annual multi-tiered competitive programming competition among the universities of the world.

Who is eligible for ICPC?

ACM/ICPC is a team-based competition with certain requirements to the participants: only post-secondary students and first-year post-graduate students no older than 24 are eligible; each team consists of three members. One can participate in the finals no more than twice and in the regionals no more than five times.

Personal Opinion

If you are a complete beginner, then start with beecrowd . If you want to start problem solving along with learning a specific programming language, then start with HackerRank .

After solving almost 50+ problems on beecrowd or HackerRank, start solving problems on Codeforces . The first time, you won't be able to do that well in the programming contests on Codeforces, and that is completely okay – it is natural. You just need to try regularly. The questions might seem pretty hard to you, but it'll become easier day by day after solving problems continuously.

You can participate in AtCoder the day you start solving problems on Codeforces. You can also try CodeChef , but I find Codeforces is enough in this case.

This will prepare you for the ICPC and Code Jam . Don't forget to solve the earlier questions on Code Jam.

If you want to gain expertise in Data Science, then simply go for Kaggle .

If you want to gain expertise in Algorithms, then LeetCode , and LightOJ are your only places. GeeksforGeeoks will also help you in this aspect.

For LeetCode, get some help from Nick White . His LeetCode Solution playlist has 189 videos as of today, and you will learn a lot from him, trust me!

Another good resource is Neetcode where you can get curated problems and their solutions from LeetCode. The official YouTube channel of Neetcode is also a great channel.

Additional Websites

You might find the websites below useful too!

⭐ StopStalk

StopStalk banner image

This website retrieves your friends' recent submissions from various competitive websites (Such as Codeforces, SPOJ, HackerRank, Timus, and so on) and shows all of them in one place. You can check my StopStalk profile from here .

⭐ CodersRank

CodersRank banner image

This is a platform made to help developers in job-seeking and professional growth. Here, your CodersRank profile serves as a proven track record of your coding knowledge.

You have to connect your private and public repositories here from GitHub to generate your true CodersRank profile. You can also check my CodersRank profile from here .

Thanks for reading the entire article. If it helps you then you can also check out other articles of mine at freeCodeCamp .

If you want to get in touch with me, then you can do so using Twitter , LinkedIn , and GitHub .

You can also SUBSCRIBE to my YouTube channel (Code With FahimFBA) if you want to learn various kinds of programming languages with a lot of practical examples regularly.

If you want to check out my highlights, then you can do so at my Polywork timeline .

You can also visit my website to learn more about me and what I'm working on.

Thanks a bunch!

Microsoft Research Investigation Contributor to OSS (GitHub: FahimFBA) | Software Engineer | Top Contributor 2022, 2023 @freeCodeCamp | ➡️youtube.com/@FahimAmin

If you read this far, thank the author to show them you care. Say Thanks

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


  • The Magazine
  • Newsletters
  • Managing Yourself
  • Managing Teams
  • Work-life Balance
  • The Big Idea
  • Data & Visuals
  • Reading Lists
  • Case Selections
  • HBR Learning
  • Topic Feeds
  • Account Settings
  • Email Preferences

Find the AI Approach That Fits the Problem You’re Trying to Solve

  • George Westerman,
  • Sam Ransbotham,
  • Chiara Farronato

solving problems for programming

Five questions to help leaders discover the right analytics tool for the job.

AI moves quickly, but organizations change much more slowly. What works in a lab may be wrong for your company right now. If you know the right questions to ask, you can make better decisions, regardless of how fast technology changes. You can work with your technical experts to use the right tool for the right job. Then each solution today becomes a foundation to build further innovations tomorrow. But without the right questions, you’ll be starting your journey in the wrong place.

Leaders everywhere are rightly asking about how Generative AI can benefit their businesses. However, as impressive as generative AI is, it’s only one of many advanced data science and analytics techniques. While the world is focusing on generative AI, a better approach is to understand how to use the range of available analytics tools to address your company’s needs. Which analytics tool fits the problem you’re trying to solve? And how do you avoid choosing the wrong one? You don’t need to know deep details about each analytics tool at your disposal, but you do need to know enough to envision what’s possible and to ask technical experts the right questions.

  • George Westerman is a Senior Lecturer in MIT Sloan School of Management and founder of the Global Opportunity Forum  in MIT’s Office of Open Learning.
  • SR Sam Ransbotham is a Professor of Business Analytics at the Boston College Carroll School of Management. He co-hosts the “Me, Myself, and AI” podcast.
  • Chiara Farronato is the Glenn and Mary Jane Creamer Associate Professor of Business Administration at Harvard Business School and co-principal investigator at the Platform Lab at Harvard’s Digital Design Institute (D^3). She is also a fellow at the National Bureau of Economic Research (NBER) and the Center for Economic Policy Research (CEPR).

Partner Center

solving problems for programming

  • [ February 17, 2024 ] Brevard Public Schools Future Problem Solving Competition Crowns Winners Brevard News
  • [ February 17, 2024 ] Jennifer Hill of St. Gabriel’s Episcopal Church Earns Prestigious Saint George Award Brevard News
  • [ February 17, 2024 ] MARTIANS WANTED: NASA Opens Call to Applicants to Participate in Simulated Yearlong Mars Mission Brevard News
  • [ February 17, 2024 ] NASA Telescopes Find New Clues About Mysterious Deep Space Signals Brevard News
  • [ February 17, 2024 ] Florida Tech Swimmer Akos Hajagos Breaks Program Record at Day Two of SSC Championship Brevard News

Home » Home » Brevard Public Schools Future Problem Solving Competition Crowns Winners

Brevard Public Schools Future Problem Solving Competition Crowns Winners

By Space Coast Daily  //  February 17, 2024

education spotlight

solving problems for programming

BREVARD COUNTY, FLORIDA – After weeks of intense challenges, the Future Problem Solving District Competition has concluded, and the victors have been declared.

From January 17 – February 5, the Brevard County School District office hosted the Future Problem Solving competition.

Future Problem Solving is a renowned program that teaches students a six-step problem-solving process for real-world challenges, enhancing decision-making, and critical and creative thinking skills.

The teams competed in the Global Issues Problem Solving category, focusing on Antarctica’s sustainable utilization while preserving it for the global population’s benefit.

The teams explored Antarctica, addressing a hypothetical scenario set 20-30 years ahead using FPS’s problem-solving process. Their efforts produced detailed Action Plans, presented through captivating team skits.

This was a District-level competition with multiple teams advancing to the State Championship.

Below is a list of the award winners (Note: Some schools had multiple teams participate):

Junior Award Winners: Elementary School

Day 1 Presentation of Action Plan:

■ 1st Place: Freedom 7 Elementary Team E

■ 2nd Place: Freedom 7 Elementary Team A

■ 3rd Place: Freedom 7 Elementary Team G

■ 4th Place: Freedom 7 Elementary Team F

■ 5th Place: Freedom 7 Elementary Team B

■ 6th Place: Sherwood Elementary Team C

Day 2 Presentation of Action Plan:

■ 1st Place: West Melbourne School for Science Team D

■ 2nd Place: Andersen Elementary Team E

■ 3rd Place: Holland Elementary Team C

■ 4th Place: Andersen Elementary Team C

■ 5th Place: West Melbourne School for Science Team C

■ 6th Place: Palm Bay Elementary Team A

GIPS Individual:

■ 1st Place: Lily, West Melbourne School for Science

■ 2nd Place: Rania, West Melbourne School for Science

■ 3rd Place: Aadhira, Freedom 7 Elementary

■ 1st Place: West Melbourne School for Science, Team B

■ 2nd Place: Andersen Elementary, Team A

■ 3rd Place: Andersen Elementary, Team C

■ 4th Place: Sherwood Elementary, Team A

■ 5th Place: West Melbourne School for Science, Team A

■ 6th Place: Holland Elementary, Team C

Schools Invited to State Championship:

■ West Melbourne School for Science

■ Andersen Elementary

■ Sherwood Elementary

■ Holland Elementary

■ Palm Bay Elementary

■ Ocean Breeze Elementary

■ Freedom 7 Elementary

■ Christa McAuliffe Elementary

Middle Award Winners: Middle School

Skit Winners:

■ 1st Place: West Shore Jr./Sr. High Team B

■ 2nd Place: Holy Trinity Episcopal Academy Team A

■ 3rd Place: West Shore Jr./Sr. High Team C

■ 4th Place: Edgewood Jr./Sr. High Team A

■ 5th Place: West Shore Jr./Sr. High Team A

■ 6th Place: Edgewood Jr./Sr. High Team B

Middle Individual:

■ 1st Place: Rahaa, West Shore Jr./Sr. High

■ 2nd Place: Aneeqa, West Shore Jr./Sr. High

■ 3rd Place: Tanya, West Shore Jr./Sr. High

■ 1st Place: West Shore Jr./Sr. High School, Team C

■ 2nd Place: West Shore Jr./Sr. High School, Team A

■ 3rd Place: West Shore Jr./Sr. High School, Team E

■ West Shore Jr./Sr. High

■ Andersen Elementary/Rockledge

■ Holy Trinity Episcopal Academy

Senior Award Winners: High School


■ 1st Place: Ashvika, West Shore Jr./Sr. High

■ 2nd Place: Nicholas, West Shore Jr./Sr. High

■ 1st Place: Edgewood Jr./Sr. High

■ 2nd Place: Holy Trinity Episcopal Academy

■ 3rd Place: West Shore Jr./Sr. High

■ Edgewood Jr./Sr. High

■ R.L. Stevenson Alumni

Brevard Public Schools Students Shine at the Florida Future Educators of America State Conference


solving problems for programming

Similar Stories

solving problems for programming


solving problems for programming

Click Here to Sign Up for Text Alerts

Or Signup Below For Email Alerts!

PhD Student Awarded Prestigious NIH Summer Internship Program

solving problems for programming

A doctoral student in the Department of Communication will participate in the National Institutes of Health (NIH) Summer Internship Program . 

Third-year Ph.D. student Ruth Heo is studying quantitative computational research methods.  Computational science is a branch of mathematics that using computing to solve complex problems.  Heo’s training will help her apply her research towards health-related issues. 

Heo will join a team led by Dr. Brenda Curtis with the NIH Technology and Translational Research Unit.  The Curtis Lab blends uses computational psychiatry to study the interactions between people who use drugs and their environments.  Curtis integrates social media and big data to form technology-based tools to help treat people living with substance abuse. 

As a social scientist, Heo will study social media messaging. 

“There’s lots of observational data from social media that leave digital traces all around,” Heo said.  “We’re recollecting it and applying computational methods like generating a model using natural language processing. We are tracking their posts to see whether their sentiments or some specific knowledge of their health issues can predict their health behavior.” 

Heo is eager to learn how computational methods are applied in the health realm.  She believes studying a person’s social media posts tends to yield better data about their health behaviors than relying only on self-reported data. 

“When a (person) is doing a clinical trial, we can't really predict whether they’ll make a good performance throughout it,” Heo said.  “So, we want to make a more accurate model using their social media posts. If we analyze their posts at the start and then compare their performance after the clinical trial and based on the language they use in their social media, that really predicts the outcome.” 

As an NIH summer intern, Heo will have access to professional development programs such as core competency training and educational and career advising.  Her internship will begin in June. Heo credits two mentors, Dr. Winson Peng from the Department of Communication and Dr. Serena Miller with the School of Journalism for their recommendations to the program. 

As she looks forward to her studies, Heo says she wants to shed light on this opportunity and urge others to follow. 

“I encourage the undergrads in ComArtSci to apply for this internship to get a chance to work with prominent researchers and pave their own path.” 

By: Kevin Lavery 

Singularities are a pain in the neck for robot arms — Jacobi Robotics is trying to solve them

solving problems for programming

It’s easy to lose track of the fact that robotics is as much a software problem as a hardware one. The programming understandably gets overshadowed by the alure of mechatronics, but without the proper software solution, you’ve got little more on your hands than an expensive paper weight. The road to widespread robotics adoption is fraught with unexpected problems that can ultimately hamper real-world use. There are plenty of problems in search of software solutions.

Jacobi Robotics was founded in 2022 with one specific problem in mind: singularities. Confusingly, the word means something wholly different to robotics than it does in the world of Ray Kurzweil’s AI advancement projection.

In robot-land the concept is far more subtle, while requiring some real knowledge of the category to fully understand. It’s the sort of term one rarely encounters outside of research papers. It is, however, a very real issue with real-world implications.

“Singularities are the Achilles’ heel for industrial robots,” Jacobi notes. “In repetitive tasks, where the robot follows the same motions repeatedly and blindly, robots can be programmed to avoid singularities through weeks of tedious manual fine-tuning of robot paths. But for many robot applications, the robot paths must be modified periodically due to small changes in materials or thermal expansion.”

If you’re at all familiar with robotics hardware, you’ve likely heard the term “degrees of freedom” in reference to, say, a robot arm with six or seven degrees of freedom. This refers to the system’s joints and the axes along which those joints are capable of moving. Singularities are points in space where the robot cannot move. When that happens, a human generally needs to intervene to get things up and running again.

Jacobi Robotics takes its name from the Jacobian matrix, which — in turn — is a reference to pioneering nineteenth century German mathematician, Carl Jacobi. In the world of robotics, the concept refers to the relationship between the velocities of joint and end effectors. To further simplify something I’ve already oversimplified, the concept and the company named after it are concerned with robot path planning.

Jacobi Robotics was founded by a quartet of UC Berkeley robotics students, along with professor Ken Goldberg. Along with serving as the company’s chief scientist, Goldberg is also a co-founder of package sorting robotics company Ambi Robotics, so he’s been through this rodeo before.

To start, the team is focused almost exclusively on the issues around singularities, which can stop a robot dead in its tracks at unpredictable times. In the world of robotic arms, this presents a big issue for key applications, like bin picking, package sort, palletizing — more or less the key things we talk about when we talk about industrial robots.

Jacobi has been in pilots with select partners. That list includes automation deployment firm Formic, as well as a larger consumer electronics firm the company isn’t quite ready to name just yet (you know how these sorts of things go in the corporate world). According to Formic, Jacobi’s approach to attacking singularities has significantly reduced deployment times, even in this early stage. It’s certainly in a startup like Formic’s best interest to address as many potential problems during the deployment process, rather than having to send technicians in after the fact.

Along with Goldberg, the company’s founders include CEO Max Cao, CPO Yahav Avigal, Chief Architect Lars Berscheid and Chief Roboticist Jeff Ichnowski (who also serves as an assistant professor at CMU’s Robotics Institute). Jacobi closed a $1 million pre-seed in early 2023 and is currently focused on raising a proper seed as it looks to bring its solution to market. Current investors include Swift Ventures and Berkeley SkyDeck, the UC Berkely accelerator, which included the startup as part of recent demo day.

The software currently offers support for a number of the biggest robotics arms vendors, including ABB, Fanu, Universal and Yaskawa.


  1. 6 Ways to Improve Your Programming Problem Solving

    solving problems for programming

  2. Six Steps to Solving a Programming Problem Infographic

    solving problems for programming

  3. programming steps to solve problems

    solving problems for programming

  4. Problem Solving In Programming

    solving problems for programming

  5. How to Solve Linear Programming (LP) Problems Using Python

    solving problems for programming

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

    solving problems for programming


  1. Vid03 Problem formulation and Integer Linear Programming

  2. LN1 Ch2 Beginning Problem Solving Concepts I 1

  3. Programming and Problem Solving Revision 3 (9-12)

  4. C++ & Problem Solving Course

  5. Problem Solving

  6. Grinding in Leetcode #maths #python


  1. Problems

    Study Plan See all Array 1553 String 668 Hash Table 551 Dynamic Programming 481 Math 479 Sorting 370 Greedy 345 Depth-First Search 284 Binary Search 253 Database 247 Breadth-First Search 226 Tree 224 Matrix 213 Two Pointers 192 Bit Manipulation 189 Binary Tree 172 Heap (Priority Queue) 159 Stack 151 Prefix Sum 147 Graph 139 Simulation 137

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

    Very Easy Convert Minutes into Seconds Write a function that takes an integer minutes and converts it to seconds. Examples convert (5) 300 convert (3) 180 convert (2) 120 Notes Don't forget to return the result. If you get stuck on a challenge, find help in the Resources tab. If you're really stuck, unlock solutions in the Solutions tab.

  3. 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.

  4. Online Coding Practice Problems & Challenges

    Practice C++ Practice problems of C++, the language most used for DSA and low level programming due to its efficiency and speed. 67 Problems Beginner level Practice Python Practice Python problems, the language known for its simplicity and readability making it the best language for beginners. 68 Problems Beginner level Practice Java

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

    There are four steps to the problem-solving method: Understand the problem. Devise a plan. Carry out the plan. Look back. Let's get started with step one. Step 1: Understand the problem. When given a coding problem in an interview, it's tempting to rush into coding. This is hard to avoid, especially if you have a time limit.

  6. Codewars

    codewars IS BUILT ON. The world's most advanced coding assessment platform for organizations looking to scale their hiring, upskilling, and certification programs. 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!

  7. 10 Steps to Solving a Programming Problem

    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.

  8. Programming Tutorials and Practice Problems

    Solved 331 Problems 0% Data Structure Master important data structures. 0 Solved 360 Problems 0% Algorithms All you need to know about important algorithms. 0 Solved 977 Problems 0% Math Explore all the maths needed for your programming journey. 0

  9. Programming Problems and Competitions :: HackerRank

    Problem Solving (Basic) Get Certified Python (Basic) Get Certified Stand out from the crowd Take the HackerRank Certification Test and make your profile stand out View all certifications Prepare By Topics Algorithms Data Structures Mathematics Artificial Intelligence C C++ Java Python Ruby SQL Databases Linux Shell Functional Programming Regex

  10. Java Programming: Solving Problems with Software

    There are 5 modules in this course. Learn to code in Java and improve your programming and problem-solving skills. You will learn to design algorithms as well as develop and debug programs. Using custom open-source classes, you will write programs that access and transform images, websites, and other types of data.

  11. How to think like a programmer

    Big and small. How we deal with them is sometimes, well…pretty random. Unless you have a system, this is probably how you "solve" problems (which is what I did when I started coding): Try a solution. If that doesn't work, try another one. If that doesn't work, repeat step 2 until you luck out. Look, sometimes you luck out.

  12. Solve C

    Printing Pattern Using LoopsMediumC (Basic)Max Score: 30Success Rate: 95.92%. Solve Challenge. Join over 16 million developers in solving code challenges on HackerRank, one of the best ways to prepare for programming interviews.

  13. Problem Solving

    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.

  14. Solve Java

    Java Static Initializer BlockEasyJava (Basic)Max Score: 10Success Rate: 96.17%. Solve Challenge. Join over 16 million developers in solving code challenges on HackerRank, one of the best ways to prepare for programming interviews.

  15. 3 Tips to Solve Problems Like an Expert

    Apr 2, 2021 -- 11 Photo by Denise Jans on Unsplash "How can I get better at solving problems? I understand JavaScript now, but I can't really solve problems or understand any complicated JavaScript code, " asked me recently young developer on my contact list.

  16. 5 Steps to Solving Programming Problems

    Solving programming issues improves your ability to solve real-world problems, and if you're excellent at them, programming may come easy to you. 1. Read the problem several times until you can explain it to someone else You can't solve a problem you don't understand.

  17. Python Exercises, Practice, Challenges

    These free exercises are nothing but Python assignments for the practice where you need to solve different programs and challenges. All exercises are tested on Python 3. Each exercise has 10-20 Questions. The solution is provided for every question. Practice each Exercise in Online Code Editor. These Python programming exercises are suitable ...

  18. A Guide to Problem-Solving for Software Developers with Examples

    It's even better if the members of the team are used to swim in uncertainty, and take it as a challenge more than a chore. The process described above is just an example; in practice it's often more chaotic. For example, even when a decision is made, your brain might still continue to process the problem passively.

  19. How to Develop Problem Solving Skills in Programming

    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.

  20. Simple Programming Problems

    Several small problems Programming Practice; CPE 101 Projects; Code Kata; 99 Lisp Problems, 99 Haskell Problems. Most of these can also be done in other languages. Rosetta Code Programming Tasks. These come with solutions in many languages! Code Golf Challenges. The goal here is to solve the problem with as few characters as possible. SPOJ ...

  21. Programming Tutorial

    Algorithm design: Develop a step-by-step procedure for solving the problem. Coding: Translate the algorithm into a programming language using a text editor or integrated development environment (IDE). Testing and debugging: Run the program and identify and fix any errors. Deployment: Share the program with others or use it for your own purposes.

  22. Programming: The New Life Skill

    Programming Teaches You Problem-Solving. Programming as a subject requires us to break down a challenge into smaller, solvable parts and then tackle each part to develop a viable solution. Writing ...

  23. Solving goal programming problem with MATLAB

    Please, can someone help me chech what is wrong with my code for the problem below: Question: Solve the following goal programming problem given below objective 1 (yield goal) 208*x(1)^0.3231...

  24. Solving Cropping Pattern Optimization Problems Using Robust ...

    The second stage involves solving the linear programming model and determining the dual values or shadow prices of constraints. ... (2000) Robust solutions of linear programming problems contaminated with uncertain data. Math Program 88(3):411-424. CrossRef MathSciNet Google Scholar Bertsimas D, Sim M (2004) The price of robustness. Oper Res ...

  25. The Most Popular Coding Challenge Websites

    Programmers need to deal with all sorts of problems almost every day. Most importantly, solving problems in an efficient manner can make you much more productive. And solving challenging problems helps us do that. You can watch this complete video on YouTube as well if you like 🎥 The 21 Most Popular Coding Challenge Websites

  26. Solving Bilevel Programs Based on Lower-Level Mond-Weir Duality

    This paper focuses on developing effective algorithms for solving a bilevel program. The most popular approach is to replace the lower-level problem with its Karush-Kuhn-Tucker conditions to generate a mathematical program with complementarity constraints (MPCC).

  27. Find the AI Approach That Fits the Problem You're Trying to Solve

    Summary. AI moves quickly, but organizations change much more slowly. What works in a lab may be wrong for your company right now. If you know the right questions to ask, you can make better ...

  28. Brevard Public Schools Future Problem Solving Competition Crowns

    Future Problem Solving is a renowned program that teaches students a six-step problem-solving process for real-world challenges, enhancing decision-making, and critical and creative thinking skills.

  29. PhD Student Awarded Prestigious NIH Summer Internship Program

    A doctoral student in the Department of Communication will participate in the National Institutes of Health (NIH) Summer Internship Program.. Third-year Ph.D. student Ruth Heo is studying quantitative computational research methods. Computational science is a branch of mathematics that using computing to solve complex problems.

  30. Singularities are a pain in the neck for robot arms

    It's easy to lose track of the fact that robotics is as much a software problem as a hardware one. The programming understandably gets overshadowed by the alure of mechatronics, but without the ...