## Check if Array is Consecutive Integers

Objective: Given a array of unsorted numbers, check if all the numbers in the array are consecutive numbers. Examples: int [] arrA = {21,24,22,26,23,25}; – True (All the integers are consecutive from 21 to...

Skip to content# Category: Software Development Engineer in Test

## Check if Array is Consecutive Integers

## Find the subarray with sum to a Given Value.

## Find intersection between Two Sorted Arrays.

## Print All The Nodes Which are X distance from the Given Node

## Sorted Array to Binary Search Tree of Minimal Height

## Delete a Node in the Middle of a linked list, Given only access to that Node

## Find the n’th Node from the end of a given Linked List

## Check if one string is Rotation of another string

## Reverse a Linked List

## Print All Elements of Two Dimensional Array in Spiral

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

## Find Whether Given String is palindrome or Not.

## Find two Missing Numbers in a Sequence of Consecutive Numbers

@tutorialhorizon

Objective: Given a array of unsorted numbers, check if all the numbers in the array are consecutive numbers. Examples: int [] arrA = {21,24,22,26,23,25}; – True (All the integers are consecutive from 21 to...

Objective: Given an array (non-negative) and an integer, Find the Subarray whose sum is equal to the given integer. Examples: int[] arrA = { 25, 12, 14, 22, 19, 15, 10, 23 }; Integer...

Objective: Given two sorted arrays, Find intersection point between them. Examples: int[] a = { 1, 2, 3, 6, 8, 10 }; int[] b = { 4, 5, 6, 11, 15, 20 }; Output:...

Objective: – Given Binary Tree, Print All The Nodes Which are X distance from the Given Node. Example : Approach: Quite Tricky solution, i will explain using the example given in the picture.

Objective: Given a sorted array with unique elements, Create a binary search tree with minimal height. Why minimal height is important : We can do the linear scan to the array and make the...

Objective: Write a program to Delete a Node in the Middle of a linked list, Given only access to that Node Example: Original List : ->1->2->8->3->7->0->4 After Deleting the mid node (say 7) :...

Objective: Given a linked list and integer ‘n’, write an algorithm to find the nth node from the end in the Linked List. Example: Original List : ->1->2->8->3->7->0->4 Output : 3rd Element from the...

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

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

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

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

Objective : Write an algorithm to find Whether Given String is palindrome or Not. Input: A String, Output: true or false on whether string is palindrome or not Approach: Use recursive approach Compare first...

Objective : Write an algorithm to find two Missing Numbers in a Sequence of Consecutive Numbers Input: Array, arrA[] with two missing numbers and Range Output : Two missing numbers Approach: Approach is very...

%d bloggers like this: