Looking for good programming challenges?

Use the search below to find our solutions for selected questions!

Time series queries challenge

Problem statement A time series is a series of data points indexed in time order. They are commonly used in the financial world, especially in stock markets. In this challenge you are working with a time series of stock prices. You are given historical records where the stock at time . . . Read more

Longest valid parentheses challenge

Problem statement Given a string containing just the characters ( and ), find the length of the longest valid (well-formed) parentheses substring. Sample input

Sample output

Sample input 1

Sample output 1

Solution We will solve this problem using a Stack. We are going to iterate . . . Read more

BMW software engineer interview experience in Munich

Disclaimer: The experiences (e.g. BMW software engineer interview experience) mentioned in this blog were submitted by readers anonymously. It is by no means the intention of this blog to smear the companies mentioned. Rather the sole purpose is to give prospective candidates the opportunity to gain insight information on working . . . Read more

Search for a range challenge

Problem statement Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. If the target is not found in the array, return . Sample input

Sample output


Upgrading to PHP 7 on Amazon Linux EC2 Instance

By now you may know that PHP 7 has been available for quite some time now coming with a number of improvements over version 5. It may be wise to upgrade to PHP7 when running for instance a WordPress using Amazon AWS where you are responsible for any upgrades. Also . . . Read more

Trapping rain water challenge

Problem statement Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. Sample input

Sample output

Solution We can solve this problem in time by iterating over the array twice. Once . . . Read more

Letter combinations of a phone number challenge

Problem statement Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Sample input

Sample output


Search in rotated sorted array challenge

Problem statement Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., might become ). You are given a target value to search. If found in the array return its index, otherwise return . You may assume no duplicate exists in the array. . . . Read more

Zigzag conversion challenge

Problem statement The string PAYPALISHIRING is written in a zigzag pattern on a given number of rows like this:

And then read line by line: PAHNAPLSIIGYIR. Write the code that will take a string and make this conversion given a number of rows: Sample input

Sample output

. . . Read more

Next permutation challenge

Problem statement Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order). The replacement must be in-place, do not allocate extra memory. Here are some examples. . . . Read more