Technical Interview with an Intel Engineer

preview_player
Показать описание
We go through a mock coding interview with an engineer from Intel. Older video from last year which we just recently uploaded.
Рекомендации по теме
Комментарии
Автор

I believe this is essentially the traveling salesman problem.

tommyw
Автор

Hey bro your explanation is good but font of your editor is too small to see while making video could you please make fonts larger

manyrandomthings
Автор

Is 9 months enough for companies like amazon and microsoft i have just started learning dsa

himanshugupta
Автор

This is my Java solution (also anyone know if this is a problem on LC?)
// each 0 in the input is updated with a value showing the
// distance to the closest -1. Note that -2 are walls
private static void findDistance(int[][] graph)
{
Queue<int[]> queue = new LinkedList<>();

// populate the queue with the positions of the -1's

for(int i=0; i<graph.length; i++)
{
for(int j=0; j<graph[0].length; j++)
{
if(graph[i][j] == -1)
{
int[] {i, j});
}
}
}

int distance = 1;
while(!queue.isEmpty())
{
int size = queue.size();

while(size-- != 0)
{
int[] pos = queue.remove();
int r = pos[0];
int c = pos[1];

// check each of the 4 directions
checkCell(graph, r-1, c, distance, queue);
checkCell(graph, r+1, c, distance, queue);
checkCell(graph, r, c-1, distance, queue);
checkCell(graph, r, c+1, distance, queue);

}

distance++;
}
}

private static void checkCell(int[][] graph, int r, int c, int distance, Queue<int[]> queue)
{
if(r < 0 || r >= graph.length || c < 0 || c >= graph[0].length || graph[r][c] < 0)
{
return;
}

if(graph[r][c] == 0 || distance < graph[r][c])
{
graph[r][c] = distance;
queue.add(new int[] {r, c});
}
}

kevin_m
Автор

hey abrar im a new engineer that wants to improve on my coding interview skills.how can i get better at this? i admire how u are able to finish and ask these complex questions! thanks

yurSJ