Glean | Phone Screen | Dec 2024 | Reject

glean logo
glean
April 4, 20254 reads

Summary

I had a phone screen with Glean where I was asked three interconnected matrix-based problems involving pathfinding from a desk to a snack while avoiding bosses and considering a 'noise' factor, which ultimately led to a rejection.

Full Experience

You are given a matrix where each cell can have values

D - your desk B - Boss's desk (can be multiple) S - Snack (can be multiple) . - empty

- wall

first question -> Find if it's possible to get a snack from your desk without disturbing any boss. BFS

second question -> If the snack has a noise value K. K represnt the number of empty spaces the noise can travel through. find if its' possible to get the snack without disturbing any boss' through noise.

sol. first do multisource bfs from All B's and store min distance of a cell from any B's. then do a BFS from D to S such that you do not use any points where dist(cell) <= k from B

third question ->

Find the maximum value of K for which you can get the snack without distrubing any B's.

Binary Search on K with the solution of 2nd.

Interview Questions (3)

Q1
Path to Snack Avoiding Bosses
Data Structures & Algorithms

You are given a matrix where each cell can have values: D - your desk, B - Boss's desk (can be multiple), S - Snack (can be multiple), . - empty, # - wall. Find if it's possible to get a snack from your desk without disturbing any boss.

Q2
Path to Snack Avoiding Bosses with Noise
Data Structures & Algorithms

If the snack has a noise value K, which represents the number of empty spaces the noise can travel through, find if it's possible to get the snack without disturbing any boss' through noise.

Q3
Maximum Noise K for Path to Snack
Data Structures & Algorithms

Find the maximum value of K for which you can get the snack without disturbing any B's.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!