## Flipkart Interview Question for Software Engineer / Developers

• 0

Country: India
Interview Type: In-Person

Comment hidden because of low score. Click to expand.
1
of 1 vote

``````from math import sin, cos, sqrt, atan2, radians

R = 6373.0

def DIST(lat1, lon1, lat2, lon2):

dlon = lon2 - lon1
dlat = lat2 - lat1
a = (sin(dlat/2))**2 + cos(lat1) * cos(lat2) * (sin(dlon/2))**2
c = 2 * atan2(sqrt(a), sqrt(1-a))
return  R * c

def LOC(my_pos, places, R):
RES=[]
for P in places:
if(DIST(my_pos[0], my_pos[1], P[0], P[1])<=R):
RES.append(P)

return RES

My_Pos = [lat0, lon0]
Places = [[lat1, lon1],[lat2, lon2],[lat3, lon3],[lat4, lon4]]

Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

### Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

### Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.