Sometimes, we would like to wait a certain minimum time period before successive method calls. For example in events like onscroll(), onresize(), this can go a long way in terms of optimizing the page performance as a whole.… Read more →
Category: interview
-
Minimum Window Substring – Java
The brute force method would be calculate all the substrings, which would be inefficient. Runtime Complexity O(m + n) Space Complexity O(m+n) Read more →
-
K Empty Slots – Java
K Empty Slots – Java — clean Java solution and code implementation for software engineering interview preparation. Read more →
-
Top K Frequent Elements – Java
Top K Frequent Elements – Java — clean Java solution and code implementation for software engineering interview preparation. Read more →
-
Reverse Words in a String – Java
Using a Stack Uses O(n) memory and time. Efficient Solution Memory O(1) and O(n) time. Using built-in java methods Read more →
-
Generate Parenthesis
Generate Parenthesis — clean JavaScript solution and code implementation for software engineering interview preparation. Read more →
-
Sort Array by Parity – Java
This solution runs in 0(n) time (linear) and uses O(1) space (constant) and is based on the Dutch National Flag Problem. Read more →
-
Two Sum
Two Sum — clean Java solution and code implementation for software engineering interview preparation. Read more →
-
Search in Rotated Sorted Array
Solution uses a modified version of Binary Search.Javascript (ES6) DemoJava Time: O(nlogn)Space: O(1) Read more →