Skip to content

Instantly share code, notes, and snippets.

View anirbanroydas's full-sized avatar

Anirban Roy Das anirbanroydas

View GitHub Profile
@anirbanroydas
anirbanroydas / Sample output of running test_triplet_sum.py
Last active December 6, 2016 19:50
triplet_sum : find triplet (3 integers) in an array of size n whose sum is S. It also logs data both to file and I/O stream. Its also configurable. Its also scalable. Its also fault tolerant.
================================================================================ test session starts ================================================================================
platform darwin -- Python 2.7.11, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /usr/local/opt/python/bin/python2.7
cachedir: .cache
rootdir: /Users/Roy/Documents/Github/sources/private/adwyze-interview/round1/triplet_sum, inifile:
collected 19 items
test_triplet_sum.py::test_triplet_sum_base_case_with_3_positive_elems_and_positive_sum PASSED
test_triplet_sum.py::test_triplet_sum_base_case_with_3_positive_elems_and_negative_sum PASSED
test_triplet_sum.py::test_triplet_sum_base_case_with_3_negative_elems_and_positive_sum PASSED
test_triplet_sum.py::test_triplet_sum_base_case_with_3_negative_elems_and_negative_sum PASSED
@anirbanroydas
anirbanroydas / friends.json
Last active December 6, 2016 19:49
invite_friends: send invitation to friends in friend list who are within D distance from given source S. D is in Km, S is in (latitude, longitude) pair which are expressed as decimal degrees. It also logs data both to file and I/O stream. Its also configurable. Its also scalable. Its also fault tolerant.
{"latitude": "12.986375", "user_id": 12, "name": "Chris", "longitude": "77.043701"}
{"latitude": "11.92893", "user_id": 1, "name": "Alice", "longitude": "78.27699"}
{"latitude": "11.8856167", "user_id": 2, "name": "Ian", "longitude": "78.4240911"}
{"latitude": "12.3191841", "user_id": 3, "name": "Jack", "longitude": "78.5072391"}
{"latitude": "13.807778", "user_id": 28, "name": "Charlie", "longitude": "76.714444"}
{"latitude": "13.4692815", "user_id": 7, "name": "Frank", "longitude": "-9.436036"}
{"latitude": "14.0894797", "user_id": 8, "name": "Eoin", "longitude": "77.18671"}
{"latitude": "13.038056", "user_id": 26, "name": "Stephen", "longitude": "76.613889"}
{"latitude": "14.1225", "user_id": 27, "name": "Enid", "longitude": "78.143333"}
{"latitude": "13.1229599", "user_id": 6, "name": "Theresa", "longitude": "77.2701202"}