Google Online Challenge for Summer Internship 2021

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.

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

Input: 

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:  

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

Sample output:

1
1
2

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.


Write your Interview Experience or mail it to contribute@geeksforgeeks.org

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.