Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Technical Interview Template

technical_interview.livemd

Technical Interview Template

# Dependencies
Mix.install([
  {:heap, "~> 3.0"},
  {:libgraph, "~> 0.16.0"},
  # visualizations for Livebooks
  {:kino, "~> 0.11.0"},
  # http request library
  {:req, "~> 0.4.4"},
  # Repository data mapper
  {:ecto, "~> 3.10"},
  # GraphQL library
  {:absinthe, "~> 1.7"}
])

# Test Framework
ExUnit.start(autorun: false)

Requirements

Story:

>

Questions / Clarifications

*

Approach

1.

Examples

defmodule Assignment.Fixtures do
  use ExUnit.CaseTemplate

  setup _context do
    %{
      example: %{}
    }
  end
end

Implementation

defmodule Assignment do
  def run(input) when not is_nil(input) do
    %{}
  end
end

Testing

defmodule Test.Assignment do
  import Assignment
  use ExUnit.Case, async: true
  use Assignment.Fixtures

  describe "Assignment.run/1" do
    test "it works", %{example: example} do
      assert run(example) == example
    end

    test "nil throws an error" do
      assert_raise FunctionClauseError, "no function clause matching in Assignment.run/1", fn ->
        run(nil)
      end
    end
  end
end

ExUnit.run()

Retrospective

Timeline

Start Time End Time Total Time
??? ??? 1:50

Results / Feedback

*