Please register to participate in our discussions with 2 million other members - it's free and quick! Some forums can only be seen by registered members. After you create your account, you'll be able to customize options and access all our 15,000 new posts/day with fewer ads.
Um...can someone please translate what this guy just said?
"I had to stand in a line when I was younger" and "companies didn't want to hire math majors for programming jobs" and "it took me 30 years to get a job in California despite two bubbles and extreme growth in general in those years".
Um...can someone please translate what this guy just said?
I'll paraphrase the OP's initial post:
"The job market does not improve for white supremacist, misogynistic, recent grad with a BA in Math and crappy programming skills even if I whine about it incessantly on an Internet forum which I've been kicked out of numerous times."
"The job market does not improve for white supremacist, misogynistic, recent grad with a BA in Math and crappy programming skills even if I whine about it incessantly on an Internet forum which I've been kicked out of numerous times."
"Crappy programming skills"? Boy, you're going to have egg on your face when he returns with those code samples.
Maybe you should apply for jobs instead of ranting :/. Pretty sure I've had a worse time of it than you but somehow Still managed to land a job...actually two...have to let one go . Have to be persistent man...I've done my share of ranting but I still kept at it.
When I graduated in 1959 with my MBA I was offered a senior management position at GE. I was only 25 at the time with only a summer job. They practically worshipped the ground I walked on.
ok, suppose you have a roadmap in CSV format that lists pairs of neighboring cities and the distance between them:
city_1, city_2, 100
city_1, city_3, 150,
city_2, city_4, 15
city_3, city_4, 50
...
city_i, city_j, 85
you do not have the complete list of city-city distances (that is, the distance between city_1 and city_4 is not given, but you can get from city_1 to city_4 by going through either city_2 (total distance 100+15=15) or city_3 (total distance 150+50=200).
PROBLEM 1:
Given an arbitrary pair of cities, find the distance of the shortest path between them
PROBLEM 2:
With n cities, there are (n choose 2) shortest paths. What city or cities have the most shortest paths going through them?
Use whatever reasonably standard language you like.
First of all, those aren't anything like the type of "technical interview" I've had to do, most of which I've passed. The last interview I was at last week asked me to move the zeros of an integer array to the back of the array (without necessarily preserving the order of the non-zeros).
Second of all, I know how to do PROBLEM 1. You create a matrix M where M(i,j) is the distance between city_i and city_j. If there distance is not listed in the file, then M(i,j)=∞. Then you apply Dijkstra's Algorithm (Dijkstra's algorithm - Wikipedia, the free encyclopedia).
I'm a little unsure about what you mean in PROBLEM 2 by "shortest paths". Shortest paths between any 2 cities without stopping in another city? Or what do you mean?
First of all, those aren't anything like the type of "technical interview" I've had to do, most of which I've passed. The last interview I was at last week asked me to move the zeros of an integer array to the back of the array (without necessarily preserving the order of the non-zeros).
Second of all, I know how to do PROBLEM 1. You create a matrix M where M(i,j) is the distance between city_i and city_j. If there distance is not listed in the file, then M(i,j)=∞. Then you apply Dijkstra's Algorithm (Dijkstra's algorithm - Wikipedia, the free encyclopedia).
I'm a little unsure about what you mean in PROBLEM 2 by "shortest paths". Shortest paths between any 2 cities without stopping in another city? Or what do you mean?
This is the kind of problem I would ask candidates that I am interviewing, and I would consider it about on-par with the difficulty of the "move zeroes to the back" problem (there's the trivial O(nlogn) solution but I bet you can do it in linear time with a couple of counters)
For your PROBLEM 1 solution, are you explicitly building the distance matrix? That's quadratic in space complexity, can you do better?
For PROBLEM 2, the only way to go between to cities without stopping in another city is necessarily if there is a direct route between them.
Here's a worked example. Suppose we had five west coast cities:
seattle portland 150
portland sacramento 580
sacramento la 380
la sandiego 120
So Sacramento is on several shortest paths here, seattle->sandiego and sandiego->seattle, as well as portland<->sacramento, seattle<->sacramento, seattle<->la, portland<->la, sacramento<->la, sacramento<->sandiego. All in all I think we have:
CITY NUMBER OF SHORTEST PATHS GOING THRU CITY
seattle 8
portland 14
sacramento 16
la 14
sandiego 8
EDIT TO ADD: In an in-person interview setting, I would accept breadth first search instead of Dijkstra.
This guy seems to have some personal problems, but the general idea that there are not enough good jobs for all the people who need jobs seems to be true. Companies can support a lot more customers with fewer employees, and there is no reason to think that trend will change.
This guy seems to have some personal problems, but the general idea that there are not enough good jobs for all the people who need jobs seems to be true. Companies can support a lot more customers with fewer employees, and there is no reason to think that trend will change.
Oh absolutely, automation is killing the demand for labor, and I won't work in places that help to accelerate that process.
Please register to post and access all features of our very popular forum. It is free and quick. Over $68,000 in prizes has already been given out to active posters on our forum. Additional giveaways are planned.
Detailed information about all U.S. cities, counties, and zip codes on our site: City-data.com.