Tip 1 : Spend most of your times solving problems on leetcode from interview point of view
Tip 2 : Give 1-2 weeks for preparation of core subjects like OS,DBMS,CN etc.
Tip 1: Resume should be of 1 page only.
Tip 2: Prefer to use a single column and mention important subtopics in your resume like coding profiles, projects, previous experiences etc.



1 -> The cell contains an apple that Alice can pick up and pass through it.
-1 -> The cell contains a bush and Alice can not visit this cell.
0 -> The cell is empty and Alice can pass through it.
1. After picking an apple the cell will become empty.
2. While going towards the bottom right corner, Alice can either move Right or Down at each step.
3. While going towards the top left corner, Alice can either move Left or Up at each step.
4. If there is no path from (0,0) to (‘N’-1, ‘N’-1) then Alice will not pick any apple.
If the given matrix is :
[1, 1, -1, 1]
[1, 0, 1, 1]
[1, 1, 0, 1]
[0, -1, -1, 1]
One of the possible ways to collect maximum apples is :
Path for going towards bottom right corner:
(0,0) -> (0,1) -> (1,1) -> (1,2) -> (1,3) -> (2,3) -> (3,3)
Apples collected are equal to 6.
Path for going towards top left corner:
(3,3) -> (2,3) ->(2,2) -> (2,1) -> (2,0) -> (1,0) -> (0,0)
Apples collected are equal to 3.
So Alice can collect a maximum of 9 apples.
The ideas is treat the the round trip route as 2 separate routes start from top left to bottom right.
For every step, we proceed 2 routes simultaneously, and calculate the cherries can pick in two routes.
We choose one cell as 1st route's choice, then calculate values of other cells as 2nd route's choice.
Since the total number of steps moved is fixed in each round, to represent the current state,
we just need choose different columns of each route, and the row # should be number of step - column #.
And dp state cur[i][j] stands for the total cherry picked if 1st route choose proceed to column i and the 2nd route choose column j.
For each state cur[i][j], the cells [step -i ][i] and [step - j][j] can be approached from either top or left, so there are 4 combinations, the transition formula:
cur[i][j] = max(
prev[i][j], // up, up
prev[i-1][j], // left, up
prev[i][j-1], // up, left
prev[i-1][j-1]) // left, left
+ grid[step - i][i] + grid[step - j][j]; // plus the cherry picked by 1st route and 2nd route.
The process is like scanning the diagonal cells from top left to bottom right (think about the Young's matrix):
start
+-----+-----+-----+-----+
| | | pre | cur |
+-----+-----+-----+-----+
| | pre | cur | |
+-----+-----+-----+-----+
| pre | cur | | |
+-----+-----+-----+-----+
| cur | | | |
+-----+-----+-----+-----+
end
Note:
1. when i == j, the 2 routes enter the same grid, we should calculate the grid value only once.
2. The floor and ceiling of available columns in each step could be vary:
As after n steps, you have to move right (column increases), and when step > n, you mustn't move out of right boundary.
3. Be aware not to across the left and upper boundary when count previous states.
4. Be aware of the stones (-1), be aware of the no possible route case. To address this, we can set init value to INT_MIN, and every time meet a stone, set that state to INT_MIN.
In the end, if the final state is negative, we know there is no effective route.
How to Measure 45 minutes using two identical wires?



I used a min heap approach to solve the problem first.
Traverse the array and add elements to array when size is less than k else remove the peek element if current element is bigger than peek element.
Deadlock
Virtual Memory
Paging
Segmentation
Fragmentation
Internal working of a Hashmap
Computer networking concepts were asked in detail ranging from hardware devices to different protocols.



The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked list is 4 -> 3 -> 2 -> 1 -> NULL and the head of the reversed linked list will be 4.
Can you solve this problem in O(N) time and O(1) space complexity?
Reverse a linked list using pointers in an iterative fashion
Company related questions like Cisco products, CEO, competitors, stipend, relocation
etc.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
To make an AI less repetitive in a long paragraph, you should increase: