Live data from Hacker News

Subverting the software interview (2021)

nliu.net

41–50 of 80 posts

Re: Subverting the software interview (2021)

#42
post #21
post #2

Probably didn't pass the interview. The implementation was rather simplistic and low quality. Here's a better enterprise version: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris... Though the fact that it was written some years ago might be a weakness. Some interviewers might prefere a more modern, distributed solution.

This github org needs more leetcode examples in that style

There is also the Hello World Enterprise Edition [1]

[1] https://github.com/Hello-World-EE

Re: Subverting the software interview (2021)

#43
post #19

Earlier quoted context omitted.

You could have at least clicked on the LinkedIn link before assuming the author was a guy... https://www.linkedin.com/in/naomi-w-liu/

The name Naomi might have been a dead giveaway.

https://en.wikipedia.org/wiki/Naomi_Uemura

This man has won the People's Honour Award for climbing the highest mountains on 5 continents and being the first man to reach the north pole solo.

So Naomi is not necessarily a dead giveaway, you guys really split hairs and raise hackles over just about nothing worthwhile. Mistaking someone's sex is not a massive deal.

I used to have on my team a guy named Joan (pronounced joe-an) who spoke really softly, so his potential new employers would call me for a reference asking about "she" and "Joan", I'd gently correct them so as not to embarass him on any phone interview in the future. Nobody needed to throw a fit over an honest mistake.

Coincidentally, that guy was the best programmer I ever employed.

Anyway, just one of many counterexamples to a non-issue.

Re: Subverting the software interview (2021)

#44
There is “no way” to subvert this FizzBuzz interview when writing code in Python 3 only.

  def inf_range(a):
    while True:
      yield a
      a += 1

  def take(n, it):
    return [a for a, b in zip(it, range(n))]

  def fizzbuzz():
    return (a + b or str(c) for a, b, c in zip(
        (a for _ in inf_range(1) for a in (("", "", "Fizz"))),
        (a for _ in inf_range(1) for a in (("", "", "", "", "Buzz"))),
        inf_range(1)))

  print(take(30, fizzbuzz()))
For bonus points: which alphanumeric characters can be changed in the code above?

Re: Subverting the software interview (2021)

#46

Great writing, hilarious. I feel like we all could know someone who fits these characteristics.

I worked with a guy who implemented map and reduce in C++ as a subtask of some other task. It was, of course, a header-only templated monstrosity. He called it "fun.hpp". "Fun" times, indeed, working with him.

You'll like the `std::ranges` library that's been somewhat implemented as of C++20 and is getting some more stuff in C++23. It's very Fun!

    #include 
    #include 
    #include 
    #include 

    int main() {
        std::vector vec = {1, 2, 3};

        // map, using `std::views::transform`. Implemented in C++20
        for(int elem : 
                std::views::transform(vec, [](int x) { return x + 1; })) {
            std::cout  iterator version, which was
        // implemented in C++20.
        std::cout 
Building and running with the following:

    $ g++ --std=c++20 test.cpp
    $ ./a.out
    2 3 4
    6

Re: Subverting the software interview (2021)

#47

Another in this genre: https://aphyr.com/posts/342-typing-the-technical-interview

Quoting from aphyr as it still brings me joy and might encourage others to read through the interview pages there, > “In Lisp,” you offer. “We often write domain-specific languages to solve new problems.” > “C is not a DSL!” > “If you insist.” Keep going anyway.

My favorite:

> The Church. The lambda calculus. The gay agenda. It has known a thousand names, a thousand forms.

Re: Subverting the software interview (2021)

#49

> You have a tendency to overengineer things. Overengineering is an actual problem. For a tiny example, I'll see things like: enum MAGIC = 67; // explanation ... foo(MAGIC); The use of MAGIC is the only one, and is far removed. A better solution is: foo(67); // explanation because it improves locality. I also see things like an object fleshed out with all kinds of member functions that are never used.

In a code review, I’d given a junior programmer advice to avoid magic constants and use defines instead (c, not c++). Resubmission came back with: #define SEVENTEEN 17 Last I spoke with him, he was a Java instructor.

It is truly amazing. One can rave about OOP all day and not understand the basics of programming or good, readable code. Truly mindboggling.
Post reply on HN