Write a program to find maximum subarray sum in an array. Given an array of N elements, find the maximum possible sum of a contiguous subarray. An array can contain both positive and negative values.

### Categories

### Interview Questions

Technology Blog Where You Find Programming Tips and Tricks

Write a program to delete a node at Nth position from Linked List. Given a linked list, we have to write a method to delete a node from Nth position.

Recursion vs Iteration. What’s the difference between recursion and iteration. Recursion and Iteration both are two different programming approaches. In some cases recursion is best suited and in some other cases iterative way of programming is good.

In programming, repeated set of instructions can be handled either by using recursive or iterative approach in your code. So which approach you choose and why. Let’s talk about recursion vs iteration.

Write a program to implement a queue using an array. In this tutorial, You are going to learn about Queue data structure and their implementation using an array in C, C++ & Java. In my previous posts, I have explained Stack and Linked List data structure.

In Queue data structure, An element is inserted at one end called **rear** and deleted at other end called **front.** As compared to stack data structure in which insertion and deletion are allowed only at one end. Queue data structure is also called **FIFO (First In First out)**.

Write a Java program to check prime number. Given an input integer, We have to write an efficient code to check whether a number is prime or not.

Before writing a program, let’s quickly understand what is a prime number.

A prime number is a number that is greater than 1 and it has no positive divisors other than 1 and itself.

For example – 3, 13, 7 is a prime number, as it’s divisible by 1 and itself. Similarly, 29, 19 etc. are also prime numbers.

6 is not a prime number as it’s divisible by 1, 2, 3 and 6.

2 is the only even prime number.

Write a program to print factorial of a number in PHP. In this tutorial, We are going to write a PHP code to print factorial of a number using iterative as well as recursive approach. Before solving this problem let’s understand what is factorial.

Given **two sorted arrays**, Write a code to find common elements in two arrays. In other words, we have to write a code to find the intersection of two arrays.

Let’s assume following two sorted arrays arr1[] and arr2[].

int arr1[] = {2, 3, 4, 5, 6};

int arr2[] = {4, 6, 7, 8, 9};

Write an efficient program to generate prime numbers between 1 to N (Where N is 10, 100, 1000 etc). This question can also be asked like this, Generate prime numbers between 1 to 100 or 1 to 10 etc.

Suppose the value of N is 10, So the prime numbers between 1 to 10 is 2, 3, 5, 7. Now let’s learn the most efficient algorithm (**Sieve of Eratosthenes**) to generate Prime Numbers between 1 to N. Before solving this program, let’s understand what is a prime number.