## Uber Interview Question

Software Engineers**Country:**United States

**Interview Type:**In-Person

Could you please elaborate a bit. I find it difficult to visualize how this problem is similar to connected components problem ?

Comment hidden because of low score. Click to expand.

Comment hidden because of low score. Click to expand.

0

of 0 votes

Could you please elaborate a bit. I find it difficult to visualize how this problem is similar to connected components problem ?

Comment hidden because of low score. Click to expand.

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Looking for interview experience sharing and coaching?

Visit aonecode.com for private lessons by FB, Google and Uber engineers

Our ONE TO ONE class offers

SYSTEM DESIGN Courses (highly recommended for candidates for FLAG & U)

ALGORITHMS (conquer DP, Greedy, Graph, Advanced Algos & Clean Coding),

latest interview questions sorted by companies,

mock interviews.

Our students got hired from G, U, FB, Amazon, LinkedIn and other top tier companies after weeks of training.

Feel free to email us aonecoding@gmail.com with any questions. Thanks!

4/5 is a graph problem - similar to finding the number of connected components in graph.

DFS solution:

In this graph every node has at most 2 edges. Every position (x, y) has 2 nodes. If it's a '/' in (x, y) and current node is upper half of (x,y), the next two nodes to search is right half of (x - 1, y) and lower half of (x, y - 1).

Other than DFS, union find and BFS will work as well.

- aonecoding July 20, 2017