- Head to https://docs.docker.com/docker-for-mac/
- Download the latest docker binary from https://download.docker.com/mac/stable/Docker.dmg
- Install it (drag and drop)
- Go to applications, and click on the Docker icon, it will walk you through the rest of the setup.
- You can notice the docker whale animating in the toolbar at the top right of your mac as it initalizes.
- You can click that whale to see the current status of docker engine.
- What has been installed is the docker engine (to manage and run containers), docker machine (the host) and docker compose.
- We will also need virtualbox, so install it from https://www.virtualbox.org/wiki/Downloads
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
import java.util.Stack; | |
public class Bucket { | |
private Stack<Long> stack = new Stack<Long>(); | |
private int MAX_SIZE = 20; | |
public Long consume(){ |
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 ArraySum { | |
private int[] array = new int[]{1,2,3,4,5,6,7,8,9}; | |
/** | |
* Do any 2 add up to this number | |
* @param number | |
* @return | |
*/ | |
public boolean canAdd(int number){ |
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 WaitNotifyExample { | |
public static void main(String[] args) { | |
Integer lock = new Integer(0); | |
Thread waiter = new Thread(new Waiter(lock)); | |
waiter.start(); | |
Thread notifier = new Thread(new Notifier(lock)); | |
notifier.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
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.Map; | |
public class ArraySumWithMap { | |
private Map<Integer, Integer> numbers = new HashMap<Integer, Integer>(); | |
/** |
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 static String binary(int input){ | |
StringBuilder builder = new StringBuilder(); | |
int numerator = input; | |
while(true){ | |
int divisor = numerator/2; | |
int remainder = numerator%2; | |
builder.append(remainder+""); | |
numerator = divisor; | |
if(divisor==1){ | |
builder.append("1"); |
- Can start an AMI to create any number of on-demand instances by using the RunInstances call. Default max is 20 per account.
- If the request is good, the RunInstances call returns success with a list of DNS names, and instances begin to launch within 10 minutes.
- The launch request is associated with a reservation ID. One reservation ID can map to multiple instances which are all a part of one launch request.
- The status can be checked via DescribeInstances call
- Can be terminated using TerminateInstances call
- If a running instances uses EBS-backed root volume (boot partition), it can be stopped by StopInstances call. This preseves the data.
- The same can be done via CLI or the Console instead of REST APIs
- EBS based root device store will preserve data, hence it is not tied to the life of the instance. Local instance based store presisence is tied to the life of the instance. There is no "stop" option.
- Single database running on single instance
- Every record has a
tenant_id
as a part of the composite primary key. - Application will need to provide this
tenant_id
for every query as a part of the where clause
- One database, one instance
- Relatively easy to run cross-tenant queries
You can download the PDF of the questions here
- Which of the following statements about SQS is true?
- A. Messages will be delivered exactly once and messages will be delivered in First in, First out order
- B. Messages will be delivered exactly once and message delivery order is indeterminate
- C. Messages will be delivered one or more times and messages will be delivered in First in, First out order
- D. Messages will be delivered one or more times and message delivery order is indeterminate
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
import java.io.*; | |
import java.util.*; | |
import java.text.*; | |
import java.math.*; | |
import java.util.regex.*; | |
public class Solution { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); |