# Knowledges about Java 【Interview preparation】

Introduction This article is for my preparation of technical interview. And this focuses on programming language “Java”. final keyword The final keyword in Java has different meaning depending on whether it is applied to a variable, class …

# Maximum Size Subarray Sum Equals k

Problem discuss.leetcode.com Solution This problem can be solved by using HashMap effectively. First, we store each sum of range from 0 to i (0 <= i < N). While we traverse the array, we check if the (sum - k) is stored in HashMap. If the …

# Count Path Sum in Binary Tree

Problem You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not need to start or end at the root or a leaf, but it must go downwards (traveling only fr…

# LRU Cache

Problem leetcode.com Solution This problem can be solved by Double Linked List and HashMap. Source Code

What’s HashMap HashTable is a data structure used to implement an associative array, a structure that can map keys to values. A hash table uses a hash function to compute an index into an array. Hash table - Wikipedia Structure Of HashMap …

# Sort an array of strings by anagrams

Problem Write a method to sort an array of strings so that all the anagrams are next to each other. Solution This problem asks us to group the strings in arrays such that anagrams appear next to each other. How to find the anagram The feat…

# If the string is a permutation of another string

Problem Given two strings, write a method to decide if one is a permutation of the other. How to Solve In oder to count of the number that how many times each characters appeared, I use array like HashMap. In case the given strings is ASCI…

# 316. Remove Duplicate Letters : Past Google Coding Interview

Problem leetcode.com How to Solve This problem is solved by the following steps. find out index that each letter appears int the last position have the indexes calculating at step 1 in a array sort the arrays created at step2 4 check the s…