Google Online Assessment Question
Anonymous User
1667

In July 2021, i have given Google Online Assessment for Full Time Software Engineer Role.
Position: SWE Full Time
Place: India

Time: 60 minutes
Max. Score: 60 points (30 points / problem)

There were Two questions

First Question
Exact similar to this one https://leetcode.com/problems/asteroid-collision/

Second question was based on to find count of subsets with given sum.
There are Q number of queries and each query contains two integers, first integer represent the type and second integer represent value

type 0: insert value x
type 1: remove value x
type 2: find count of subsets of sum x

input type:
7
0 1
0 2
2 3
0 2
2 3
1 2
2 1

ouput:
1 2 1

Explanation :-
1st Query -> [1]
2nd Query -> [1, 2]
3rd Query -> {1,2} => no of subsets with sum = 3
4th Query ->[1,2,2]
5th Query -> {1,2}, {1,2} => no of subsets with sum = 3
6th Query -> [1,2]
7th Query -> {1} -> no of subsets with sum = 1

Comments (4)