This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-10
Channels
- # babashka (35)
- # beginners (70)
- # bristol-clojurians (1)
- # calva (30)
- # cider (2)
- # cljsrn (203)
- # clojure (20)
- # clojure-australia (3)
- # clojure-europe (17)
- # clojure-france (7)
- # clojure-nl (4)
- # clojure-uk (8)
- # clojurescript (27)
- # code-reviews (19)
- # core-async (21)
- # cursive (7)
- # datomic (31)
- # defnpodcast (1)
- # duct (6)
- # emacs (3)
- # events (1)
- # helix (2)
- # honeysql (24)
- # jackdaw (2)
- # jobs (2)
- # jobs-discuss (13)
- # juxt (2)
- # lsp (21)
- # re-frame (45)
- # remote-jobs (2)
- # rewrite-clj (3)
- # shadow-cljs (13)
- # vim (1)
(defn cloud
[input]
(let [jump-small 1 jump-big 2]
(trampoline
(fn jump [idx cnt]
(let [idx' (+ idx jump-big)]
(if-let [?zero-or-one (get input idx')]
#(if (zero? ?zero-or-one) ;big or small jump?
(jump idx' (inc cnt)) ;big!
(let [idx'' (+ idx jump-small)] ;else, small
(jump idx'' (inc cnt))))
cnt))) ;else, we are done, return jump count
0 0)))
@ps there’s too much collection op stuff going on in your solution for what’s ultimately an index increment problem.
Rant: doing this kind of stuff reminds me how goofy those kind of problems are; They rarely look like what you deal with on a daily basis. P.S. I feel like there’s a higher level solution that’s shorter for the ‘cloud’ problem but I can’t think of it atm.
Raspasov, I scorned at Hackerrank until I failed two job interviews that did their technical interview through Hackerrank.
I wouldn’t work for a company that used one of these “code golf” puzzle challenge sites as a gate for hiring — they’re a terrible way to figure out whether a candidate is good to hire! 🤯
I went through one of these hackerrank puzzles last night and even submitted one solution in Clojure for fun that’s pretty idiomatic. It gave me a score of 10/60 because most tests with huge numbers (in the hundreds of millions of n!) would time out. Then I looked at other people’s solutions that have 60/60 scores and they all consist of low level perf optimizations around loop/recur, unchecked math, type hints, etc. It seems like the site turns into “most clever perf optimization competition”. Since there are so many ways to write a solution to a problem, the only easy way for them to automatically “give a grade” to a solution is based on performance. I totally have done the perf tricks showed there when needed but they are not required in 98% of the code that I usually write.
@U050KSS8M Yeah, that sort of thing is why I consider these sites completely inappropriate for hiring purposes.
@U050KSS8M would you please share the optimized code, the non-optimized code and the challenge?
@U050KSS8M what kind of work do you do? Freelancer or for a company? @U04V70XH6 is your company hiring?
@U04V70XH6 can you help me get a job in your company or another company?
We are not hiring, sorry. The best thing to do is keep an eye on #jobs and #remote-jobs here and see if folks are hiring into positions where they are open to taking on “non-Clojure” developers and training them. But bear in mind the competition is likely to be stiff because a lot of people want to program in Clojure for a living — far more than there are open positions.
(one of the benefits of Clojure for companies is also somewhat of a downside for candidates: you can get a lot done with very few engineers — and Clojure developers tend to be happier than non-Clojure developers so they tend to stay in roles, which means there’s less hiring going on)
@U04V70XH6 I’ve heard conflicting evidence about that actually. I’ve heard all three: “companies: hard to find Clojure developers” “companies: easy to find Clojure developers” “developers: hard to find Clojure jobs”
@ps sorry, I don’t have any leads at the moment. I am building a React Native app at the moment in Clojure(Script).
@U050KSS8M I launched one on App Store: https://apps.apple.com/us/app/humboi/id1561534546 in a 1.001 person start-up.
@U050KSS8M I’d modify those first two a bit: “companies: hard to find intermediate/senior Clojure developers” (because Clojure devs tend to stay in jobs) and “companies: easy to find folks who want to be Clojure developers” — we should probably take this part of the discussion to #jobs-discuss if we want to drill down further.