Search by Algolia
How personalization boosts customer engagement
e-commerce

How personalization boosts customer engagement

You land on your favorite retailer’s website, where everything seems to be attractively arranged just for you. Your favorite ...

Jon Silvers

Director, Digital Marketing

What is retail analytics and how can it inform your data-driven ecommerce merchandising strategy?
e-commerce

What is retail analytics and how can it inform your data-driven ecommerce merchandising strategy?

There is such tremendous activity both on and off of retailer websites today that it would be impossible to make ...

Catherine Dee

Search and Discovery writer

8 ways to use merchandising data to boost your online store ROI
e-commerce

8 ways to use merchandising data to boost your online store ROI

New year, new goals. Sounds positive, but looking at your sales data, your revenue and profit aren’t so hot ...

John Stewart

VP, Corporate Communications and Brand

Algolia DocSearch + Astro Starlight
engineering

Algolia DocSearch + Astro Starlight

What is Astro Starlight? If you're building a documentation site, your content needs to be easy to write and ...

Jaden Baptista

Technical Writer

What role does AI play in recommendation systems and engines?
ai

What role does AI play in recommendation systems and engines?

You put that in your cart. How about this cool thing to go with it? You liked that? Here are ...

Catherine Dee

Search and Discovery writer

How AI can help improve your user experience
ux

How AI can help improve your user experience

They say you get one chance to make a great first impression. With visual design on ecommerce web pages, this ...

Jon Silvers

Director, Digital Marketing

Keeping your Algolia search index up to date
product

Keeping your Algolia search index up to date

When creating your initial Algolia index, you may seed the index with an initial set of data. This is convenient ...

Jaden Baptista

Technical Writer

Merchandising in the AI era
e-commerce

Merchandising in the AI era

For merchandisers, every website visit is an opportunity to promote products to potential buyers. In the era of AI, incorporating ...

Tariq Khan

Director of Content Marketing

Debunking the most common AI myths
ai

Debunking the most common AI myths

ARTIFICIAL INTELLIGENCE CAN’T BE TRUSTED, shouts the headline on your social media newsfeed. Is that really true, or is ...

Vincent Caruana

Senior Digital Marketing Manager, SEO

How AI can benefit the retail industry
ai

How AI can benefit the retail industry

Artificial intelligence is on a roll. It’s strengthening healthcare diagnostics, taking on office grunt work, helping banks combat fraud ...

Catherine Dee

Search and Discovery writer

How ecommerce AI is reshaping business
e-commerce

How ecommerce AI is reshaping business

Like other modern phenomena such as social media, artificial intelligence has landed on the ecommerce industry scene with a giant ...

Vincent Caruana

Senior Digital Marketing Manager, SEO

AI-driven smart merchandising: what it is and why your ecommerce store needs it
ai

AI-driven smart merchandising: what it is and why your ecommerce store needs it

Do you dream of having your own personal online shopper? Someone familiar and fun who pops up every time you ...

Catherine Dee

Search and Discovery writer

NRF 2024: A cocktail of inspiration and innovation
e-commerce

NRF 2024: A cocktail of inspiration and innovation

Retail’s big show, NRF 2024, once again brought together a wide spectrum of practitioners focused on innovation and transformation ...

Reshma Iyer

Director of Product Marketing, Ecommerce

How AI-powered personalization is transforming the user and customer experience
ai

How AI-powered personalization is transforming the user and customer experience

In a world of so many overwhelming choices for consumers, how can you best engage with the shoppers who visit ...

Vincent Caruana

Senior Digital Marketing Manager, SEO

Unveiling the future: Algolia’s AI revolution at NRF Retail Big Show
algolia

Unveiling the future: Algolia’s AI revolution at NRF Retail Big Show

Get ready for an exhilarating journey into the future of retail as Algolia takes center stage at the NRF Retail ...

John Stewart

VP Corporate Marketing

How to master personalization with AI
ai

How to master personalization with AI

Picture ecommerce in its early days: businesses were just beginning to discover the power of personalized marketing. They’d divide ...

Ciprian Borodescu

AI Product Manager | On a mission to help people succeed through the use of AI

5 best practices for nailing the ecommerce virtual assistant user experience
ai

5 best practices for nailing the ecommerce virtual assistant user experience

“Hello there, how can I help you today?”, asks the virtual shopping assistant in the lower right-hand corner ...

Vincent Caruana

Senior Digital Marketing Manager, SEO

Add InstantSearch and Autocomplete to your search experience in just 5 minutes
product

Add InstantSearch and Autocomplete to your search experience in just 5 minutes

A good starting point for building a comprehensive search experience is a straightforward app template. When crafting your application’s ...

Imogen Lovera

Senior Product Manager

Looking for something?

facebookfacebooklinkedinlinkedintwittertwittermailmail

Thanks to all of those that helped Santa by participating in our ❄️  2021 Coding Challenge ❄️  for the Holiday season!

Congratulations to everyone who submitted answers, but especially to our prize winner – Ruben Quintero! 🥳

For the rest of this post, I’ll be walking through solutions for each of the challenges using Ruben’s repositories as examples.

Let’s get started!

Challenge #1 🎤

Santa is a huge Star Trek fan. He remembers his favorite Star Trek actor once gave a Ted talk with an inspiring rating between 800 and 900 that was tagged storytelling.

What is the name of the speaker, (who is also a famous Star Trek actor), that Santa is going to visit?

The Ted Talks data set has several interesting attributes for faceting. The trick here is choosing which ones to facet (tags and inspiring_rating).

For this solution, Ruben uses the InstantSearch library for vanilla JS. A searchable RefinementList allows Santa to find the “storyteller” tag while a RangeInput filter allows him to set the appropriate range for the insipiring_rating.

We narrow the search down to two records, one of which is George Takei, who was an actor on the original Star Trek series (hurray for Sulu!).

Bonus Question

What is the most viewed TED Talk tagged for both collaboration and society?

 “How to spot a liar”

Challenge #2 📽

As he prepares for his trip Santa remembers that little Bryan, one of the children on his “nice” list, has asked for a movie that stars both the actor he plans to visit and the actress Amy Poehler. Santa needs another search interface to find the title of this movie (and when it was released).

What is the title and release year of the movie that Bryan wants for Christmas? (Submit via Form)

The Movies data set is too large for the Algolia free tier, so we need to use a hosted version. It’s important to remember that much of the configuration around faceting and relevance occurs within the index itself, not in the query. Since we don’t manage this index, we need to use the facets and searchable attributes as configured.

For this solution, Ruben again uses a searchable RefinementList for actors. This makes it very easy to find the movie “Free Birds” released in 2013. Ruben adds a RefinementList for genres and a Menu of release years to solve the bonus question.

Bonus Question

What is the title and score of the highest rated movie with the genre Crime released in 2008? 

7.88854034451496 for “The Dark Knight”

Challenge #3 🍷

What is the name of the Bordeaux wine from the Fronsac domain released in the same year as the movie in Challenge #2?

We start with the Wine data set, which suffers from some duplicate record issues. Each wine is in the data set 16 times! As Bryan and I discovered doing this challenge live, we need to de-dupe the data as we import it into the index.

Once the data is normalized, we just need to add a couple of RefinementLists for year and domain to discover the only wine from the Fronsac region bottled in 2013 is Chateau Vrai Canon Bouche.

Bonus Question

What was the highest rated wine under $30 from 2010?

Chateau Ferran

Challenge #4 🛩

Wine in hand, Santa is ready to start his journey. But where? He knows his favorite Star Trek actor recently made the following flights:

  • ATL → SEA
  • AHN → LGA
  • JFK → MCN

What is the major US city closest to all three flights listed above?

For this challenge, we use the Airports data set, but we need to combine it with map data to answer the question. Ruben chose to use the InstantSearch geoSearch widget. This widget uses the Google Maps APIs to render map data. But we can also use a custom connector for other mapping APIs.

Filtering on the airport codes above, we discover that although there are two well-known airports near New York City (LGA and JFK), there are actually three airports near Atlanta, GA (ATL, AHN, and MCN) making that the best answer.

Bonus Question

What is the closest airport to Carson National Forest in the United States?

Los Alamos Airport (LAM)

Challenge #5 🎸

Santa remembers another gift he still needs to pick up for a girl on his “nice” list. All little Julie wanted for Christmas were tickets to see the musician that played in that same city sometime between August 14 and August 18, 2019.

What was the name of the artist Julie wants to see for Christmas?

The Concert data set is again too large for the Algolia free tier, so we need to use the hosted version. This challenge is all about dates. As Bryan and I discovered in our live coding session, dates are hard.

Algolia indices store dates as Unix timestamps for filtering and ranking. We need to build an interface that makes it easier for humans to deal with these dates. We chose to use a date range picker from the Algolia Code Exchange. From there, it was just a few filters to find out the artist was Grimes playing at Cellairis Amphitheatre at Lakewood, Atlanta, GA.

Bonus Question

What was the last city where the band Coldplay performed in 2018?

Paris, France

Conclusion 🎄

Thanks to all of the amazing participants in the winter Coding Challenge. We’ll be keeping the Discord server up, so let us know if you want access. Even though the contest is over, these are still fun challenges to try to build on your own.

Happy holidays from all of us at Algolia and we’ll see you in the New Year! 🎊

Check out related solutions on our open source code exchange platform.

About the author
Chuck Meyer

Sr. Developer Relations Engineer

githubtwitter

Recommended Articles

Powered byAlgolia Algolia Recommend

Algolia Coding Challenge: Help Santa get inspired! 🎅
engineering

Julie Reboul
Chuck Meyer

Julie Reboul &

Chuck Meyer

Inside the Engine Part 8: Handling Advanced Search Use Cases
engineering

Julien Lemoine

Co-founder & former CTO at Algolia

Algolia's top 10 tips to achieve highly relevant search results
product

Julien Lemoine

Co-founder & former CTO at Algolia