Summer Interview Questions | Glassdoor.co.in

Find jobs for Summer

Summer Interview Questions

646

Summer interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

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

Let the array be a[] with n elements inside. The approach would be simple. for (i = 0; i < n; i++) { if (a[i] % 15 == 0) { printf("Japan\n"); } else if (a[i] % 5 == 0) { printf("Pakistan\n"); } else if (a[i] % 3 == 0) { printf("India\n"); } }

for i in range(101): if i%3 == 0 and i%5 == 0: print(i,"Japan") elif i%3 == 0: print(i,"India") elif i%5 == 0: print(i,"Pakistan")

for i in 1..<101 { if (i % 3 == 0) { print("-- India --, \(i)") print("-- Japan --, \(i)") }else if (i % 5 == 0) { print("-- Japan --, \(i)") print("-- Pakistan --, \(i)") } }

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

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

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

what is your fav subject?

2 Answers

Force garbage collection in java

1 Answer

Tell us about your previous work experience

1 Answer

Q: asked about google cloud platform and geolocation Api

1 Answer

How many games to find out the winner in a knock-out tournament of n teams.

1 Answer

"Why do you want to join us?" Well, the company profiles are confusing so do read up

1 Answer
110 of 646 Interview Questions