fivetran logo
Fivetran· SDE II

Fivetran SDE 2 Connectors interview question

Posted
10 Jun 2023
343 reads

Summary

During my interview for an SDE2 role at Fivetran, I was presented with a HackerRank coding challenge that involved optimizing car positions on a 2D plane to achieve a minimum fuel cost.

How it went

I participated in an interview round for the SDE2 position at Fivetran. The interview was conducted on the HackerRank platform, where I was given a specific coding problem to solve.

Questions asked (1)

  1. 01

    Minimize Fuel Cost to Align Cars on a Line

    Data Structures & Algorithms

    Given a 2D plane, we are given n cars and their position coordinates on the 2D plane in the form of an array.

    I/P format: X[n] -> x-coordinates of n cars, Y[n] -> y coordinates of n cars

    The objective of the problem is to bring all the cars on the same line parallel to the horizontal (x-axis) in 2D plane, with no gap between 2 cars. We are asked to achieve the objective with minimum fuel cost. The fuel cost for moving a car from (x1,y1) to (x2, y2) is abs(x1-x2) + abs(y1-y2)

    Note: no gap between cars mean that if car1 is parked at (x1, y) then the next car should be parked at (x1+1, y)

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Fivetran recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!