3 ms·
I don't think writing bubble sort from scratch without mistakes is necessarily a good demonstration of someone's ability to "handle the basics" Realistically y
by airstrike 3y ago
I don't think writing bubble sort from scratch without mistakes is necessarily a good demonstration of someone's ability to "handle the basics"
Realistically you will never need to write it yourself unless you're coding in some very specific domains
It's at most a signal for whether or not they remember algorithms 101 or some leetcode exercise, but knowing that they do remember isn't really useful to me
- strangesmells06 3y agoit's not even the most efficient search. I don't think any sort method in a language would use a bubble.
- jdefr89 3y agoI agree it isn’t but the point I was trying to make is that when you have to do something from scratch, on your own, even if it’s simple, it can be a challenge. My example was poor because I am typing fast sitting in a car parking lot and I hate typing my thoughts on phones.. Forgive me..
- strangesmells06 3y agoI was agreeing with you haha Companies ask that kind of stuff at interviews lol
- Jensson 3y ago> It's at most a signal for whether or not they remember algorithms 101 or some leetcode exercise, but knowing that they do remember isn't really useful to me For bubble sort? Do you really think anyone should have to remember an algorithm to write a quadratic time sort? All you have to do is "compare and swap" and loop through until you are done, this is way easier than Fizzbuzz. This is only hard if you have a hard time grasping loops, conditional comparisons or swaps. But if you understand all of those the sort writes itself. And understanding loops, comparisons and swaps is pretty fundamental to anything you do as a software engineer, so I'm not sure how any competent software engineer could struggle with it.
- deleted 3y ago[deleted]
- just_boost_it 3y agoEvery technical thing you know is informed by your practice in an area. There's a lot of roles where you don't even have to think about which algorithm is implemented behind your favorite sort method. If you work in a role like that for 10 years, bubble sort becomes "which one was that again"? Engineering is about solving valuable problems. Solving some of those problems requires obsessive control over (and selection of) specific sorting algorithms, many do not. Edit: it's also worth bearing in mind that many of the people who discovered these algorithms are famous in part for having thought them up. If data structures and algorithms were so obvious, nobody would know who many of these people were.
- panxyh 3y agoAssuming knowledge and understanding of an algorithm but no prior practice with implementing it, one’s way of implementing it does tell about their proficiency in programming. GPs bubble sort was obviously just an example, effectiveness of the algorithm or wether there’s ever need for implementing it by hand is irrelevant.
- kaashif 3y ago> All you have to do is "compare and swap" and loop through until you are done, this is way easier than Fizzbuzz. I think you have this wrong, Fizzbuzz is actually completely trivial to the point where the problem statement is almost literally (modulo modulo) a description of the algorithm. Bubble sort is very easy but it's not literally trivial to the same degree as Fizzbuzz!
- d0mine 3y agoNo need to be so literal. Substitute "bubble sort" for "any simple algorithm involving nested loops/branches/collections" and the result is likely to be the same. Mistakes are common. Partially, that is why unit tests may be useful.
- imtringued 3y agoThe problem is that people need to know the algorithm you're asking them to implement, which biases it towards memorization. When you tell them how the algorithm works, it feels like you are not testing anything except syntax. If you let people look it up, it feels like you aren't testing anything except their research skills. It is difficult to have a test in a vacuum. It would probably be better to have a test with multiple steps. Exercise 1: a) Research the topic bubble sort. Explain what bubble sort does and write some notes or pseudo code that will help you implement it. Once you are done, we will disable internet access and close your browser. b) Write a working bubble sort in COMPANY LANGUAGE. c) Modify the bubble sort so that it can sort by multiple columns. The first tests your research skills, the second your syntax skills and the third your ability to deal with changing requirements and implement novel functionality without research.
- deleted 3y ago[deleted]