Software Engineer • Senior-Level
Software Engineer • Senior-Level
High QualityPrep Other Coding Questions Asked by Confluent
Continue with targeted prep from Confluent's coding question bank.
Interview Summary
The first question involved simulating moving objects and collisions on a table, while the second required calculating a large sum involving modular arithmetic.
Interview Details
Question 1 — Simulation: Last Object to Leave a Table
The first problem involved several objects moving along a one-dimensional table of a given length. I was given two arrays, position[] and velocity[], representing the initial position and velocity of each object, along with the table length L.
A positive velocity meant the object moved to the right, while a negative velocity meant it moved to the left. Whenever two objects collided, they exchanged velocities and continued moving until they eventually fell off either end of the table.
The task was to determine when the last object would leave the table and return that time rounded up to the nearest integer. The problem was similar to the classic Ants on a Plank problem, where the collision behavior creates an interesting relationship between the objects' physical movements and their effective trajectories.
**Example — Objects Exchanging
Unlock Full Details
Create a free account to unlock this interview experience report.