"Sorted the array and stored the minimum difference in a variable and then traversed the array for the pairs having minimum difference"
Aashka C. - "Sorted the array and stored the minimum difference in a variable and then traversed the array for the pairs having minimum difference"See full answer
"In the Slack system design interview, I proposed a WebSocket-based architecture for real-time messaging, supported by a network of distributed chat servers. To track user connections and route messages efficiently, I leveraged ZooKeeper as a service registry and designed peer-to-peer communication between servers.
For the data layer:
• I used PostgreSQL to manage relational data such as users and chat participants.
• Cassandra was chosen for high-throughput, scalable message storage with dura"
Aneesh M. - "In the Slack system design interview, I proposed a WebSocket-based architecture for real-time messaging, supported by a network of distributed chat servers. To track user connections and route messages efficiently, I leveraged ZooKeeper as a service registry and designed peer-to-peer communication between servers.
For the data layer:
• I used PostgreSQL to manage relational data such as users and chat participants.
• Cassandra was chosen for high-throughput, scalable message storage with dura"See full answer
Engineering Manager
System Design
🧠Want an expert answer to a question? Saving questions lets us know what content to make next.
"find total sum. assign that to rightsum
traverse from left to right: keep updating left sum and right sum, when they match return the index.
else if you reach end return -1 or not found"
Rahul J. - "find total sum. assign that to rightsum
traverse from left to right: keep updating left sum and right sum, when they match return the index.
else if you reach end return -1 or not found"See full answer
"I would assume that this is similar to an intervals question. Meeting Rooms II (https://www.lintcode.com/problem/919/?fromId=203&_from=collection) on Leetcode seems like the closest comparison, it's a premium question so I linked Lintcode.
I'm assuming that we also need to just return the minimum number of cars used. You need to sort for the most optimal solution, so you're constrained by an O(nlogn) time complexity. So any sorting solution could work (using a heap, sorting the array input arra"
Sohum S. - "I would assume that this is similar to an intervals question. Meeting Rooms II (https://www.lintcode.com/problem/919/?fromId=203&_from=collection) on Leetcode seems like the closest comparison, it's a premium question so I linked Lintcode.
I'm assuming that we also need to just return the minimum number of cars used. You need to sort for the most optimal solution, so you're constrained by an O(nlogn) time complexity. So any sorting solution could work (using a heap, sorting the array input arra"See full answer
"/*
You are with your friends in a castle, where there are multiple rooms named after flowers. Some of the rooms contain treasures - we call them the treasure rooms.
Each room contains a single instruction that tells you which room to go to next.
* instructions1 and treasurerooms_1 *
lily* --------- daisy sunflower
| | |
v v v
jasmin --> tulip* violet* ----> rose* -->
^ | ^ ^ |
"
Azeezat R. - "/*
You are with your friends in a castle, where there are multiple rooms named after flowers. Some of the rooms contain treasures - we call them the treasure rooms.
Each room contains a single instruction that tells you which room to go to next.
* instructions1 and treasurerooms_1 *
lily* --------- daisy sunflower
| | |
v v v
jasmin --> tulip* violet* ----> rose* -->
^ | ^ ^ |
"See full answer