Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It might depend on what the measure of "senior developer" is. There are junior-developer positions where nobody could perform adequately without being comfortable manipulate linked data structures (Linux kernel development, maybe, or working on a garbage collector or JIT compiler or the Postgres query optimizer) but senior developers on those teams probably don't know a tenth of what you know about SQL.

Also there are ancillary skills that make the problem much less difficult, so if you can't solve it, you don't have them. Joel Spolsky famously said that nobody can reverse a linked list without drawing diagrams on paper, and that's probably true if you're doing it imperatively in C. But it's in the category of "problems that become much simpler with functional styles of programming." The following took me 5 minutes, most of which was struggling with the syntax of OCaml that I'd forgotten:

    $ ocaml
            OCaml version 4.08.1

    # type 'a list = Cons of ('a * 'a list) | Nil;;
    type 'a list = Cons of ('a * 'a list) | Nil
    # Cons(3, Cons(41, Nil));;
    - : int list = Cons (3, Cons (41, Nil))
    # let reverse lst = let rec rev xs ys = match xs with Nil -> ys | Cons(x, xs') -> rev xs' (Cons(x, ys)) in rev lst Nil ;;
    val reverse : 'a list -> 'a list = <fun>
    # reverse(Cons(3, Cons(41, Nil)));;
    - : int list = Cons (41, Cons (3, Nil))
The full session with all my dumb errors:

    $ ocaml
            OCaml version 4.08.1

    # type 'a list = Cons of ('a * 'a list) | Nil;;
    type 'a list = Cons of ('a * 'a list) | Nil
    # Cons 3 (Cons 41 Nil) ;;
    Error: Syntax error
    # Cons(3, Cons(41, Nil));;
    - : int list = Cons (3, Cons (41, Nil))
    # let reverse lst = let rec rev xs ys = match xs with Nil -> ys | Cons(x, xs') -> rev xs' Cons(x, ys) ;;
    Error: Syntax error
    # let reverse lst = let rec rev xs ys = match xs with Nil -> ys | Cons(x, xs') -> rev xs' Cons(x, ys) in rev lst Nil ;;
    Error: The constructor Cons expects 1 argument(s),
           but is applied here to 0 argument(s)
    # let reverse lst = let rec rev xs ys = match xs with Nil -> ys | Cons(x, xs') -> rev xs' (Cons(x, ys)) in rev lst Nil ;;
    val reverse : 'a list -> 'a list = <fun>
    # reverse Cons(3, Cons(41, Nil));;
    Error: This function has type 'a list -> 'a list
           It is applied to too many arguments; maybe you forgot a `;'.
    # reverse(Cons(3, Cons(41, Nil)));;
    - : int list = Cons (41, Cons (3, Nil))
    #
(These error messages look appalling, but the OCaml interpreter was underlining my errors, which of course didn't paste.)

Similarly, there are problems that become much easier with other paradigms of programming, such as backtracking search.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: