Prim's algorithm: pick-up and drop-off locations for packages

  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    even
AI Thread Summary
The discussion revolves around a poorly articulated coding interview question related to Prim's algorithm, concerning the selection of drop-off centers for an e-commerce company. Participants express confusion over the requirement that drop centers must be a minimum distance apart, with some suggesting that the question lacks clarity and proper context. The conversation highlights issues with the question's presentation, including missing definitions and errors in the diagram. There is skepticism about the quality of such questions, with some speculating that they may be designed to test candidates' reactions to ambiguity. Overall, the thread emphasizes the need for clearer problem statements in technical interviews.
member 428835
This question statement is below, but I can't find out what it's even asking. Any help?

[chegg link redacted by the Mentors after the content was posted below. Please avoid posting low-quality chegg links]
 
Last edited by a moderator:
Technology news on Phys.org
1. Drop-off Centers
An e-commerce company, WhatDoYouWant, wants to contract with local businesses to use their stores as pick-up and drop-off locations for their packages. To reduce expenses, they want to ensure that their drop centers are a minimum distance apart from each other.
A city has many potential drop centers (pdcs) to choose from, represented as nodes on a weighted, undirected graph. The edges on this graph denote roads that connect pdcs, with weights representing the lengths of the roads.
Determine how many unique subsets of these companies can be contracted that would satisfy that requirement.
 
Baluncore said:
1. Drop-off Centers
An e-commerce company, WhatDoYouWant, wants to contract with local businesses to use their stores as pick-up and drop-off locations for their packages. To reduce expenses, they want to ensure that their drop centers are a minimum distance apart from each other.
A city has many potential drop centers (pdcs) to choose from, represented as nodes on a weighted, undirected graph. The edges on this graph denote roads that connect pdcs, with weights representing the lengths of the roads.
Determine how many unique subsets of these companies can be contracted that would satisfy that requirement.
What is the requirement?
 
joshmccraney said:
What is the requirement?
"they want to ensure that their drop centers are a minimum distance apart from each other."
 
Mark44 said:
"they want to ensure that their drop centers are a minimum distance apart from each other."
So like Prim's algorithm?
 
joshmccraney said:
So like Prim's algorithm?
I don't know anything about Prim's algorithm. You asked "What is that requirement?"
My answer was based on what Baluncore wrote, which I presume came directly from the problem you linked to.
 
Mark44 said:
I don't know anything about Prim's algorithm. You asked "What is that requirement?"
My answer was based on what Baluncore wrote, which I presume came directly from the problem you linked to.
So for the first triangle shown, would the answer be 5, since all circles are connected with total length 5?
 
Does such a poorly posed question deserve such attention ?
Maybe it is just click bait, designed to get you to sign up.
 
  • Like
Likes jim mcnamara, pbuk and member 428835
The minimum distance is provided as a parameter to the function you must write as your solution. In the example shown the minimum distance is 4. As the distance between nodes 1 and 2 in the diagram for this example is 3 then any subset that includes both nodes 1 and 2 violates the minimum distance constraint. Note that the example is not expressed correctly as there is no graph_weight argument provided; can you work out what it should be given the weights in the diagram?
 
Last edited:
  • #10
Baluncore said:
Does such a poorly posed question deserve such attention ?
Maybe it is just click bait, designed to get you to sign up.
Chegg seems to be featuring a lot in threads here recently, and also in general internet search results: they must have been pumping it on many levels and obviously plan to make a lot of money. Some of their questions and examples clearly need debugging: do we want to help them do this?
 
Last edited:
  • #11
pbuk said:
Chegg seems to be featuring a lot in threads here recently, and also in general internet search results: they must have been pumping it on many levels and obviously plan to make a lot of money. Some of their questions and examples clearly need debugging: do we want to help them do this?
Well, it's weird because this was literally a coding interview question I had. I obviously didn't take the time to post this until after the interview was complete (not a cheater and honestly no time), but I had no clue what the question was asking. Consequently I didn't even attempt the question. But after the interview I started googling to see what on Earth was being asked. Still don't fully understand, but I'm fine with that.
 
  • #12
Maybe the interviewer found the question on Chegg.com
Maybe they wanted to see how you would react when intimidated by such a poorly posed problem.
 
  • Like
Likes member 428835 and berkeman
  • #13
Baluncore said:
Maybe the interviewer found the question on Chegg.com
Maybe they wanted to see how you would react when intimidated by such a poorly posed problem.
LOLOL it was generated by a computer, and it didn't have the lines and line weights. Also, it used the acronym "pdcs" without definition, along with several other errors. Also, one multiple choice answer about flow charts wasn't available. I even coded it afterwords and nada. The whole process was very weird.
 
Back
Top