[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
▼ Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1794933520172(1).png (237 KB, 1137x1340)
237 KB PNG
This is the future you chose.
>>
>>110449448
How will geometry help me develop CRMs?
>>
>>110449448
I have been programming for over 10 years and have never used a linked list.
>>
File: 49w9q1.jpg (93 KB, 900x499)
93 KB JPG
>>110449535
Anyone that tells me I must know what a data structure is a fucking degenerate subhuman snakeoil conman that never had an original thought in their entire lives!

You want to store values? Throw it in memory you fucking troglodyte.
>>
>>110449535
>>110449637
The problem has basically nothing to do with data structures. If you know that Node.next gets you to the next point in the array (which they tell you in the assumptions), you have enough information to proceed.
>>
File: joerogan.jpg (15 KB, 480x360)
15 KB JPG
>>110449448
I've been programming 15+ years, I wouldn't be able to do this without googling. Traversing a linked list isn't the issue, it's that I don't really know the math required to determine if a point is on a line between two X,Y coordinates.

I'd need sample data and sample output to validate whatever dogshit solution I come up with on my own.
>>
>>110449448
another vibeGOD victory
>>
>>110449535
I've only heard of someone using it once for a game because vectors/arrays had to be made from contiguous memory blocks and apparently they were having issues with making sure large enough blocks were free for allocation. They used a LL instead because it doesn't care about that
>>
>>110449740
Just think about it for a bit and it will be easy.
Your first is to determine which two points the target lies between on the x axis.
Your next step is to determine the y value of the line at the x value of the target. This is a linear interpolation between the two points of the line under test. Just figure out what portion of the x distance the target is along the line and multiple the difference between the y values of the two line points by that amount and add it to the smaller of the two.
Then, check if target y is at, above, or below that value.
That's basically it. C'mon man, you could have done that.
>>
if 100% of candidates otherwise in consideration are unable to complete a task, maybe the task is an inappropriate test for an intern candidate
>>
>>110449535
did you miss the part where you have access to the docs
the linked list isn't the issue here
>>
>>110449740
surely with a pen and paper you can figure this out?
>>
A point below "the line" is not even well defined because "the line" is not well defined.

In any case the no-Ai solution is to go through each pair 1, 2 to construct

y = y_1 + (y_2 - y1) * t for t in [0, 1]

and calculate the target's t from
x_t= (x_2 - x_1) * t + x_1

If this t is not in [0, 1] you reject the pair

or if y(t) <= y_t
you reject

or if you didnt reject you REDEEEM THE POINT SAAR
>>
Students don't know how to do anything anymore. They just give the assignments to AI and submit whatever they generate with zero understanding of what was asked from them.
>>
>>110449448
>go through each listpoint in the list
>cast a vector from the listpoint to the targetpoint
>check if all of them point down (y is negative)
I dropped out desu, do I get the job?
>>
Why didn't they have access to Claude?
>>
>>110449448
I don't believe this is a true story. Maybe I'm misunderstanding the question as well (it isn't written well, like most questions), but I didn't go to school for anything tech related and only program as a rarely-indulged hobby, and the answer seems glaringly obvious. In fact, this should be trivial to express in pseudocode for anyone in high school (at the latest).
>>
>>110449823
And then you tell the instructor to fuck themselves if you forgot to handle some edge cases because real software never does
>>
>>110449829
Gen A might be the most misinformed, ill informed, and uninformed generation in over the last 100 years.
>>
>>110449833
no, you don't need to do all of them
you only need to linepoint directly before the targetpoint and the linepoint directly after the linepoint (lp1x < tpx < lp2x) or simply lpx == tpx
>>
>>110449865
yeah you're right :/
>>
>>110449833
>cast a vector from the
absolute gibberish saar
>>
>>110449535
>I have been programming for over 10 years and have never used a linked list.
this post manages to be dumb on at least three different levels
and I think that's neat
>>
>>110449535
Knowing data structures won't harm you.
The difficulty here isn't to iterate over a linked list.
>>
I always use reversed linked lists to get worst performance
>>
>>110449876
https://www.youtube.com/watch?v=aHk42kDwesM
>>
>>110449907
tranime reply? tranime reply
>>
It's crazy how immediately /g/ was able to demonstrate the very problem the screenshot is describing.
>>
>>110449918
Yeah because software developers are famously good at math lmao
>>
We established that :
- The line is straight
- Going always forward (positive X)
Don't I just have to check the points on the linked list, and if a single one of them has a Y above the target point's Y AND an equivalent or greater X, then TRUE, else FALSE ? Am I missing something ? I might be retarded, but I don't get it.
>>
>>110449918
I don't know if you've noticed but people here are not very smart
>>
grok read through all the replies and give me the poster who is least intelligent
>>
>>110449775
this, the proof is in the pudding really
>>
>>110449876
I meant it like casting a ray desu, is that not correct?
>>
>>110449951
meaning
>>
>>110449927
Do you really think of this as "doing math"? The most complicated operator here is *.
>>110449929
It can go up and down at each point, have a different slant. It's straight between points, "each point [...] is connected to the next one with a straight line", but not "the whole line is straight".
>>
>>110449936
I guess not. I guess I've just adjusted to it. The replies being so immediately and starkly what the post describes snapped me out of it. (e.g. not even seeing the problem, not being able to begin approaching the problem).
>>
File: 1794878525312035.jpg (185 KB, 822x1024)
185 KB JPG
>>110449685
Yeah yeah whatever I raise you the halting problem
>>
>>110449964
Multiplication is literally frontier math that AI is researching
>>
File: mib862nyaa4g1.gif (989 KB, 500x375)
989 KB GIF
>>110449685
Also I'm not replying about the problem, I didn't even look at this stupid shit.

165+ IQ Says I can everything in my sleep but I must be aroused....there is nothing arousing about bullshit problems
>>
>>110449448
Even without AI these questions are wrong. You want to test abstraction skills? Ask math.
>>
>>110449448
...don't you just need to take the x and y from the first node, then the x and y from the second node, find the slope, plug the X of the target point in to that slope, and compare that to the Y of the target point?? This is braindead easy
>>
>>110449896
Yes they will, all you need is a hashmap, just let it go and move on bro We're not in the 50s anymore
>>
I attempted this exercise by myself and failed to do linear interpolation. I've also come to realize AI is rotting my brain because I was having trouble even remembering how to traverse a linked list.

my broken solution:
    static bool UnderTheLine(Node line, Point target)
{
while (line.Next != null)
{
if (target.Y >= line.Point.Y && target.Y <= line.Next.Point.Y)
return true;

line = line.Next;
}
return false;
}


actual solution:
static bool UnderTheLine(Node line, Point target)
{
while (line.Next != null)
{
Point a = line.Point;
Point b = line.Next.Point;

if (target.X >= a.X && target.X <= b.X)
{
double slope = ((double)b.Y - a.Y) / (b.X - a.X);
double lineY = a.Y + slope * (target.X - a.X);

return target.Y < lineY;
}

line = line.Next;
}

return false;
}
>>
>>110450030
Not quite, because the line can go up, down, change its slant, with each next point on the line.
It's almost that simple though. You just start by finding which two points on the line your target point is between on the x axis, then do as you described. It really is that simple and /g/ still can't do it.
>>
>>110449982
most of the board is neets or undergrads
>>
>>110450030
oh, no, wait, it's not a straight line there are only straight lines between each node

in that case you just have to iterate over the linked list until you hit a node with an X value larger than the target's X value, then do the same thing calculating the slope with the previous node.
>>
File: kekd.jpg (128 KB, 673x768)
128 KB JPG
>>110449949


dumbest posters award goes to
>110449833
>110449929
>110449637
>110450032
>110449740
>>
File: 1795798677295201.jpg (71 KB, 469x596)
71 KB JPG
>>110450041
Oh noes....I can't remember useless, trivial and obsolete information.

Oh noes, my brain is working properly AI = bad
>>
>>110449448
unironically usecase for this SNCA?
>uh yeah so you can just use AI for the actual job but first you must solve my riddles three
>no you won't ever have to write a single line by hand, you just...you just have to know it ok. for science.
>why would I ask you about actually important shit that relates to the job like "what is your workflow in solving problems" or "name a time you accomplished something with AI. What went right or wrong?" no that's just retarded you need to focus on my riddles
>for the next one prepare to do your heckin leetcode sir
>>
File: mfasf.jpg (19 KB, 325x265)
19 KB JPG
>>110450052
>15+ years of experience
>couldn't determine if a point is below a line

HAHA HA H AH AH AH AHA H A
>>
File: 1795546459166474.png (989 KB, 962x962)
989 KB PNG
>>110450052
Kindly refer to >>110450013
>>110450005
You can't research a definition you fucking moron
>>
File: 1794903565450333.jpg (650 KB, 1811x2048)
650 KB JPG
include me in the r/4chan screencap
>>
File: linear.jpg (182 KB, 1814x1484)
182 KB JPG
>>110450052
I've literally never had to do linear interpolation in my 15+ years of programming.

It's also something taught in middle school is it not? No way I would remember the formula from something that far back.
>>
File: gvhdf.jpg (44 KB, 896x643)
44 KB JPG
>>110450052
new shitposting method unlocked
>>
>>110450107
>It's also something taught in middle school is it not? No way I would remember the formula from something that far back.
It's a nice attempt at dressing up "I can't do middle school math" but it ultimately doesn't pass muster.
>>
>>110450107
you don't have to remember exact formulas if you understand simpler formulas because you can derive them on the fly
>>
>>110450127
this is true of high schooler math but once you go phd level this is no longer true
at that point math is more about memorizing all the dirty tricks you have ever encountered in the hopes that they will apply to a new problem
>>
so what if the lines goes in a circle and the target point is in the center, does that count as under the line?
>>
>>110450120
he took the vaxx bro... it's over...
>>
>>110450045
def under_the_line(line: Node, target: Point) -> bool:
currentNode = line
while currentNode.next.point.x < target.x:
currentNode = currentNode.next
p1 = currentNode.point
p2 = currentNode.next.point

return target.y < p1.y + (((p2.y - p1.y)/(p2.x - p1.x)) * (target.x-p1.x))
>>
>>110450143
That's addressed in the assumptions.
>>
>>110450143
the piecewise line can't loop around because each point has strictly higher x coordinate from the previous, in other words it is a monotonically increasing sequence
>>
>>110449535
webdev isnt programming
>>
>>110450116
Bro is literally fucking retarded and so is his sycophantic AI.
>>110450052
ChatGPT doesn't understand a function and a data structure are two different things...yup sounds about right

Bow before meme magic and go fucking cry you obsolete loser
>>
>>110449775
a freshman or sophomore, depending on the program, should be able to handle this question with no trouble
>>
>>110450195
you seem like a low functioning schizophrenic, can I see your feet?
>>
>>110450194
Give me literally 1 use case where a linked list or any data structure for that matter is superior to a hashmap......
>>
>software developer interview
>linked list
>math

lmao i'd file a formal complaint with OSHA and tip the police these fucks are probably a fake company laundering money
>>
>>110450195
>a pile of float16's can be sycophantic
wew
>>
>>110449448
what the fuck is this even asking this is such a bizarre question, why is a linked list involved at all?
>>
File: 1795546215915290.gif (818 KB, 607x609)
818 KB GIF
>>110450204
Ah yes, having a 165+ IQ is indicative of schizophrenia....would you like me to dismantle psychology in one word for you? It's one all the lefties love so much......

It's called......

CONSENT
>>
>>110450233
show me some of your papers on arxiv 165+ iq big boy
>>
>>110450230
What part don't you understand?
>>
>>110450230
I am sorry saar, we have decided to proceed with a different candidate. Saar, this is not a reflection on you, please do not take this as a loss of izzat and shit in our parking lot or the grass outside the office. Take some time to redeem yourself and do the needful saar and apply with more experience at a leisurly time.
>>
>>110450239
Why is a linked list involved at all?
>>
>>110449448
What's the point of doing a linked list like that instead of using a list in Python?
>>
File: images (2).jpg (15 KB, 500x400)
15 KB JPG
>>110450237
>arxiv
Since you want to test me go check out this project I was a core part of >>> thought.live

I keep everything to myself all up here in this beautiful brain of mine...I have no interest in playing nice with others.
>>
>>110450247
It's just one possible way of storing the points of the line. It could just as easily be a vector where you use line[i] and line[i+1] instead and you check where you are against line.size() instead of checking if next is None.
Read the rest of the problem and it should become clear that the linked list is not really that important.
I do wonder if people are just seeing "linked list" and freezing up.
>>
>>110449448
lmao ok, so you want me to tell you whether a point lies under a linear piecewise function. A linked list is a dumb representation for something you know is monotonic in some value considering the opportunity for binary search, but fine.
struct Point {
int x;
int y;
};
struct Node {
struct Point point;
struct Node *next;
};
float
lerp(float y0, float y1, float x0, float x1, float x)
{
return y0 + (y1 - y0) * (x - x0) / (x1 - x0);
}
bool
under_the_line(const struct Node *line, struct Point target)
{
const struct Node *n0 = line;
for (; n0; n0 = n0->next) {
if (target.x < n0->point.x) {
break;
}
}
const struct Node *n1 = n0;
for (; n1; n1 = n1->next) {
if (target.x > n1->point.x) {
break;
}
}
return target.y < (n0 == n1 ? n0->point.y : lerp(n0->point.y, n1->point.y, n0->point.x, n1->point.x, target.x));
}

NEET dropout btw. hire me
>>
>>110450230
>>110450247
>>110450261
jeet alert
>>
>>110450214
stay away from computers
>>
>>110449740
>I've been programming 15+ years
frontend "programming" perhaps
goddamn this field would be so clean and profitable if retards like you and AI didnt destroy it
>>
>>110450275
Shit, I break too late in the loops. Never mind. Don't hire me.
>>
>>110449862
Also the most capable. It's not like most of the previous gens could do anything without their [some fuckass framework written by someone else] either.
>>
>>110449448
Great.
Don't hire anybody from that university, there's a massive surplus of juniors.
If they choose to be useless, retarded chuds, it's their choice.
>>
>>110450284
Why bother a class with .next method when you could just do List[Point]?
>>
>>110450269
Because it makes 0 sense why you would store something like this as a link list and it's worded completely retarded
here's an actually useful way of framing it:
We have a system that draws a line based on a list from a list of coordinate points. Each point in the list has a straight line drawn to the next point in the list.
Write a function that takes in an additional point and identifies if it falls below the line drawn by the above system.
This is obvious and tests the same thing but is not written fucking retarded and asking you to image lines or something.
>>
>>110450326
jeet alert
>>
>>110449448
what the fuck is a linked list
>>
>>110450331
>draws
what does "drawing" have to do with anything
the question is perfectly understandable to me, probably because I'm white
>>
>>110449529
>How will geometry help me develop CRMs?
bootcamper detected
>>110449637
pajeet-level comment
>>110449740
>I don't really know the math required to determine if a point is on a line between two X,Y coordinates.
another bootcamper detected.
>>110449775
>maybe the task is an inappropriate test for an intern candidate
shut up, neet
>>110450052
>i am a moron that needs to ask obvious shit to an LLM
>>110450230
>what the fuck is this even asking this is such a bizarre question
bizarre only if you're a jeet and thus come from a country where they can award a diploma to anybody
>>
>>110449448
>The job: You implement CRUD-Shit for enterprise customers
>The question: Geometry wankery you don't learn in school and that nobody bothers learning on their own
>"We can't find anyone!"
>>
>>110450052
this caused a lot of seethe by those called out for being retards lmao
>>
>>110450354
You can derive the form for linear interpolation from middle school algebra.
>>
File: durga 1757089747605295.jpg (139 KB, 1280x720)
139 KB JPG
>>110450326
>>110450230
>>110450247
>>110450261
>>110449529
>>110449637
>>110449775
jeet alert
>>
>>110450296
Come back to me when you can defeat an average time complexity of O(1) fucking dumbass piece of shit nigger.

Accept that your data structures are a lie
>>
you don't even need linear interpolation
>>
>>110450343
It makes it clear it is a collection of line segments. The OP post says "this line" "the line" which implies it's a single line and why multiple posters here wrote as if it was.
It isn't "a line" it's a collection of lines and the shitty author can't actually communicate properly.
>>
>>110450354
>you don't learn in school
rakesh... just because you skipped school to swim in cow dung doesn't mean it wasn't taught there
>>
>>110449529
It is just a way to prove a method of thinking and problem solving anon...
>>
>>110450381
>The OP post says "this line" "the line" which implies it's a single line and why multiple posters here wrote as if it was.
People with IQ above 80 can generally understand that a series of connected points creates a line.
>>
Isn't that strange that this post is nowhere to found on reddit hmm why would it be....
>>
>>110450393
It's a series of lines the post switches how it refers to the set of lines vs individual ones you cannot say "A straight line" while also referring to the overall thing with the singular "the line" those are inconsistent usages.
>>
>>110450399
what's strange about it? every thread here is made by a glowie troon double agent in the chinese spy network working for putin
>>
>>110450404
It's a line consisting of multiple segments, each of which is itself a straight line.
As a white person, I understand this concept with ease. You do not because you are not white. It's that simple.
>>
>>110450393
that's called a polygonal chain or polyline, not a line



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.