# Category: Software Development Engineer (SDE)

## Remove Duplicates from an Unsorted Linked list

Objective: Write a program to remove the duplicates from an unsorted linked list Example: Input Linked List : 1->2->2->4->3->3->2 Output : 1->2->4->3 Input: An unsorted linked list Output: Linked list with no duplicates. Approach:...

## Check if one string is Rotation of another string

Objective: Write an algorithm to check if one string is Rotation of another string. This question has been asked in the Amazon interview. Example: Input Strings : ‘sumitjain’ and ‘tjainsumi’ Output : true Input...

## String Compression using count of repeated characters – Run Length Encoding

Objective: Write an algorithm to compress the given string by using the count of repeated characters and if new compressed string length is not smaller than the original string then return the original string....

## Replace all spaces in a String with ‘%20’

Objective: Write an algorithm to replace all spaces in a given string with ‘%20’. You can consider that string has enough space at the end of the string to hold the extra characters. Input:...

## Find Whether Two Strings are Permutation of each other

Objective: Given Two Strings, check whether one string is permutation of other Input: Two Strings Output: True or false based on whether strings are permutation of other or not. Example: “sumit” and “tiums” are...

## Find Intersection Point in Two Linked List

Objective: Given Two linked list, check whether both list intersect each other, if yes then find the starting node of the intersection. Intersection point means end of one linked list is linked with some...

## Find the Loop in a Linked list, find its length and Break the Loop

Objective: In a given linked list, check whether it contains the loop in it, if yes then find the Loop length and break the loop. Loop in a linked list means the last node...

Objective: Reverse the given linked list. Input: A Linked List Output: Reversed Linked List Example: Input : ->30->25->20->15->10->5 Reversed : ->5->10->15->20->25->30 NOTE : Click Reverse a Linked List – Part 2 to see the...

## Count All Paths from Top left to bottom right in Two Dimensional Array including Diagonal Paths

Objective: Count all the paths from left top corner to right bottom corner in two dimensional array. Input: Two Dimensional array Output: No of paths. Approach : 1. Recursive Recursive solution to this problem...

## Print All Paths from Top left to bottom right in Two Dimensional Array

Objective: Print all the paths from left top corner to right bottom corner in two dimensional array. Input: Two Dimensional array Output: Print all the paths. Note: At the End of the article you...

## Merge or Combine Two Sorted Linked Lists

Objective: Given two sorted linked lists, objective is to merge both the lists in sorted order. Input: Two sorted linked list List a, List b. Example: List a : ->2->6->18 Listb: ->1->3->17->19 Merged List:...

## Rearrange Positive and Negative Numbers of Array On Each Side in O(nlogn)

Objective: Rearrange Positive and Negative Numbers of an Array so that one side you have positive numbers and other side with negative Integers without changing their respective order. Example : Input :  1 -2...

## Find The Longest Sequence Of Prefix Shared By All The Words In A String

Objective: Write an algorithm to find The Longest Sequence Of Prefix Shared By All The Words In A String. This interesting problem was asked in the Google interview for software engineer. This problem is...

## Print All Elements of Two Dimensional Array in Spiral

Objective: This question was asked in Amazon interview for the Software development Engineer position, Write an algorithm to print all the elements of two dimensional array in spiral. Example : Input: Two dimensional array...

## Find a pair of numbers from an array whose sum equals k

Objective: Write an algorithm to find out whether in a given array there exists or not two numbers whose sum is exactly equals to a given number. This problem has been asked in Amazon...