code-reviews

raspasov 2021-05-10T07:03:24.021400Z

(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)))

raspasov 2021-05-10T07:06:25.022400Z

@ps there’s too much collection op stuff going on in your solution for what’s ultimately an index increment problem.

raspasov 2021-05-10T07:11:39.024800Z

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.

zendevil 2021-05-11T16:27:16.038Z

@raspasov would you please share the optimized code, the non-optimized code and the challenge?

zendevil 2021-05-11T16:29:05.039Z

@raspasov what kind of work do you do? Freelancer or for a company? @seancorfield is your company hiring?

zendevil 2021-05-11T16:30:36.039800Z

@seancorfield can you help me get a job in your company or another company?

seancorfield 2021-05-11T16:43:02.040Z

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.

seancorfield 2021-05-11T16:44:12.040200Z

(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)

raspasov 2021-05-11T17:02:40.040400Z

@seancorfield 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”

raspasov 2021-05-11T17:04:25.040600Z

@ps sorry, I don’t have any leads at the moment. I am building a React Native app at the moment in Clojure(Script).

zendevil 2021-05-11T17:10:46.042200Z

@raspasov I launched one on App Store: https://apps.apple.com/us/app/humboi/id1561534546 in a 1.001 person start-up.

seancorfield 2021-05-11T17:14:56.042500Z

@raspasov 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.

👍 1
zendevil 2021-05-10T07:42:19.026700Z

Raspasov, I scorned at Hackerrank until I failed two job interviews that did their technical interview through Hackerrank.

raspasov 2021-05-10T08:04:54.026900Z

Understood.

raspasov 2021-05-10T08:23:27.027900Z

For #4, I would expect something like:

(defn repeated-string [s n]
 (transduce
  (comp
   (mapcat identity)
   (take n)
   (filter #(= % \a))
   (map (constantly 1)))
  +
  0
  (repeat s)))

seancorfield 2021-05-10T16:15:49.028100Z

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! 🤯

💯 1