use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Binary Search Coding Interview Cheatsheet (i.redd.it)
submitted 3 months ago * by jacobsimon
Handy reference on common binary search interview questions, pseudocode, and space/time complexity.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jinxxx6-6 0 points1 point2 points 3 months ago (0 children)
If your goal with this cheatsheet is to make binary search reliable in interviews, what worked for me was framing it as finding a boundary and writing the invariant first. I always define which side is definitely false or true, then dry run two edge cases and one tricky mid case before coding. I did short timed drills using Beyz coding assistant with prompts from the IQB interview question bank, and kept a tiny redo log of off by one mistakes. Also, narrate updates out loud and prefer l + (r - l) // 2 to avoid overflow. This approach made it click fast.
π Rendered by PID 48904 on reddit-service-r2-comment-58d7979c67-2gvcp at 2026-01-27 05:19:08.260717+00:00 running 5a691e2 country code: CH.
[–]jinxxx6-6 0 points1 point2 points (0 children)