shansiddiqui94

shansiddiqui94

Hey Guys,

Offer Accepted: No

So I was contacted a few weeks ago about this position. The role was for a junior developer with experience in engineering. Who would be willing to learn Elixir or grow with existing knowledge. Essentially the client who is using Erlang wanted to move over to Elixir.

I gave the interview one week in advance before my flight to Turkey, I also advised the CTO of my flight and time away. The CTO gave me a take-home written in Elixir assignment the day before my flight.

The Take Home:
The take-home was a bit more of a challenge than I had expected it would be. I was required to build and design a CSV parser. Below are the requirements for the task

You will design and build a module/function that parses
a CSV file and applies a 2-arity Fun, record by record.

All your work should take place in a git repository.

Please take care to document/test your code.

The processing of the file should take care to not
consume excessive memory.

The parser should conform to RFC 4180 https://www.rfc-editor.org/rfc/rfc4180

The entry point should be a 4-arity function with parameters:
  a) File
  b) Fun (the fun to be applied to each valid row)
  c) Separator (default to comma)
  d) Maximum Error Count (default 0)

For simplicity sake:

  a) Treat the first row of the CSV as the header
  b) The Fun being passed should convert
     the received data into a map with keys being the
     values of the CSV header row and print them to stand out.

Error rows should be accumulated, should parsing
complete with less than the Maximum Error Count,
return the error rows with the reasons.

Please do not spend more than 2 hours on the task.

Personally I have never done anything like this before. I began to research and ask around how to attempt this. The reddit community told me that building a CSV parser without a framework is not recommended. So I attempted and didn’t get very far. My answers below

defmodule ParserProj22 do

  def entry_point(file, format_data, separator \\ ",", max_error_count \\ 0 ) do
    file
      |> Stream.file!

  end

  def format_data([headers | row] = data) do
    map = 
      headers
      |> Enum.zip(row)
      |> Enum.into(%{}) 
      
      IO.puts(map)
  end
end

# Map.new([{:b, 1}, {:a, 2}])

As you can see I didn’t get very far. How else could I have solved this problem?
Thank you for hearing me out, I understand the company wanted to see where I was at. However, I did advise them That I did not do Elixir professionally

Showing Posts 1 to 1

dimitarvp

dimitarvp

Alright then, let’s start small. Given you have this string:

text = "111,222,333"

How would you transform that to [111, 222, 333]?

— All posts loaded —

Where Next? Top

Trending in Discussions Top

cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
achempion
I’ve been using Emacs as my main code editor for more than a two years. It’s a custom build version although I’ve tried doom emacs and sp...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
jtormey
Lately I’ve been thinking about how to organize components as a LiveView application grows. One of the pain points I’ve found (for myself...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
georgeguimaraes
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews