The SingleStore Code Challenge: December

We’ve created an exciting code challenge to get the holiday mental juices flowing. Here’s an interesting problem to solve using SingleStore. Solve this code challenge, post your answer as a public GitHub repo or gist, and submit your answer to receive a special December Code Challenge badge on these forums.

The Problem

  1. Given these 3 CSVs (1 line per file):
'Customer 1'\t'Account abc'\t'["tag1", "tag3", "tag5"]'
'Customer 2'\t'Account def'\t'["tag2", "tag3", "tag4"]'
'Customer 3'\t'Account chi'\t'["tag3", "tag4", "tag5"]'
  1. Injest these files into a table.

  2. Craft a SELECT query that yields this:

[
  {
    "tag": "tag3",
    "matches": ["Customer1", "Customer2", "Customer3"]
  },
  {
    "tag": "tag4",
    "matches": ["Customer2", "Customer3"]
  },
  {
    "tag": "tag5",
    "matches": ["Customer1", "Customer3"]
  },
  {
    "tag": "tag1",
    "matches": ["Customer1"]
  },
  {
    "tag": "tag2",
    "matches": ["Customer2"]
  }
]

How to Win

  1. Post your solution as a public GitHub Repo or GitHub Gist.

  2. Submit your GitHub URL to https://msql.co/3oDSoTD.

  3. All complete entries will receive this month’s special Code Challenge badge in the forum.

2 Likes