# Master the Coding Interview
###### tags: `Dream Job` `Google Job` `Big Techs`
## :memo: Steps To Tackle Any Coding Question
- [X] **Step 1:** Verify the constraints
*- If given a list of numbers, one can ask, "Are all numbers positive or can there be negatives?"
- "Are there duplicate numbers in the list?"
- "Will there always be a solution available?"
- "Can there be more than one solution?"*
- "What do we return if there's no solution?"
- [X] **Step 2:** Write out some test cases
*- In this step, it is good to work with interviewer.
- You may ask, "Is it okay if we come up with some test cases together that best capture the solution we seek?".*
- [X] **Step 3:** Figure out a solution on paper
- [X] **Step 4:** Code the solution
- [X] **Step 5:** Test the solution
- [X] **Step 6:** Analyzing the space and time complexity
- [X] **Step 7:** Can the solution be optimized further?
---
### :scroll: Question 1. Two Sum
:::info
###### level: `Easy` category:`Arrays`
Given an array of integers `nums` and an integer `target`, return indices of the two numbers such that they add up to `target`.
You may assume that each input would have **exactly one solution**, and you may not use the same element twice.
You can return the answer in any order.
**[More details...](https://leetcode.com/problems/two-sum/)**
:::
### :scroll: Question 2. Container With Most Water
###### level: `Medium` category:`Arrays`
:::info
###### level: `Medium` category:`Arrays`
Given `n` non-negative integers a~1~, a~2~, ..., a~n~, where each represents a point at coordinate (i, a~i~). `n` vertical lines are drawn such that the two endpoints of the line i is at (i, a~i~) and (i, 0). Find two lines, which, together with the x-axis forms a container, such that the container contains the most water.
**[More details...](https://leetcode.com/problems/container-with-most-water/)**
:::
<!--
- Code block with color and line numbers:
```javascript=16
var s = "JavaScript syntax highlighting";
alert(s);
```
- [ ] Super^script^
- [ ] Sub~script~
- [ ] ~~Crossed~~
- [x] ==Highlight==
:::info
:pushpin: Want to learn more? ➜ [HackMD Tutorials](https://hackmd.io/c/tutorials)
:::
-->
> [name=Abhishek Dev]