• kamen@lemmy.world
    link
    fedilink
    arrow-up
    28
    arrow-down
    2
    ·
    9 hours ago

    If you hand out a problem and only accept one solution out of multiple valid ones, you’re part of the problem.

    • SkaveRat@discuss.tchncs.de
      link
      fedilink
      arrow-up
      16
      arrow-down
      6
      ·
      6 hours ago

      When I interview (experienced) devs, I often ask way too generic questions. Something along the lines of “can you explain what a hash is?”, without stating what kind of hash and in what context

      The primary goal isn’t really to explain it in detail, but to see if they get confused and ask for clarification. Way too many people just start assuming something, when a task is not defined properly. I need coworkers that push back on bullshit, and not blindly implement whatever runs along their desk, no matter how little sense it makes

      If I don’t hear at least one “it depends” during an interview, I don’t have high hopes

      • 1rre@discuss.tchncs.de
        link
        fedilink
        arrow-up
        6
        ·
        2 hours ago

        I mean I’d probably go super generic and say something like “it’s a deterministic function which turns a block of data into a usually smaller block of data, usually for comparing equality to the original block of data” which covers most of the uses?

        If you ask a generic question, you’re gonna get a broad answer, and if you want to draw clarifying questions, you need to ask a more complex question and provide insufficient information to answer it. Even then, making that question something you can easily look up online, and you either know or you don’t, doesn’t achieve as much as making the question something that you objectively won’t know, and have to learn on the spot, as that shows your ability to learn new things including things you can look up on the Internet.

      • zalgotext@sh.itjust.works
        link
        fedilink
        arrow-up
        5
        ·
        2 hours ago

        Your candidates aren’t mind readers though. If you want people to ask clarifying questions, you have to ask them things other than comp sci trivia questions.

      • Grendel@tiny.tilde.website
        link
        fedilink
        arrow-up
        2
        ·
        2 hours ago

        @SkaveRat
        in college I had a prof tell us to get into teams, then give us lego sets to assemble.

        they were in the original boxes but the directions had been removed. I was the only one to go up front and ask for the directions and she gave them to me.

        Apparently that was the whole point to the excersize. “ask for the resources you need"

        @kamen

      • xianjam@programming.dev
        link
        fedilink
        English
        arrow-up
        4
        ·
        3 hours ago

        So, to start off, I’m someone who does not typically perform well during interviews because of anxiety (but through some miracle has had no issues with employment), so take this response with whatever bias that brings.

        I believe this is bad too. You’re still essentially asking a gotcha question, expecting one phrase in your answer and failing the candidate if you don’t hear that phrase. And, in fact, I disagree with the premise. I think the question is defined quite well in the context of programming, given that someone answers with the possibility that there are many ways to hash something and many uses of hashing.

        • SkaveRat@discuss.tchncs.de
          link
          fedilink
          arrow-up
          3
          arrow-down
          1
          ·
          2 hours ago

          The hash question is just something from the top of my head. I normally fit it to the situation.

          I absolutely take nervousness into account, as I can relate to it.

          The thing is, I need to know if the person can push back in some way. it’s a hard thing to do in interviews, but also the first point for me to check how a person reacts

          I’ve been bitten too many times, with dev coworkers who don’t give at least a little resistance when vague or stupid tasks show up. Only to notice hours or days later, when something was done completely the wrong way

      • stingpie@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        4 hours ago

        The only definition of hash that I know is an identifier for an object created from that object’s data. Everything else stems from that central idea. What other types of hash are there?

        • kamen@lemmy.world
          link
          fedilink
          English
          arrow-up
          3
          ·
          3 hours ago

          Yeah, it’s basically that, but it has different uses - two main things I can think of right away are 1) verifying data when downloading large files and 2) cryptography (e.g. when storing credentials). Oh, and hash tables too.

  • epigone@awful.systems
    link
    fedilink
    English
    arrow-up
    13
    arrow-down
    1
    ·
    15 hours ago

    software engineers met the table¹ in web design and never looked back. does a table “mean” tfoot and all (arranged at top)? thead, that sorts(, by server link without javascript)? a “table” in the web means all sorts of sorty things and offset things, and paginated things, by navigable server links. and the two tables nested for layout, oy vey! so many ways with all that engineering the web fell to the broken manual✨️🤷🏾‍♂️✨️

    ¹ (for layout) https://www.w3.org/TR/web-sustainability-guidelines/#progressive-enhancement

  • ThatGuy46475@lemmy.world
    link
    fedilink
    arrow-up
    204
    ·
    23 hours ago

    A group of researchers was studying how different people solve problems. They gathered a physicist, a mathematician, and an engineer and gave them each a problem: find the volume of a red sphere. The mathematician solves it first. Asked how, he explains that he used a simple formula. The physicist solves it next. Asked how, he explains that he submerged the sphere in water and measured the rise in water level. Hours later, they find the engineer buried in paperwork. Asked about his progress, he says “I can only find a table of values for the volume of blue spheres.”

    • k0e3@lemmy.ca
      link
      fedilink
      arrow-up
      8
      ·
      edit-2
      9 hours ago

      Sorry for the stupid question, but doesn’t the rise in water level show the density of an object? Can you measure volume too? What if the sphere floated?

      Edit: thanks everyone for helping me understand. I was totally misremembering the story about Archimedes and the crown.

      • KubeRoot@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        11
        ·
        9 hours ago

        Nope, the rise in water shows exclusively the volume. Density is derived using volume and mass, with mass being measurable by weighing. The only factor density plays directly is indeed floating, but you can just push the sphere under with a thin rod without significantly impacting the measurement.

        It’s generally simple - water has some volume, sphere has some volume. Assuming a cylindrical container, the base of the cylinder is known, and the volume of it is equal to the volume of water, which means you can derive the height (or vice versa). If you now add the sphere, the sphere pushes out the water, which means you add the volume of the sphere to the water - and if you measure the height, you can calculate the total volume of water+sphere, and subtract the initial volume of water to isolate the volume of the sphere.

      • froh42@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        edit-2
        9 hours ago

        If you fully submerge an object, you displace its VOLUME of water. It will always be the same amount (imagine a bowling ball and a soccer ball). You might need to push it.

        When you relate that to its weight, you get the density.

        Imagine you have two 1kg lumps of steel. Out of one you make a bowl with thin walls the out of the other a metal ball. Afterwards they still have (about) the same weight, volume and density - as it’s still steel.

        But put the bowl onto the basin and with a little luck it will float like a boat *, put in the steel ball it will sink.

        But when you put in the bowl sideways without splashing it will displace about the same amount of water than the ball. And it will still weigh 1kg.

        *= The thing with floating people remember from school: The floating bowl will displace as much water as it weighs - that’s the thing Archimedes found out. So our 1kg bowl will displace 1kg of water - which is incidentally about 1 liter, because the density of water is about 1kg/l (it was intentionally defined that way, some guys in the French revolution used water to define mass by volume)

      • Jako302@feddit.org
        link
        fedilink
        arrow-up
        3
        ·
        9 hours ago

        It shows volume, not density.

        The amount of displaced water is the same for a lead sphere and a balloon of the same size.

        You can the also calculate the density if you measure how mich of the object is submerged

      • Shanmugha@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        9 hours ago

        attach something to the bottom, pull, fix position

        Edit: I am late. kudos for everyone who was faster :)

      • Kazumara@discuss.tchncs.de
        link
        fedilink
        arrow-up
        2
        ·
        9 hours ago

        Density comes into it if we are measuring buoyancy. The weight of the displaced water is equal to the weight of the buoyant object, and the ratio of volume submerged vs above water should give a way to determine density, but I don’t have the precise method in my head right now.

        However assuming all you want is the volume, you simply need to fully submerge the object (by applying enough downward force if its density is too low), and the displaced volume is equal to the objects volume. The displaced water will have to flow to the top of the container, so by measuring the rise in water level and multiplying with the base area of your container you can get it easily.

        Just make sure you don’t accidentally also measure your hand if you’re pushing down the sphere.

      • blamster19@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        9 hours ago

        Submerging the sphere gives you the volume. You’re thinking of the legend of Archimedes who measured volume this way and measured mass with an ordinary scale and deduced the density from those two values.

    • NaibofTabr@infosec.pub
      link
      fedilink
      English
      arrow-up
      141
      arrow-down
      1
      ·
      22 hours ago

      On further inspection, it was found that the mathematician had assumed an ideal sphere of constant radius, while the real object was in fact oblate. The mathematician had neglected to take any measurements, leading to an incorrect value. The physicist’s answer was correct, but only at sea level at nominal temperature.

      The engineer is currently using calipers to measure the diameter of the object at many different angles in order to build a CAD model. He said we could expect results next year.

      • tyler@programming.dev
        link
        fedilink
        arrow-up
        67
        ·
        21 hours ago

        The physicist’s answer would be correct anywhere, no matter the temperature or density of the fluid.

        • montechristo@feddit.org
          link
          fedilink
          English
          arrow-up
          28
          ·
          21 hours ago

          Supposing that the measurements with and without the sphere are taken under identical circumstances. But you deserve the upvote either way.

        • OwOarchist@pawb.social
          link
          fedilink
          English
          arrow-up
          12
          ·
          21 hours ago

          Interestingly, the physicist’s answer would always be correct, but not always consistent.

          If the sphere is compressible, then air pressure will slightly affect its volume. And unless the thermal expansion rate of the sphere is zero, the amount of fluid displaced will also vary with temperature.

          However, even if the physicist gets different answers in different environments, it’s always still a correct answer, because they correctly measured the volume of the sphere at that time.

        • untorquer@quokk.au
          link
          fedilink
          English
          arrow-up
          13
          arrow-down
          2
          ·
          21 hours ago

          Assuming the time between submersion and observation is greater than zero, increasing temperatures above boiling would give increasing error.

          Conversely the physicist may get other error at/near freezing.

          And yet another option is the fluid being above the Ball’s melting and/or boiling point, assuming changes in density with phase change.

          • Aqivex@fedinsfw.app
            link
            fedilink
            English
            arrow-up
            10
            arrow-down
            1
            ·
            21 hours ago

            All of which the physicist can trivially account for, control and variable test around, should the requested question be updated to require it.

            The requested question did not include “In all possible scenarios”, thus determining the volume of the sphere via physics calculation at the most average of conditions, is the most correct valid solution, absent further requirement parameters.

            • untorquer@quokk.au
              link
              fedilink
              English
              arrow-up
              7
              arrow-down
              1
              ·
              20 hours ago

              You’re right in terms of grading a student’s homework or whatever.

              In research/publication/career these assumptions must be stated unless given.

              But I was responding to:

              The physicist’s answer would be correct anywhere, no matter the temperature or density of the fluid.

              Which includes non-standard conditions.

      • BartyDeCanter@piefed.social
        link
        fedilink
        English
        arrow-up
        5
        ·
        14 hours ago

        Anywhere with gravity sufficient to overcome the surface tension of the water from forming around the object or clinging to the container.

    • ChickenLadyLovesLife@lemmy.world
      link
      fedilink
      English
      arrow-up
      20
      arrow-down
      4
      ·
      17 hours ago

      They later added an Anthropologist, who understood that more questions needed to be asked. His first question was “do you want fries with that?”

    • tetris11@feddit.uk
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 hours ago

      I think it means when the method is barely better O(Exp), even on ordered sets

      • Zarobi@aussie.zone
        link
        fedilink
        English
        arrow-up
        9
        arrow-down
        1
        ·
        15 hours ago

        All these job titles don’t really have a formal definition. Software engineer = programmer = software developer. Computer scientist sure does sound fancy though. There’s no committee that will say “actually you’re doing too much math to be a developer sorry.” We all do the code-y thing. Businesses seem to pick one at random based on seniority. I just call myself whatever my most recent job title was.

        Your industry will affect your specialisation and skills much more than anything else.

        - Software Engineer (Maths)

        • Tja@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          6 hours ago

          I don’t even go that’s far. I “work in IT”. Enough for 99% of social interactions / official forms.

        • baggachipz@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          6 hours ago

          You’re taking my comment a little too seriously. I just know that what I do is essentially playing with other people’s legos, to make a CRUD app, to show my industry’s equivalent of cat pictures. I leave the heavy math and theory to the real computer scientists.

          • Zarobi@aussie.zone
            link
            fedilink
            English
            arrow-up
            0
            ·
            1 hour ago

            I couldn’t tell how serious you were being, sorry. Some people get weird about this specific topic and gatekeep the labels lol

        • Omgpwnies@lemmy.world
          link
          fedilink
          English
          arrow-up
          13
          arrow-down
          1
          ·
          19 hours ago

          Also, any CompSci grad I’ve worked with couldn’t write code for shit unless they learned how outside of their schooling, and yet so many go the CompSci -> programmer route instead of doing like SW Eng or something like that.

          • Kazumara@discuss.tchncs.de
            link
            fedilink
            arrow-up
            3
            ·
            9 hours ago

            any CompSci grad I’ve worked with couldn’t write code for shit

            Damn, that sounds pretty bad.

            We had tons of math and theoretical work too, but we also programmed a fair amount: We had to write a renderer in one class, a compiler in another, various Android apps in a third, and in one elective I took we wrote a micro kernel OS as well.

          • gankouskhan@bookwyr.me
            link
            fedilink
            English
            arrow-up
            3
            ·
            12 hours ago

            It’s not like the CS program is devoid of programming, norb would I say the SWE students are that much better off without outside education. CS is about half theory half practical for core education at least. The difference is you learn why and how which is more beneficial long term. After the first 6 months on the job the difference between the two on programming ability should be about the same with some more optimal solutions found by the CS student if any difference. It’s a pretty short term problem.

  • Yaky@slrpnk.net
    link
    fedilink
    arrow-up
    22
    ·
    19 hours ago

    I expected the bottom to say something like “instead of cloud-native scalable microservices using AI models that cost an average US household salary per day to run”, but maybe I’ve been in corporate for too long.

    • Tja@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      6 hours ago

      Depends on the scale of the project. Some apps you would get a promotion if you could get them to (reliably) run on just 50k a day.

  • BCsven@lemmy.ca
    link
    fedilink
    arrow-up
    82
    ·
    24 hours ago

    Ha. I had a convo with a programmer in the 90s. He was explaining a complex problem and the steps to solve in the code, to adjust things based on user choices and parameters.

    And I said why wouldn’t you presolve all of them and then provide a lookup to go get the solution from a list. And he just looked stunned and walked away.

    • Thorry@feddit.org
      link
      fedilink
      arrow-up
      40
      ·
      22 hours ago

      Reminds me of the first time I saw Sin and Cos lookup tables being used in early 3D gaming. The computers could calculate those just fine, especially with a math co-processor. But for 3D gaming it would be too slow to get a good framerate. So lookup tables were used to greatly improve the speed.

      Back on those days all sort of neat tricks like that would be used. Often done as little demo programs that were very impressive. Before the internet it was hard to look up something like that and the latest and greatest tricks weren’t written in books yet. So often little code snippets and demo programs would be shared amongst programmers using the sneakernet, so we could all learn and get better.

      • xthexder@l.sw0.com
        link
        fedilink
        arrow-up
        13
        ·
        19 hours ago

        Trigonometry functions are still just a hardware lookup table in most scenarios I believe. One example I’ve noticed is that you’ll get slightly different sin/cos results on AMD vs Nvidia GPUs due to either different lookup table values, or different interpolation functions being applied on top (I’m not sure it’s possible to know for sure exactly which without internal knowledge)

        • gens@programming.dev
          link
          fedilink
          arrow-up
          5
          ·
          16 hours ago

          For cpu sine is in code. X87 has a FSIN, but nobody uses it. Afaik it’s just worse. Idk about gpus or if there’s a standard like there is for floats in general (ieee754).

    • OwOarchist@pawb.social
      link
      fedilink
      English
      arrow-up
      12
      ·
      21 hours ago

      It’s possible that the dynamic generation might be more maintainable than a lookup list, though.

      With a lookup list, you may need to recalculate the whole thing every time you make a small change. And a significant change, like giving the user a new choice/parameter to adjust, may not only require recalculating the lookup table, but also exponentially increasing the size of the lookup table.

      Whereas with a dynamically generated result, small adjustments to the values likely wouldn’t require any modification of the actual code at all, and adding a new choice/parameter would be fairly straightforward – it just needs to be plugged into the formula, maybe add an extra step or two in the algorithm.

      • BCsven@lemmy.ca
        link
        fedilink
        arrow-up
        10
        ·
        21 hours ago

        It was finite, and early 90s. Calculation time is something you wanted to avoid. To put it to an analogy: you could calculate if a 3d X can be manipulated through a hole, or you can just prr evaluate and say Yes or no based on size, rather than running permutations on 6 axis of movement

    • Sludge@sh.itjust.works
      link
      fedilink
      arrow-up
      15
      ·
      22 hours ago

      Ah my prior manager suggested something similar… Dynamic views that would adjust based on user set parameters… We set up canned views and called it a day.

      He was let go, but always pushed for the art of the possible (even if it would take a few extra sprints to wrap)

      • BCsven@lemmy.ca
        link
        fedilink
        arrow-up
        10
        ·
        23 hours ago

        Because he hadn’t thought of what I suggested and it was much easier than what he was trying to program. I wasn’t suggesting he write the program, solve it and table it; it was more like empirical knowledge/common sense stuff to narrow options, then fill the rest in based on what made sense. Then its just a horizontal or vertical intersection to find the outputs required instead of a complex calculation every time

  • henfredemars@infosec.pub
    link
    fedilink
    English
    arrow-up
    36
    ·
    24 hours ago

    It really depends on what you’re building. In an embedded shop, lookup tables are first class solutions to most problems. Computer scientists though, 100%!

    • mushroommunk@lemmy.today
      link
      fedilink
      arrow-up
      39
      ·
      24 hours ago

      Depends on the available memory and size of the tables. I’ve worked on cases where time to compute didn’t matter as much as shaving off three more bytes did. Large lookup tables would have absolutely killed us compared to running some math.

      • henfredemars@infosec.pub
        link
        fedilink
        English
        arrow-up
        14
        ·
        24 hours ago

        Good point! Good point.

        I’ve seen bubble sort implemented because we had data that said it was faster and was slightly smaller for the exact type data we were sorting and its expected distribution.

        • disorderly@lemmy.world
          link
          fedilink
          arrow-up
          20
          ·
          23 hours ago

          I fondly remember the time I hired a QT expert onto an embedded app team and on his first project he imported a sort algorithm from std. He found the system got weird and glitchy, and often crashed.

          Yeahhh turns out the algorithm he chose needed to make a copy in memory and the thread he was working in only had 2048 bytes of stack, so larger inputs would corrupt the stack allocated to the next thread. I had to explain to him that we had a full second to complete the math before we had to give back our semaphore, so saving a couple milliseconds on the sort was not a priority. Fun times.

    • Err(()).unwrap()@lemmy.world
      link
      fedilink
      arrow-up
      16
      ·
      23 hours ago

      IIRC, Elite used lookup tables for trigonometric functions on certain target platforms (maybe the NES) because memory wasn’t as much of a constraint as computing performance. It’s a barrel of game compressed into a pint of code.