Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Google Online Challenge for Summer Internship 2021

  • Difficulty Level : Medium
  • Last Updated : 01 Oct, 2020

The Google online challenge 2020 for summer internships 2021 was held on Sept 26. It was a 60-minute online test having 2 questions to code.

First Question: You are given an array A with N integers. you are required to answer Q queries of the following types.

Hey geek! It's time to become a success story instead of reading them. Check out our most renowned DSA Self Paced Course, now at a student-friendly price and become industry ready. And if you are looking for a more complete interview preparation resource, check out Complete Interview Preparation Course that will prepare you for the SDE role of your dreams!

Feeling prepared enough for your interview? Test your skills with our Test Series that will help you prepare for top companies like Amazon, Microsoft, TCS, Wipro, Google and many more!

Determine the count of distinct prime numbers which divides all the numbers in a given range L to R. NOTE:1 based Indexing.

1 <=N,Q<= 10^5;

1 <= A[i] <= 10^5;

1 <= L <= R <= N


No of test cases
Array size i.e N
N array elements
No of Queries i.e Q
Q queries

Output: Return count of distinct prime numbers which divides all the numbers in a given range for each query

Sample Input:  

4 6 3 18 36 54
1 2
3 6
4 6

Sample output:


I do not remember the second question exactly. But It was also based on arrays. Prepare for query-based array questions, MO’s algorithm, Segment tree(if possible) standard questions like range sum queries, update range queries, etc.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!