this post was submitted on 14 Apr 2024
328 points (94.1% liked)

linuxmemes

20909 readers
2062 users here now

I use Arch btw


Sister communities:

Community rules

  1. Follow the site-wide rules and code of conduct
  2. Be civil
  3. Post Linux-related content
  4. No recent reposts

Please report posts and comments that break these rules!

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Tartas1995@discuss.tchncs.de 27 points 5 months ago (8 children)

I hope these aren't real. I, and most people here, could probably write these codes top to bottom on paper without an eraser or strikethrough parts because we have it fully solved before the interviewer finished the sentence.

[–] sntx@lemm.ee 7 points 5 months ago (7 children)

I mean, it's a hard problem to solve if you never worked with moduli before.

[–] Hope@lemmy.world 9 points 5 months ago (1 children)

Is it? I would expect someone to come up with either toggling a variable back and forth for even/odd, or counting by 2s, heck, treat it as a floating point, divide by two, and search the string representation for a period or something!

[–] sntx@lemm.ee 1 points 5 months ago

I feel like the floating point suggestion would backfire quickly due to imprecisions.

load more comments (5 replies)
load more comments (5 replies)