Summer analyst Interview Questions | Glassdoor.co.in

Summer analyst Interview Questions

751

summer analyst interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

There are two arrays city[] and population[], each with n elements. Each city[i] corresponds to population[i], that is, each ith element in city[] has population of ith element in population[]. Now, I've to sort the city[] array according to the population in them.

3 Answers

Let p[] and c[] be population and city arrays respectively. I then used simple bubble sort (I asked if he interviewer wanted to me used any specific sorting algorithm) to sort the arrays. for (i = 0; i < n; i++) { for (j = i+1; j < n; j++) { if (p[i] < p[j]) { swap(p[i], p[j]); swap(c[i], c[j]); } } }

>>> cities = ['a', 'b', 'c', 'd', 'e'] >>> population = [2, 5, 7, 1, 9] >>> zip(cities, population) [('a', 2), ('b', 5), ('c', 7), ('d', 1), ('e', 9)] >>> zip(population, cities) [(2, 'a'), (5, 'b'), (7, 'c'), (1, 'd'), (9, 'e')] >>> my_map = zip(population, cities) >>> my_map.sort() >>> for population, city in my_map: ... print city ... d a b c e

Python code L1 = [15000,8000,3000,10000,45000] L2 = ["Tokio","Paris","Dehli","London","Newyork"] for i in range(len(L1)): for j in range(i+1,len(L1)): if L1[i]>L1[j]: L1[i],L1[j] = L1[j],L1[i] L2[i],L2[j] = L2[j],L2[i] print("The soerted arrays are:") print(L1) print(L2)

You're given an array of n numbers. Each number is between 0 and 100. For each number, you've to print "India" if the number is divisible by 3, "Pakistan" if the number is divisible by 5 and "Japan" if the number is divisible by both 3 and 5.

3 Answers

what is your fav subject?

2 Answers

(Puzzle - not asked to me but to others) Burning rope. A non -uniform rope burn fully in 1 hour. You have two ropes and have to measure 45 minutes. You also have a lighter

2 Answers

Which of the Ogilvy's Department would you like to work in? PR? Digital? BTL?

1 Answer

4ps of marketing? or some current news related to FMCG sector

2 Answers

What expectations you have from us ?

1 Answer

Which tag do you use to refresh a web-page automatically after a fixed period of time.

1 Answer

online round- 1. find largest decreasing subsequence. 2. check wether a given string can be rearranged to form a palindrome. 3. Two players play a game optimally. given a number they can either divide it by its factor( other than the number itself and 1) or reduce it by 1. One who cannot make a further move looses. Who wins the game for a given number, if a particular person always makes the first move.

1 Answer

They asked me about command line arguments and the type and number of variables I can pass in my main function in c++.

1 Answer
110 of 751 Interview Questions