0% found this document useful (0 votes)
91 views6 pages

Find Position of An Element in A Sorted Array of Infinite Numbers - Geeksforgeeks

The document lists various algorithms and data structures commonly used in coding interviews. It covers arrays, stacks, linked lists, strings, bit manipulation, trees, and miscellaneous topics. For arrays, it includes problems such as finding missing/duplicate elements, rotating arrays, and searching sorted matrices. Stack problems include implementing queues with stacks and merging intervals. Linked list problems involve finding loops/intersections and merging/reversing lists. String questions cover permutations, anagrams, and palindromes. Tree traversals, views, paths, and binary search are also listed.

Uploaded by

Irene Sultana
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
91 views6 pages

Find Position of An Element in A Sorted Array of Infinite Numbers - Geeksforgeeks

The document lists various algorithms and data structures commonly used in coding interviews. It covers arrays, stacks, linked lists, strings, bit manipulation, trees, and miscellaneous topics. For arrays, it includes problems such as finding missing/duplicate elements, rotating arrays, and searching sorted matrices. Stack problems include implementing queues with stacks and merging intervals. Linked list problems involve finding loops/intersections and merging/reversing lists. String questions cover permutations, anagrams, and palindromes. Tree traversals, views, paths, and binary search are also listed.

Uploaded by

Irene Sultana
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 6

Arrays

1) Dutch national flag problem

2) Kadane's algorithm

3) Moore's voting algorithm

4) Rotate an array and find an element in rotated sorted array

5) Find missing element in array(XOR technique)

6) Find median of two sorted array

7) Merge two sorted array

8) Find the next greater digit with same set of digits

9) Check if a number is palindrome (check the code on leetcode)

10) Search an element in sorted matrix.

11) Rotate an image by 90 degree(code in cracking coding interview book)

12) Print a matrix in spiral form(code in cracking coding interview book)

13) Find the index of 1 in an array with 0 and 1 infinitely (Find position of an element in a
sorted array of infinite numbers - GeeksforGeeks)

14) Binary search in array (recursive and iterative)

Stacks

1) Convert inorder to postorder and evaluate the postorder

2) Balanced parenthesis

3) design an array which supports constant time(O(1)) push,pop, min.


(http://www.geeksforgeeks.org/design-and-implement-special-stack-data-structure/)

4) Implement queue with 2 stacks

5) Implement stack with array and linked list

6) Implement two stack in array (http://www.geeksforgeeks.org/implement-two-stacks-in-


an-array/)
7) Merge overlapping interval(http://www.geeksforgeeks.org/merging-intervals/)

Linked list

1) Find loop in the linked list

2) Find the lenght of the loop in the linked list

3) Find the intersection of two linked list(http://www.geeksforgeeks.org/write-a-function-to-


get-the-intersection-point-of-two-linked-lists/)

4) Merge two sorted linked list (Merge two sorted linked lists - GeeksforGeeks)

5) Reverse linked list(recursive and iterative)

6) Clone a linked list with random pointer

7) Add numbers represented by two Linked list

Strings

1) Return maximum occurring character in the input string

2) Remove all duplicates from a given string

3) Reverse words in a given string

4) Reverse a string

5) Given a string, find its first non-repeating character

6) Write a program to print all permutations of a given string

7) A Program to check if strings are rotations of each other or not

8) Check if two strings are anagram

9) Check if string is palindrome

Bit manipulation

1) Check if a number is power of two.(http://www.geeksforgeeks.org/write-one-line-c-


function-to-find-whether-a-no-is-power-of-two/)

2) Little and Big Endian Mystery

3) Position of rightmost set bit


4) Find whether a given number is a power of 4 or not

5) Add two numbers without using arithmetic operators

Tree

1) Tree traversal(inorder, preorder, postorder)

2) Level order traversal

3) Count the number of leaves in tree

4) Height and diameter of a tree

5) left top bottom right view of a tree'

6) Root to leaf sum path

7) print all the root to leaf path

General

1) Sieve of erathoness for prime numbers


Array Coding Interview Questions

Here are some of the popular array-based coding interview questions for your practice:

1. How do you find the missing number in a given integer array of 1 to 100?
2. How do you find the duplicate number on a given integer array?
3. How do you find the largest and smallest number in an unsorted integer array?
4. How do you find all pairs of an integer array whose sum is equal to a given
number?
5. How do you find duplicate numbers in an array if it contains multiple duplicates?
6. How are duplicates removed from a given array in Java?
7. How is an integer array sorted in place using the quicksort algorithm?
8. How do you remove duplicates from an array in place?
9. How do you reverse an array in place in Java?
10. How are duplicates removed from an array without using any library?

Linked List Programming Interview Questions


Here are some of the most common and popular linked list interview questions and their
solutions:

11. How do you find the middle element of a singly linked list in one pass?
12. How do you check if a given linked list contains a cycle? How do you find the
starting node of the cycle?
13. How do you reverse a linked list?
14. How do you reverse a singly linked list without recursion?
15. How are duplicate nodes removed in an unsorted linked list?
16. How do you find the length of a singly linked list?
17. How do you find the third node from the end in a singly linked list?
18. How do you find the sum of two linked lists using Stack?

String Coding Interview Questions


Here is my list of frequently asked string coding questions from programming job
interviews:

19. How do you print duplicate characters from a string?


20. How do you check if two strings are anagrams of each other?
21. How do you print the first non-repeated character from a string?
22. How can a given string be reversed using recursion?
23. How do you check if a string contains only digits?
24. How are duplicate characters found in a string?
25. How do you count a number of vowels and consonants in a given string?
26. How do you count the occurrence of a given character in a string?
27. How do you find all permutations of a string?
28. How do you reverse words in a given sentence without using any library method?
29. How do you check if two strings are a rotation of each other?
30. How do you check if a given string is a palindrome?

Binary Tree Coding Interview Questions


31. How is a binary search tree implemented?
32. How do you perform preorder traversal in a given binary tree?
33. How do you traverse a given binary tree in preorder without recursion?
34. How do you perform an inorder traversal in a given binary tree?
35. How do you print all nodes of a given binary tree using inorder traversal without
recursion?
36. How do you implement a postorder traversal algorithm?
37. How do you traverse a binary tree in postorder traversal without recursion?
38. How are all leaves of a binary search tree printed?
39. How do you count a number of leaf nodes in a given binary tree?
40. How do you perform a binary search in a given array?

Miscellaneous Coding Interview Questions


41. How is a bubble sort algorithm implemented?
42. How is an iterative quicksort algorithm implemented?
43. How do you implement an insertion sort algorithm?
44. How is a merge sort algorithm implemented?
45. How do you implement a bucket sort algorithm?
46. How do you implement a counting sort algorithm?
47. How is a radix sort algorithm implemented?
48. How do you swap two numbers without using the third variable?
49. How do you check if two rectangles overlap with each other?
50. How do you design a vending machine

You might also like