exNoops v0.1.1 Exnoops.Interviewbot View Source
Module to interact with Github's Noop: Interviewbot
See the official noop
documentation for API information including the accepted parameters.
Link to this section Summary
Link to this section Functions
Link to this function
query(endpoint \\ "/interviewbot/start") View Source
Query Interviewbot for question(s)
- Parameters are sent with a keyword list into the function.
- Parameters that accept multiple values should be put into the keyword list like
{:key, [value1, value2]}
. See example below.
Examples
iex> Exnoops.Interviewbot.query()
{:ok, %{
"message" => "Welcome to your interview. Please POST your GitHub login to this URL to get started. See the exampleResponse for more information.",
"exampleResponse" => %{ "login" => "noops-challenger" }
}}
iex> Exnoops.Interviewbot.query("/interviewbot/questions/izZhyS2sCY7kZtZJf8yjizYuMo7zLE0m4Ucom4NeJYc")
{:ok, %{
"questionPath" => "/interviewbot/questions/izZhyS2sCY7kZtZJf8yjizYuMo7zLE0m4Ucom4NeJYc",
"question" => 12111900247,
"message" => "Find the prime factors of the number 12111900247. The prime factors of a number are the prime numbers that result in the number when multiplied together. The prime factors of 12 would be [2,2,3] because 2 * 2 * 3 = 12.",
"exampleResponse" => %{
"answer" => [ 2, 3, 5, 7 ]
}
}}
Link to this function
submit(endpoint, body) View Source
Submit answers to Interviewbot
Exmaples
iex> Exnoops.Interviewbot.submit("/interviewbot/start", login: "noops-challenger")
{:ok, %{
"message" => "Hello noops-challenger, get ready for your interview. Your first question is at /interviewbot/questions/izZhyS2sCY7kZtZJf8yjizYuMo7zLE0m4Ucom4NeJYc",
"nextQuestion" => "/interviewbot/questions/izZhyS2sCY7kZtZJf8yjizYuMo7zLE0m4Ucom4NeJYc"
}}