Strings - Backspace String Compare using JAVA Stack

Question: Given two Strings S and T, return true if they equal when both are typed out any "#" will be treated as backspace. input - S -> ab#c, T -> az#c output - True Constraints need to ask because solution may change according to given constraints Question: What happens when 2 or multiple "#" appear besides each other? Answer: Delete same number of values before 1st "#". Ex- ab## -> "" Question: What happen to "#" when there is no character to remove? Answer: It deletes nothing. Ex- a###b -> "b" Question: Are two empty Strings equals each other? Answer: Ex- S -> a#b#c#, T -> c#. Both returns empty string and output will be true. Question: Does case sensitivity matters? Answer: Yes. Ex- A is different from a. S -> ab#c, T -> Az#c. Output - False Solution using JAVA language. BruteForce Approach - This is simple approach, We are using JAVA Stack here,...

Data Structure Interview Questions - FAANG Interview Questions

 Data Structures plays most important role in software engineer interview process. Although there are a numbers of interview rounds needed to be passed for selecting in big company (Facebook, Amazon, Apple, Netflix, Google etc.) but surely there are some rounds for data structure. Some of the data structures developers never use in their projects but they must have knowledge of  most of them 

Interviewer ask data structure questions because to test any candidate's computer science basics knowledge and problem solving skills data structure problems are the easiest and most efficient way.

Let's see what are the most important data structures and corresponding problems which we can solve and crack software engineer interviews: 

  1. Arrays
    1. Two Sum - Question with Optimal and Brute Force Solution
    2. Container with most water - Question with Optimal and Brute Force Solution
    3. Trapping Rainwater - Question with Optimal SolutionBrute Force Solution
  2. Strings
    1. Typed Out Strings
    2. Longest Substrings without repeating characters
    3. Validate Palindrome and Almost Palindrome
  3. Linked List
    1. Reverse a Linked List
    2. M, N Reversal
    3. Merge Multi Level Doubly Linked List
    4. Cycle Detection
  4. Stacks
    1. Validate Parentheses
    2. Minimum Brackets to remove
  5. Queues
    1. Implement Queue with stack
  6. Binary Trees
    1. Maximum Depth of Binary Tree
    2. Level Order of Binary Tree
    3. Right side view of Binary Tree
    4. Number of Nodes in complete Binary Tree
  7. Binary Search Tree
    1. Validate Binary Search Tree
  8. Hash  Tables
    1. Hash Functions
    2. Hash Collisions
    3. Hash Table vs Arrays
  9. Heaps and Priority Queues
  10. 2D Array
    1. Representation and Traversal of 2D Array
    2. Number of Islands
    3. Rotting Oranges
    4. Walls and Gates
  11. Graphs
    1. Representation and Traversal of Graphs
    2. Time needed to inform all Employees
    3. Course Scheduler
    4. Network Time Delay
  12. Searching 
    1. DFS (Depth First Search)
    2. BFS (Breadth First Search)
  13. Sorting 
    1. Bubble Sort
    2. Selection Sort
    3. Merge Sort
    4. Insertion Sort
    5. Quick Sort
  14. Recursive Programming
    1. Recursion Introduction
    2. Stack Overflow
    3. Recursion vs Iteration
    4. Sorting and Hoare's Quick Select
    5. Binary Search
    6. Start and End of Target in Sorted Array
  15. Dynamic Programming
    1. Minimum cost of climbing stairs
    2. Knight Probability in Chess Board
    3. Sudoku Solver

Comments

Popular posts from this blog

Arrays - Trapping Rainwater - Optimal Solution using 2 Pointer Approach

Arrays - Container with Most Water

Strings - Backspace String Compare using JAVA Stack