![]() The caveat with this approach is that you have to parse the output string to extract out the necessary information. By formatting the command with the destination host IP address we will be able to figure out the network interface a packet takes to reach the destination host. Fortuitously, we found the Linux command in no time to query the routing table to extract the desired information (network interface). Our first thought solution was to leverage the Routing table. A bit of schooling - If a packet wants to reach a host located in a private network, will take Network Interface 1 as its exit route, likewise a packet takes Network Interface 2 to reach a host in public network. Given this setup, our goal was to find the network interface the packet takes to reach its destination. So it turned out to be an unprecedented requirement for us to solve.įor the purpose of illustration, let us assume that we have two networks connected to the machine and one of the two networks is a public network and the other is a private network. If we fail to pass on the right network interface to the receiver, our whole purpose of building that feature will be collapsed. As the host machine is connected to multiple networks, the challenge is to identify the right network interface that is accessible by the remote machine and configure the corresponding IP address on the remote machine. We were developing a feature, in which, we had to configure the host machine IP address on a remote machine so that the remote machine can pull data at its ease. If you are on the rush of finding the solution, scroll down all the way to the end. Though this problem seems to be a very trivial one on the first sight from the implementation point of view, the way the problem is solved easily in Golang is laudable. But in our case, the host machine has multiple network interfaces bridging different networks. The use case would’ve been a non-issue if the host machine had a single network interface. Each row containing delivery ID, indication if delivery is possible (true/false), selected partner and cost of delivery.This post shares our experience on finding a way to determine the network interfaces on a Linux Machine that provides the route to a particular remote machine. Each row containing delivery ID, size of delivery and theatre ID.Įxpected Output: A CSV output.csv. If delivery is not possible, mark that delivery impossible. Given a list of content size and Theatre ID, Find the partner for each delivery where cost of delivery is minimum. Aim to solve atleast Problem Statement 1. The codes you see in csv may be different from what you see in tables, so please always use the codes in the CSV. Please use the data mentioned there for this program instead of data given in Table 1 and 2. We've provided a CSV partners.csv with the list of all partners, theatres, content size, minimum cost and cost per GB. QUBE CINEMAS FREEFeel free to hold the datasets in whatever data structure you want, but try not to use external databases - as far as possible stick to your langauage without bringing in MySQL/Postgres/MongoDB/Redis/Etc. Multiple partners can deliver to same theatre However, if total cost comes less than minimum cost, minimum cost (2000 paise) will be charged. There are multiple delivery partners to help us deliver the content.ĭelivery partners specify the rate of delivery and cost in following manner (All costs are in paise):įirst row allows 0 to 200 GB content to be sent to theatre T1 with the rate 20 paise per GB. QUBE CINEMAS MOVIEQube delivers the movie content to theatres all around the world. Qube Cinemas Challenge 2019 - Problem Statements ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |