Skip to content

chrisjacksonn/interview-sim / skills/sim

Run a timed coding assessment simulation in the terminal. Use for OA practice, GCA or ICA mocks, mock interviews, pairing rounds, take-homes, and pasted job postings.

FileKindSize
SKILL.mdskill md21.7 KB
questions/gca/batch-split/meta.jsonconfig265 B
questions/gca/batch-split/mutants/average_target.pyscript131 B
questions/gca/batch-split/mutants/even_chunks.pyscript194 B
questions/gca/batch-split/mutants/exhaustive.pyscript546 B
questions/gca/batch-split/mutants/low_starts_at_zero.pyscript359 B
questions/gca/batch-split/mutants/requires_exact_group_count.pyscript388 B
questions/gca/batch-split/mutants/sorts_first.pyscript388 B
questions/gca/batch-split/mutants/strict_greedy_off_by_one.pyscript389 B
questions/gca/batch-split/problem.mdmarkdown991 B
questions/gca/batch-split/reference.pyscript1.1 KB
questions/gca/batch-split/starter.pyscript473 B
questions/gca/batch-split/tests_hidden.pyscript4.2 KB
questions/gca/batch-split/tests_public.pyscript544 B
questions/gca/bracket-check/meta.jsonconfig249 B
questions/gca/bracket-check/mutants/angle_brackets_count.pyscript283 B
questions/gca/bracket-check/mutants/counts_only.pyscript143 B
questions/gca/bracket-check/mutants/empty_stack_pop.pyscript270 B
questions/gca/bracket-check/mutants/forgets_leftovers.pyscript268 B
questions/gca/bracket-check/mutants/ignores_kind.pyscript241 B
questions/gca/bracket-check/mutants/leftover_openers_pass_patch.pyscript190 B
questions/gca/bracket-check/mutants/recursive.pyscript446 B
questions/gca/bracket-check/mutants/returns_truthy_not_bool.pyscript286 B
questions/gca/bracket-check/problem.mdmarkdown700 B
questions/gca/bracket-check/reference.pyscript410 B
questions/gca/bracket-check/starter.pyscript344 B
questions/gca/bracket-check/tests_hidden.pyscript3.0 KB
questions/gca/bracket-check/tests_public.pyscript620 B
questions/gca/build-order/meta.jsonconfig273 B
questions/gca/build-order/mutants/duplicate_blocks_forever.pyscript814 B
questions/gca/build-order/mutants/no_tiebreak.pyscript589 B
questions/gca/build-order/mutants/partial_on_cycle.pyscript606 B
questions/gca/build-order/mutants/pre_sorted_not_dynamic.pyscript612 B
questions/gca/build-order/mutants/recursive_dfs.pyscript672 B
questions/gca/build-order/mutants/unknown_tasks_counted.pyscript662 B
questions/gca/build-order/problem.mdmarkdown1.4 KB
questions/gca/build-order/reference.pyscript1.1 KB
questions/gca/build-order/starter.pyscript605 B
questions/gca/build-order/tests_hidden.pyscript5.1 KB
questions/gca/build-order/tests_public.pyscript817 B
questions/gca/checkout-rules/meta.jsonconfig504 B
questions/gca/checkout-rules/mutants/accepts_a_free_deal.pyscript1.5 KB
questions/gca/checkout-rules/mutants/accepts_deal_quantity_one.pyscript1.5 KB
questions/gca/checkout-rules/mutants/bad_price_still_stored.pyscript1.5 KB
questions/gca/checkout-rules/mutants/clear_wipes_everything.pyscript1.6 KB
questions/gca/checkout-rules/mutants/deal_applies_once.pyscript1.6 KB
questions/gca/checkout-rules/mutants/leftover_at_deal_price.pyscript1.5 KB
questions/gca/checkout-rules/mutants/leftover_dropped.pyscript1.5 KB
questions/gca/checkout-rules/mutants/price_snapshot_at_scan.pyscript1.6 KB
questions/gca/checkout-rules/problem.mdmarkdown2.6 KB
questions/gca/checkout-rules/reference.pyscript1.6 KB
questions/gca/checkout-rules/starter.pyscript826 B
questions/gca/checkout-rules/tests_hidden.pyscript8.3 KB
questions/gca/checkout-rules/tests_public.pyscript879 B
questions/gca/dup-window/meta.jsonconfig290 B
questions/gca/dup-window/mutants/abs_window.pyscript692 B
questions/gca/dup-window/mutants/case_insensitive.pyscript672 B
questions/gca/dup-window/mutants/dedupes_stamps.pyscript716 B
questions/gca/dup-window/mutants/exclusive_window.pyscript669 B
questions/gca/dup-window/mutants/mutates_input.pyscript703 B
questions/gca/dup-window/mutants/spread_not_gap.pyscript630 B
questions/gca/dup-window/mutants/unsorted_output.pyscript655 B
questions/gca/dup-window/mutants/unsorted_stamps.pyscript674 B
questions/gca/dup-window/problem.mdmarkdown1.0 KB
questions/gca/dup-window/reference.pyscript538 B
questions/gca/dup-window/starter.pyscript430 B
questions/gca/dup-window/tests_hidden.pyscript3.2 KB
questions/gca/dup-window/tests_public.pyscript666 B
questions/gca/floor-robot/meta.jsonconfig523 B
questions/gca/floor-robot/mutants/back_goes_forward.pyscript2.1 KB
questions/gca/floor-robot/mutants/east_wall_off_by_one.pyscript2.2 KB
questions/gca/floor-robot/mutants/floor_wraps.pyscript2.1 KB
questions/gca/floor-robot/mutants/place_ignores_racking.pyscript2.1 KB
questions/gca/floor-robot/mutants/racking_ignored_when_moving.pyscript2.1 KB
questions/gca/floor-robot/mutants/refusal_stops_the_run.pyscript2.2 KB
questions/gca/floor-robot/mutants/turns_are_swapped.pyscript2.1 KB
questions/gca/floor-robot/mutants/unknown_commands_ignored.pyscript2.1 KB
questions/gca/floor-robot/problem.mdmarkdown2.3 KB
questions/gca/floor-robot/reference.pyscript2.2 KB
questions/gca/floor-robot/starter.pyscript693 B
questions/gca/floor-robot/tests_hidden.pyscript7.4 KB
questions/gca/floor-robot/tests_public.pyscript717 B
questions/gca/log-window/meta.jsonconfig255 B
questions/gca/log-window/mutants/forgets_first_window.pyscript246 B
questions/gca/log-window/mutants/no_width_guard.pyscript225 B
questions/gca/log-window/mutants/off_by_one_range.pyscript250 B
questions/gca/log-window/mutants/quadratic.pyscript152 B
questions/gca/log-window/mutants/returns_average.pyscript257 B
questions/gca/log-window/mutants/wrong_subtract_index.pyscript250 B
questions/gca/log-window/problem.mdmarkdown735 B
questions/gca/log-window/reference.pyscript491 B
questions/gca/log-window/starter.pyscript418 B
questions/gca/log-window/tests_hidden.pyscript2.6 KB
questions/gca/log-window/tests_public.pyscript560 B
questions/gca/merge-feeds/meta.jsonconfig255 B
questions/gca/merge-feeds/mutants/advances_wrong_feed.pyscript437 B
questions/gca/merge-feeds/mutants/dedupes.pyscript127 B
questions/gca/merge-feeds/mutants/forgets_empty_feeds.pyscript336 B
questions/gca/merge-feeds/mutants/mutates_input.pyscript324 B
questions/gca/merge-feeds/mutants/negative_limit_slice.pyscript398 B
questions/gca/merge-feeds/mutants/never_advances.pyscript379 B
questions/gca/merge-feeds/mutants/only_first_feed.pyscript101 B
questions/gca/merge-feeds/mutants/sorts_the_input.pyscript989 B
questions/gca/merge-feeds/mutants/unsorted_output.pyscript168 B
questions/gca/merge-feeds/problem.mdmarkdown1011 B
questions/gca/merge-feeds/reference.pyscript971 B
questions/gca/merge-feeds/starter.pyscript439 B
questions/gca/merge-feeds/tests_hidden.pyscript4.3 KB
questions/gca/merge-feeds/tests_public.pyscript683 B
questions/gca/pack-combinations/meta.jsonconfig286 B
questions/gca/pack-combinations/mutants/assigns_instead_of_adds.pyscript341 B
questions/gca/pack-combinations/mutants/counts_permutations.pyscript344 B
questions/gca/pack-combinations/mutants/descending_inner_loop.pyscript337 B
questions/gca/pack-combinations/mutants/duplicates_multiply.pyscript267 B
questions/gca/pack-combinations/mutants/exponential.pyscript400 B
questions/gca/pack-combinations/mutants/modulo.pyscript311 B
questions/gca/pack-combinations/mutants/off_by_one_range.pyscript345 B
questions/gca/pack-combinations/mutants/zero_target_is_zero.pyscript301 B
questions/gca/pack-combinations/problem.mdmarkdown1000 B
questions/gca/pack-combinations/reference.pyscript738 B
questions/gca/pack-combinations/starter.pyscript495 B
questions/gca/pack-combinations/tests_hidden.pyscript3.8 KB
questions/gca/pack-combinations/tests_public.pyscript628 B
questions/gca/request-budget/meta.jsonconfig558 B
questions/gca/request-budget/mutants/closed_boundary.pyscript1.4 KB
questions/gca/request-budget/mutants/count_never_expires.pyscript1.4 KB
questions/gca/request-budget/mutants/counts_refusals.pyscript1.4 KB
questions/gca/request-budget/mutants/empty_key_allowed.pyscript1.3 KB
questions/gca/request-budget/mutants/no_expiry_on_allow.pyscript1.3 KB
questions/gca/request-budget/mutants/no_validation.pyscript1.2 KB
questions/gca/request-budget/mutants/off_by_one_limit.pyscript1.4 KB
questions/gca/request-budget/mutants/shared_budget.pyscript1.4 KB
questions/gca/request-budget/problem.mdmarkdown2.4 KB
questions/gca/request-budget/reference.pyscript1.6 KB
questions/gca/request-budget/starter.pyscript601 B
questions/gca/request-budget/tests_hidden.pyscript8.1 KB
questions/gca/request-budget/tests_public.pyscript1.1 KB
questions/gca/room-schedule/meta.jsonconfig266 B
questions/gca/room-schedule/mutants/assumes_sorted.pyscript207 B
questions/gca/room-schedule/mutants/closed_intervals.pyscript251 B
questions/gca/room-schedule/mutants/counts_total_meetings.pyscript71 B
questions/gca/room-schedule/mutants/final_not_peak.pyscript226 B
questions/gca/room-schedule/mutants/keeps_degenerate.pyscript196 B
questions/gca/room-schedule/mutants/quadratic_pairwise.pyscript205 B
questions/gca/room-schedule/problem.mdmarkdown860 B
questions/gca/room-schedule/reference.pyscript721 B
questions/gca/room-schedule/starter.pyscript408 B
questions/gca/room-schedule/tests_hidden.pyscript3.5 KB
questions/gca/room-schedule/tests_public.pyscript585 B
questions/gca/route-fuel/meta.jsonconfig294 B
questions/gca/route-fuel/mutants/bool_when_no_stops.pyscript739 B
questions/gca/route-fuel/mutants/first_not_largest.pyscript526 B
questions/gca/route-fuel/mutants/no_sort.pyscript637 B
questions/gca/route-fuel/mutants/off_by_one_stops.pyscript652 B
questions/gca/route-fuel/mutants/returns_stops_when_stuck.pyscript652 B
questions/gca/route-fuel/mutants/smallest_depot.pyscript670 B
questions/gca/route-fuel/mutants/sorts_in_place.pyscript590 B
questions/gca/route-fuel/mutants/strictly_less_reachable.pyscript644 B
questions/gca/route-fuel/problem.mdmarkdown1.1 KB
questions/gca/route-fuel/reference.pyscript850 B
questions/gca/route-fuel/starter.pyscript480 B
questions/gca/route-fuel/tests_hidden.pyscript3.2 KB
questions/gca/route-fuel/tests_public.pyscript600 B
questions/gca/run-compression/meta.jsonconfig252 B
questions/gca/run-compression/mutants/always_compresses.pyscript292 B
questions/gca/run-compression/mutants/case_insensitive.pyscript329 B
questions/gca/run-compression/mutants/compresses_twos.pyscript313 B
questions/gca/run-compression/mutants/counts_total_not_run.pyscript334 B
questions/gca/run-compression/mutants/drops_final_run.pyscript267 B
questions/gca/run-compression/mutants/threshold_four.pyscript313 B
questions/gca/run-compression/problem.mdmarkdown901 B
questions/gca/run-compression/reference.pyscript632 B
questions/gca/run-compression/starter.pyscript343 B
questions/gca/run-compression/tests_hidden.pyscript3.0 KB
questions/gca/run-compression/tests_public.pyscript648 B
questions/gca/sensor-gaps/meta.jsonconfig263 B
questions/gca/sensor-gaps/mutants/dedupes.pyscript289 B
questions/gca/sensor-gaps/mutants/first_gap.pyscript249 B
questions/gca/sensor-gaps/mutants/includes_singletons.pyscript282 B
questions/gca/sensor-gaps/mutants/no_grouping.pyscript207 B
questions/gca/sensor-gaps/mutants/span_not_gap.pyscript235 B
questions/gca/sensor-gaps/mutants/takes_min.pyscript283 B
questions/gca/sensor-gaps/mutants/unsorted.pyscript265 B
questions/gca/sensor-gaps/problem.mdmarkdown1.2 KB
questions/gca/sensor-gaps/reference.pyscript582 B
questions/gca/sensor-gaps/starter.pyscript418 B
questions/gca/sensor-gaps/tests_hidden.pyscript3.5 KB
questions/gca/sensor-gaps/tests_public.pyscript748 B
questions/gca/sensor-median/meta.jsonconfig306 B
questions/gca/sensor-median/mutants/int_division_even.pyscript774 B
questions/gca/sensor-median/mutants/lower_of_the_two.pyscript746 B
questions/gca/sensor-median/mutants/middle_off_by_one.pyscript751 B
questions/gca/sensor-median/mutants/mutates_input.pyscript625 B
questions/gca/sensor-median/mutants/no_width_guard.pyscript817 B
questions/gca/sensor-median/mutants/odd_returns_int.pyscript766 B
questions/gca/sensor-median/mutants/pops_front_not_leaving.pyscript703 B
questions/gca/sensor-median/mutants/unsorted_window.pyscript607 B
questions/gca/sensor-median/problem.mdmarkdown851 B
questions/gca/sensor-median/reference.pyscript770 B
questions/gca/sensor-median/starter.pyscript391 B

questions/gca/floor-robot/tests_hidden.py

View on GitHub
"""Floor Robot hidden suite.

Never copied into a session workspace.

Weighted toward turning, which is where a working-looking robot is usually
wrong in one direction only, and toward the rule that a refused command stops
that command rather than the rest of the string.
"""

import unittest

from solution import Robot


class TestFloorRobot(unittest.TestCase):
    # --- starting state ---

    def test_starts_at_the_origin_facing_north(self):
        self.assertEqual(Robot(5, 5).where(), (0, 0, "N"))

    def test_an_empty_command_string_does_nothing(self):
        robot = Robot(5, 5)
        self.assertEqual(robot.run(""), 0)
        self.assertEqual(robot.where(), (0, 0, "N"))

    def test_a_one_by_one_floor_is_allowed(self):
        robot = Robot(1, 1)
        self.assertEqual(robot.run("FFFF"), 4)
        self.assertEqual(robot.where(), (0, 0, "N"))

    def test_a_zero_dimension_raises(self):
        with self.assertRaises(ValueError):
            Robot(0, 5)
        with self.assertRaises(ValueError):
            Robot(5, 0)

    def test_a_negative_dimension_raises(self):
        with self.assertRaises(ValueError):
            Robot(-3, 5)

    # --- turning ---

    def test_right_from_north_is_east(self):
        robot = Robot(5, 5)
        robot.run("R")
        self.assertEqual(robot.where()[2], "E")

    def test_left_from_north_is_west(self):
        robot = Robot(5, 5)
        robot.run("L")
        self.assertEqual(robot.where()[2], "W")

    def test_four_rights_come_home(self):
        robot = Robot(5, 5)
        robot.run("RRRR")
        self.assertEqual(robot.where()[2], "N")

    def test_four_lefts_come_home(self):
        robot = Robot(5, 5)
        robot.run("LLLL")
        self.assertEqual(robot.where()[2], "N")

    def test_the_whole_compass_rightwards(self):
        robot = Robot(5, 5)
        seen = []
        for _ in range(4):
            robot.run("R")
            seen.append(robot.where()[2])
        self.assertEqual(seen, ["E", "S", "W", "N"])

    def test_the_whole_compass_leftwards(self):
        robot = Robot(5, 5)
        seen = []
        for _ in range(4):
            robot.run("L")
            seen.append(robot.where()[2])
        self.assertEqual(seen, ["W", "S", "E", "N"])

    def test_turning_never_refuses(self):
        robot = Robot(1, 1)
        self.assertEqual(robot.run("LRLRLR"), 0)

    # --- moving ---

    def test_forward_goes_the_way_it_faces(self):
        robot = Robot(5, 5)
        robot.run("F")
        self.assertEqual(robot.where(), (0, 1, "N"))
        robot.run("RF")
        self.assertEqual(robot.where(), (1, 1, "E"))

    def test_back_does_not_turn_the_robot(self):
        robot = Robot(5, 5)
        robot.run("FFB")
        self.assertEqual(robot.where(), (0, 1, "N"))

    def test_back_from_each_facing(self):
        robot = Robot(5, 5)
        robot.place(2, 2, "E")
        robot.run("B")
        self.assertEqual(robot.where(), (1, 2, "E"))
        robot.place(2, 2, "S")
        robot.run("B")
        self.assertEqual(robot.where(), (2, 3, "S"))

    def test_a_longer_drive(self):
        robot = Robot(5, 5)
        self.assertEqual(robot.run("FFRFF"), 0)
        self.assertEqual(robot.where(), (2, 2, "E"))

    # --- walls ---

    def test_the_north_wall_refuses(self):
        robot = Robot(3, 3)
        self.assertEqual(robot.run("FFF"), 1)
        self.assertEqual(robot.where(), (0, 2, "N"))

    def test_the_east_wall_refuses(self):
        robot = Robot(3, 3)
        self.assertEqual(robot.run("RFFF"), 1)
        self.assertEqual(robot.where(), (2, 0, "E"))

    def test_the_south_and_west_walls_refuse(self):
        robot = Robot(3, 3)
        self.assertEqual(robot.run("BB"), 2)
        self.assertEqual(robot.run("RBB"), 2)
        self.assertEqual(robot.where(), (0, 0, "E"))

    def test_a_refused_move_does_not_stop_the_rest(self):
        robot = Robot(3, 3)
        self.assertEqual(robot.run("BRF"), 1)
        self.assertEqual(robot.where(), (1, 0, "E"))

    # --- racking ---

    def test_racking_refuses_a_move(self):
        robot = Robot(3, 3)
        robot.block(0, 1)
        self.assertEqual(robot.run("F"), 1)
        self.assertEqual(robot.where(), (0, 0, "N"))

    def test_driving_around_racking(self):
        robot = Robot(3, 3)
        robot.block(0, 1)
        self.assertEqual(robot.run("RFLFF"), 0)
        self.assertEqual(robot.where(), (1, 2, "N"))

    def test_blocking_off_the_floor_is_refused(self):
        robot = Robot(3, 3)
        self.assertIs(robot.block(5, 5), False)
        self.assertIs(robot.block(-1, 0), False)

    def test_blocking_the_robot_s_own_square_is_refused(self):
        robot = Robot(3, 3)
        self.assertIs(robot.block(0, 0), False)
        self.assertEqual(robot.run("F"), 0)

    def test_blocking_twice_is_fine(self):
        robot = Robot(3, 3)
        self.assertIs(robot.block(1, 1), True)
        self.assertIs(robot.block(1, 1), True)

    def test_racking_blocks_a_backward_move_too(self):
        robot = Robot(3, 3)
        robot.place(1, 1, "N")
        robot.block(1, 0)
        self.assertEqual(robot.run("B"), 1)
        self.assertEqual(robot.where(), (1, 1, "N"))

    # --- placing ---

    def test_place_moves_and_points(self):
        robot = Robot(5, 5)
        self.assertIs(robot.place(3, 4, "S"), True)
        self.assertEqual(robot.where(), (3, 4, "S"))

    def test_place_ignores_what_is_in_between(self):
        robot = Robot(5, 5)
        robot.block(0, 1)
        self.assertIs(robot.place(0, 3, "N"), True)
        self.assertEqual(robot.where(), (0, 3, "N"))

    def test_place_off_the_floor_is_refused_and_changes_nothing(self):
        robot = Robot(3, 3)
        robot.place(1, 1, "E")
        self.assertIs(robot.place(9, 9, "N"), False)
        self.assertEqual(robot.where(), (1, 1, "E"))

    def test_place_onto_racking_is_refused(self):
        robot = Robot(3, 3)
        robot.block(2, 2)
        self.assertIs(robot.place(2, 2, "N"), False)
        self.assertEqual(robot.where(), (0, 0, "N"))

    def test_a_bad_facing_is_refused(self):
        robot = Robot(3, 3)
        self.assertIs(robot.place(1, 1, "up"), False)
        self.assertIs(robot.place(1, 1, "n"), False)
        self.assertEqual(robot.where(), (0, 0, "N"))

    # --- unrecognised commands ---

    def test_an_unknown_command_is_counted_and_changes_nothing(self):
        robot = Robot(5, 5)
        self.assertEqual(robot.run("X"), 1)
        self.assertEqual(robot.where(), (0, 0, "N"))

    def test_commands_are_case_sensitive(self):
        robot = Robot(5, 5)
        self.assertEqual(robot.run("f"), 1)
        self.assertEqual(robot.where(), (0, 0, "N"))

    def test_a_space_is_not_a_command(self):
        robot = Robot(5, 5)
        self.assertEqual(robot.run("F F"), 1)
        self.assertEqual(robot.where(), (0, 2, "N"))

    def test_refusals_of_every_kind_add_up(self):
        robot = Robot(2, 2)
        robot.block(1, 1)
        # B into the south wall, X unknown, F to (0,1) works, R faces east,
        # F into the racking at (1,1).
        self.assertEqual(robot.run("BXFRF"), 3)
        self.assertEqual(robot.where(), (0, 1, "E"))

    # --- scale ---

    def test_a_long_command_string(self):
        robot = Robot(1000, 1000)
        self.assertEqual(robot.run("F" * 200000), 200000 - 999)
        self.assertEqual(robot.where(), (0, 999, "N"))

    def test_a_long_circuit(self):
        robot = Robot(1000, 1000)
        robot.run(("F" * 999 + "R") * 4)
        self.assertEqual(robot.where(), (0, 0, "N"))


if __name__ == "__main__":
    unittest.main()
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall