My Team's Journey to 5th Place in Code Samurai 2024 đ
A personal reflection on how our team 'Quantum Guys' navigated through different rounds and secured 5th position in Code Samurai 2024, one of Bangladesh's biggest coding competitions.
April 19, 2024 (1y ago)
10 min read
Introduction
My team "Quantum Guys" finished 5th in Code Samurai 2024. Today I will write about our journey and experience of different rounds of this competition.
Code Samurai is one of the biggest coding competitions in Bangladesh. The competition was held in collaboration with various Japanese companies and the Department of Computer Science and Engineering of Dhaka University, Bangladesh. The word samurai means warrior. As such, "Code Samurai" means one who fights by coding.
A funny memory came to mind while saying this. I saluted my teammate Junior Asfi by calling him "Samurai Man" or code warrior in the Eid salami message caption. It is basically an inter-university hackathon competition. Where each team is given to solve one or more problems according to the problem set. This year there were a total of 3 rounds in this competition. 1200+ students from around 400+ teams participated in the preliminary selection. After the preliminary selection, 90 teams are selected for the 2nd round. Out of 90 teams, 45 teams got the opportunity to participate in the main competition held in the Computer Science and Engineering Department of Dhaka University.
First Round: Railway Ticketing System đ
The 1st round was to create a backend application for a railway ticketing system. Designing the API system according to that problem was quite easy for us. In that 4 hour contest, there was a problem at 7 problems. From there I coded to connect to an online call. Except for the last optimization problem, we solved almost all of them very well.
The Challenge We Faced
But little by little we have submitted the wrong file. Where docker containers do not run properly. But we were lucky the submission time was extended by 5 minutes. Finally, I fix it in 5 minutes and submit it. But still information went over our heads. In other words, none of us really noticed. That is the requirement we were told that every time we run our application, the database starts from a fresh condition.
The Judging Process
As the judging process is fully automated, they will simply check the output from our submitted code by running it as a Docker container. If it matches the test output, I will get a score and if it doesn't match, I won't get a score. So after the submission we gave up a lot of hope that we could go to the next round Because our application was not restarting the database every time.
Technical Implementation
Moreover, our Postgres database was hosted on AWS RDS which was giving data very late when the network was low. We thought of using locally but for better collaboration we used a hosted database. And the rest of our tools for creating API systems are:
- Express JS
- Prisma ORM
However in that round we scored like 14500 out of 15000. Which was the 3rd highest score. We were really happy to finish 3rd out of so many teams. I think it gave us confidence in the other rounds as well. At the end of the 1st round, the number of teams was reduced from 400 to 90.
Second Round: Waste Management System đī¸
The 2nd round starts towards the middle of the fast. Here each team was asked to create a web based application for waste management of Dhaka North City Corporation. Where basically there were 3 types of users:
-
System Admin
- Can manage, control and monitor everything
- Adding users, doing various access controls
- Any data update, delete and assignment to relational properties
-
STS Manager
- Performs various actions from secondary waste storage stations
- Manages how much waste a truck will take
- Tracks waste currently in the Sub Station or STS
-
Landfall Manager
- Manages landfill operations (e.g., Aminbazar Landfill for North City Corporation)
- Records truck waste dumps
- Generates bills and manages truck information
Our Implementation
We put a frontend of Next.js on our previous backend and develop the whole system within 1 week as per the given time. Apart from coding, this round involved submission of our entire system design, database relationship diagram, figma layout design, use-case diagram and activity diagram.
The Dashboard Challenge
Moreover, in round 2 we had an interesting/challenging part of making a dashboard. Where we show a real time overview of the entire system on decision maps without using traditional various charts, graphs. That is, by looking at a map of Dhaka city, you can get an idea of:
- How much waste is there at this moment
- Size and color according to the capacity
- Where trucks are at this moment
- How much waste each truck is carrying
- How much waste has been dumped in landfills
- Date-based controller for historical data
The Mapping Solution
To solve this we had a plan. First we just need to highlight North City Corporation on the map divided by ward. I found online that this work can be easily integrated into Google Maps using GeoJSON. For this I talked to my friend Rafid who studies geography. He suggested installing ArcGIS to work with this.
But I had not found any specific map, shape-file of Dhaka North on the internet. Later, I got a shape-file of the whole Bangladesh, from that I deleted all the rest by keeping the ward of Dhaka North City. As a result, we got the North City shape-file. After making some additional changes, I converted it to GeoJSON with geopandas. In this map, we have shown data of all STS or stations, trucks, landfills in an interactive way.
The Submission Rush
The submission was at 12 o'clock at night. But later it was extended to 12 am the next day. I had an interview that day at 10 am but I missed it to make a video demo. The demo video wasn't very good because I was up all night trying a lot. It was very painful because there was no time. But that demo did not go well even with many retakes. Later, as I don't have time, I submit it that way.
It took a long time to give the results of the 2nd round. We scored 88.5 out of 100 in this round Which was the 3rd highest score. After this round my confidence remained intact. In this round 90 to 45 are selected for the final round.
Final Round: The Ultimate Challenge đą
There was a gap of 1 week from the result of the 2nd round before the final. We were told that in the final round we have to build a mobile app by extending the 2nd round application. I used to work with an Actively mobile app about 2 years back. Also received prizes at several hackathons and project showcasing. I had many advanced skills then, but now I have forgotten many things. At that time I was so serious about making mobile apps that many people know that an app I made in my second year got one million BDT of funding from the ICT division. This however did not see the light of day due to many other external factors. Someday I will write about this in detail.
Our Initial Prediction
Since the finals were still a few days away, we sat down and made some predictions. Looking at our 2nd round system, we noticed only one user type was missing - the drivers. Their position was continuously moving, making them perfect candidates for a mobile app. Drivers take trucks to various sub-stations for garbage, then carry it to the landfill. By tracking the location of all their trucks, we thought they could be dynamically routed on optimized routes based on the real-time waste capacity of different stations.
The Optimization Plan We Prepared
According to the 2nd round requirement, a truck visits the substations statically connected to it in only one route. But it costs a lot. It is neither optimized nor efficient. We thought that:
- A truck would not be connected to only one station
- A truck would go to any station and collect waste
- Multiple landfills instead of one
- Trucks could collect from any station and dump at any landfill
We started working on designing the algorithm to derive the optimized trip plan according to the location, capacity, and type of trucks. Our solution involved:
- Creating future plans for sub-station visits
- Calculating waste collection amounts
- Determining optimal routes
- Selecting appropriate landfills
We considered a fully connected graph with each station for trip plan optimization, with the shortest distance of two points as edges. And think of many trucks as visitors in that graph, similar to the 'traveling salesman' algorithm.
To increase the efficiency of the algorithm, we approached our department teacher, Honorable Aminul Islam Sir. He suggested using Reinforcement Learning Queue. While we couldn't implement this immediately, we saw the potential for more efficient trip planning using reinforcement learning.
The Actual Final Round Challenge
Unfortunately, our prediction didn't match the final problem set. Instead of driver optimization, we were tasked with creating a citizen app where users could:
- Post articles, pictures, and videos about waste management
- Share guidelines and awareness content
- Submit disposal-related information
- Create anonymous reports
- View nearby substations on a map
We developed all these features in an Android app with different access levels for content moderation. I leveraged components from my previous Play Store app experience, which proved very helpful.
Additional Requirements
The new problem set also added CRUD operations for worker management:
- Workers under different contractors
- Connecting substations
- Collecting waste from houses
- A challenging requirement: tracking workers without providing mobile devices
- Our solution: QR Code-based tracking system
We worked non-stop for the final implementation. After passing the primary selection of judges in the morning, we ranked in the top 10 and got the opportunity to present. We confidently demonstrated both our projects and shared our optimization mechanisms with the judges.
The Grand Finale đ
The award ceremony at DU's Senate building was a memorable experience. A Japanese magician entertained us with amazing tricks as we sat there, sleepless after 40 hours of work. The prize announcement started from 10th place, with a BUET team securing that position. Then came our moment - 5th position. Though I had hoped for a higher rank, the achievement was significant.
The Award Ceremony
The ceremony was special because:
- We received the award from billionaire Salman F Rahman
- DU's Vice-Chancellor Mr. Maqsud Kamal was present
- Three other DU teams ranked ahead of us
- SUST emerged as the champions
An interesting fact: the champion SUST team was last year's second runner-up at Leading University of Sylhet, and this year's first runner-up DU team had also been first runner-up there, where we had placed 4th.
The Japanese Connection
The event being operated by Japanese organizers added a unique cultural dimension. Their politeness and mannerisms reminded me of anime characters, from their conversations to their characteristic head tilting. Though understanding their English required some effort, their hospitality was outstanding.
Final Thoughts
While the competition was excellent overall, we did face some WiFi connectivity issues that affected our focus during the contest. Despite this challenge, this has been the best hackathon experience of my life. It still feels surreal that it's over, but I would definitely participate again if given the chance.
Our Code Repository
All our code is available on GitHub: CS24-p2-quantum_guys
A heartfelt thank you to everyone involved in organizing this amazing event. The memories and lessons learned will stay with us for years to come.
Here are some other articles you might find interesting.
Welcome to My Digital Garden đą
An introduction to who I am, what I do, and what you can expect from my blog.
āĻāĻŋāĻŽ āϏāĻŋāĻŽāύā§āϏ, āϤāĻžāϰ āĻŽā§āĻĄā§āϞāĻŋāϝāĻŧāύ āĻĢāĻžāύā§āĻĄ āĻāĻŦāĻ āϰā§āύā§āϏāĻžāύā§āϏ āĻā§āĻāύā§āϞāĻāĻŋāϏ
āĻāĻŋāĻŽ āϏāĻŋāĻŽāύā§āϏ āĻāĻāĻāύ āĻŦāĻŋāϞāĻŋāϝāĻŧāύāĻŋāϝāĻŧāĻžāϰ āĻāĻŖāĻŋāϤāĻŦāĻŋāĻĻāĨ¤ āϤāĻŋāύāĻŋ āĻŽā§āĻĄā§āϞāĻŋāϝāĻŧāύ āĻĢāĻžāύā§āĻĄ āĻ āϰā§āύā§āϏāĻžāĻ āĻā§āĻāύā§āϞāĻāĻŋāϏā§āϰ āĻĒā§āϰāϤāĻŋāώā§āĻ āĻžāϤāĻžāĨ¤ āĻāĻŖāĻŋāϤāĻā§ āĻāĻžāĻā§ āϞāĻžāĻāĻŋāϝāĻŧā§ āĻāĻŋāĻāĻžāĻŦā§ āĻŦāĻŋāϞāĻŋāϝāĻŧāύāĻŋāϝāĻŧāĻžāϰ āĻšāĻāϝāĻŧāĻž āϝāĻžāϝāĻŧ āϤāĻžāϰ āĻā§āĻŦāϞāĻā§āϝāĻžāύā§āϤ āĻāĻĻāĻžāĻšāϰāĻŖ
Get in touch
Have a question or want to work together? Send me a message!