• 28 September

    Minimum Number of Platforms Required for A Railway Station

    If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. 1. Introduction to Problem You are given arrival and departure time of trains reaching to a particular station. You need to find minimum number of platforms required to accommodate the trains at any point of time. […]

  • 26 September

    Find the number occurring odd number of times in an array

    If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. In this post, we will see how to find number occurring odd number of times in the array. Problem: You are given a array of integer. All numbers occur even number of times except one. You […]

  • 24 September

    Java Program to Find Second Largest Number in An Array

    If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. 1. Overview In this post, we will see how to find the second largest number in an array. This is a one of common interview questions on array data structure. 2. Introduction to Problem Statement Given […]

  • 20 September

    Find length of Linked List in java

    If you want to practice data structure and algorithm programs, you can go through data structure and algorithm programs. In this post, we will see how to find length of Linked List in java. You can obviously use size() method of java Linked List class but here we are going to see how to find length […]

  • 20 September

    Implement singly linked list in java

    In this post, we will see how to implement singly linked list in java. It is one of the most used data structure. In singly linked list, Node has data and pointer to next node. It does not have pointer to the previous node. Last node ‘s next points to null, so you can iterate […]

  • 18 September

    Search an Element in A Sorted and Rotated Array in Java

    If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. 1. Overview In this post, we will see how to search an element in sorted and rotated array. 2. Introduction to Problem Statement We are given an sorted and rotated array as below: [crayon-67685007298de306345144/] Our goal […]

  • 16 September

    Java Program to Find Missing Number in An Array

    If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. 1. Overview In this article, we will see how to find missing number in Array of 1 to n. This is one of basic coding interview question asked in my interviews. 2. Introduction to Problem Statement […]

  • 15 September

    Check for balanced parentheses in an expression in java

    If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. In this post, we will see how to check for balanced parentheses in an expression. Lets say, you have expression as a*(b+c)-(d*e) If you notice, above expression have balanced parentheses. Lets take another expression as (a*(b-c)*(d+e) If you observe, […]

  • 15 September

    Longest Common Prefix in an array of Strings in java

    If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. In this post, we are going to see longest common prefix in array of Strings. So lets say you have string array as below: [crayon-6768500729ce5171088582/] So Longest common prefix in above String array will be “java” […]