This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
621. Task Scheduler | |
https://leetcode.com/submissions/detail/476271316/ | |
Solution : | |
public static int leastInterval2(char[] tasks, int n) { | |
Integer[] taskOccurence = new Integer[26]; | |
Arrays.fill(taskOccurence, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1)URL Shortening Service like tiny URL | |
https://www.educative.io/courses/grokking-the-system-design-interview/m2ygV4E81AR | |
(2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.educative.io/courses/grokking-the-behavioral-interview/N0WMEjEQqYN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ajay.volatile_example; | |
public class VolatileTest { | |
private static volatile int MY_INT = 0; | |
public static void main(String[] args) { | |
new ChangeListener().start(); | |
new ChangeMaker().start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://overthewire.org/wargames/maze/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyProgram { | |
public static void main(String[] args) { | |
// Create an 'MyObject' for the first time the application started | |
MyObject obj = new MyObject(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cloning is not automatically available to classes. There is some help though, as all Java objects inherit the protected Object clone() method. This base method would allocate the memory and do the bit by bit copying of the object's states. | |
You may ask why we need this clone method. Can't we create a constructor, pass in the same object and do the copying variable by variable? An example would be (note that accessing the private memberVar variable of obj is legal as this is in the same class): | |
public class MyObject { | |
private int memberVar; | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oracle provides these transaction isolation levels. | |
Read committed | |
Serializable | |
Read Only | |
-------------------- | |
https://docs.oracle.com/cd/B14117_01/server.101/b10743/consist.htm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://leetcode.com/problems/erect-the-fence/description/ | |
import java.util.ArrayList; | |
import java.util.HashSet; | |
import java.util.List; | |
/** | |
* Created by ajaykumar.yadav on 11/09/18. | |
**/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1) | |
What are JavaScript Data Types? | |
Following are the JavaScript Data types: | |
Number | |
String | |
Boolean | |
Function | |
Object |
NewerOlder