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
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
1 6 4 6 3 18 36 54 3 1 2 3 6 4 6
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.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon and Microsoft Test Serieses.