Git Product home page Git Product logo

illumio-test-repo's Introduction

illumio-test-repo

  1. how you tested your solution
    

I wrote a FLOW and a NAT file, and I tested them against my program. A more rigorous way to test my program would be to write a script that generates NATs and IPs, but for such a simple program I didn't do that.

  1. any interesting coding, design, or algorithmic choices you’d like to point out
    

I chose to make a class to hold an IP address, and a class to hold a NAT entry. Then, I could hash the NAT_entries by their "from" IP, and so I had a very quick and easy lookup to see if an IP from our FLOW had hashed into an IP in out NAT. Because of the possibility of hash conflicts, I also gave each IP a key. Since an IP is less than 64 bits, I just used the ip:port values as the key. (Also, I had never used g++ before, but I of course couldn't compile my program with gcc, so that was new)

  1. any refinements or optimizations that you would’ve implemented if you had more time
    

I differentiated between IPs with/without splats poorly, I would have used some of the spare bits in the "unsigned long key" as flags for IP splats and Port splats. Then, when I compared to see if the keys were equal while I was checking to see if the IPs that hashed the same were actually the same, I coulda used a function "compareKeys()" that took into account the flags, and acted accordingly. (If a flag for ipSplat was set, then only compare the bits of the key pertaining to the port)

  1. how you modified or made the challenge more well defined if you did
    

I assumed that all input would be valind/well-formed, and that there'd be exactly one entry per line for each file. That was stated in the prompt, but I feel the need to restate it. Another assumption I made, was that no splats would be in the FLOW file.

  1. anything else you’d like the reviewer to know
    

All of the coding challenges that I've done before have been on https://www.hackerrank.com/, it's a pretty sweet site, and I think they make distributing questions like this really easy. Unless, of course, you were also testing me on my ability to use Git, then using HackerRank to distribute the question kinda takes away from that.

illumio-test-repo's People

Contributors

arisweedler avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.