Take Home Reflection — 2 Questions I Encountered in my job search and how I solved them.

Emrich-Michael Perrier
2 min readJan 24, 2023

Hey guys, it’s been awhile but I wanted to write something up that could help people and give me sometime to reflect on the questions I did for a recent take home. For context: I received a test to take for a company I am interested in, this test is a part of their screening process before the interview. The first question was technical and required some hard coding, the second question was also technical but required an explanation. Here are the questions and here are the answers and an explanation.

Problem 1: Write a function

The first problem asked for me to write a function. A number is supposed to be passed into the function and the function is supposed to return the sum of the digits in the number. For example, if the number 29 was passed in, the function would return 11 because 2+9 is 11. This one was actually very simple, we need to grab the digits individually then add them up together!

Here was my solution

function number(n) {
let div = n.toString().split('');
return parseInt(div[0]) + parseInt(div[1])
}

the problem did not specify if there would be a case with more than 2 numbers but I passed all the test, so I assume the answer is satisfactory. I’m sure there are multiple ways to solve this one, my challenge for you is to solve this same problem but for any number of digits!

Problem 2: Explain a Process

The second problem I encountered was to explain the process that occurs when you load up a webpage. I’m going to keep this one short but I gave 6 bullet points and then wrote a detailed explanation under each point. Here are the bullet points I provided!

  1. Click link or type in URL
  2. Browser looks up IP address for the domain
  3. Browser initiates TCP connection with the server
  4. Browser sends the HTTP request to the server
  5. Server processes request and sends back a response
  6. Browser renders the content

My challenge for you is to look up what each bullet point means and understand each part of the process. I had a ton of fun writing this one out and it helped deepen my understanding of the process too!

All in all, this was actually a coding challenge I really enjoyed. Normally I despise algorithm like problems but I had a lot of fun with this pre-screen. They always seem super scary but at the end of the day, you just need to take it 1 step at a time! Here is a little post I wrote on live coding and a lot of the same principles can be applied on these tests. I really hope you enjoyed!

Happy Coding :D

--

--

Emrich-Michael Perrier

Fulltime Frontend Developer, Anime nerd and lifter of heavy weight in competition