Online Assessment: 2 Questions - 120 Minutes
Question 1 - Coloring nx3 board with 3 colors
An automated painting system needs a program that can paint an n x 3 grid in red, green and blue such that no row or column contains cells that are all the same color. Determine the number of valid patterns that can be painted given n rows. Since the number of patterns can be large, return the value modulo (10^9 + 7)
Sample Input: n = 4
Sample Output: 296490
Link (Same question): https://math.stackexchange.com/questions/3215805/coloring-a-3-times-n-board-using-3-colors
Question 2 - Undirected Graph Question
Technical Round 1
1. Split array into subarray with given conditions.
- All the characters in each of the splitted subarray must not be in another subarray
- Sample Input - "aabacadfgrdtyu"
- Sample Output - {"aabaca", "dfgrd", "tyu"}
2. Are the given 2 intervals intersecting? (fully optimized)
- Sample Input - [2, 5], [4, 7]
- Sample Output - True
- Sample Input - [2, 3], [4, 7]
- Sample Output - False
Technical Round 2:
1. Find the word that comes more than 1 time in a string (Case Insensitive)
(Output the first occurrence of the word)
Sample Input - "Paypal is a good company but PayPal hires more than once"
Sample Output - ["Paypal"]
2. Any sorting algo (bubble sort) with time complexity, then optimize or use some faster algo with time complexity
- Started with bubble sort - O(n^2) time
- Finalised with merge sort - O(nlogn) time
- Some other basic Computer Science questions on OS, DBMS, SQL etc
- Some questions based on my resume and my projects.
- Some more HR type questions
Final Round:
- K frogs are there with a number assigned. There is 1 long queue with numbers from 1 to n. Frog with number 2 can visit 2, 4,6,8... And so with other frogs. What are the numbers in the queue that won't be visited after all the frogs have done their visit?
- A grid is present with many balloons. You have 1 arrow. What is the max no of balloons that u can shoot with that arrow? The angle of the shoot can be anything from 0 to 360 degrees.
- Similar Question: https://www.geeksforgeeks.org/dsa/count-maximum-points-on-same-line/
My all rounds were good and solved most of the questions in one attempt. 3rd round was worst and was not able to solve any questions : (
My suggestions:
- Don't fake anything either in your resume or with your projects.
- Be honest in your resume and don't mention things you don't know
- Projects are an important part of the resume. Don't mention projects done by your friends/ taken from GitHub
- Have a good understanding of OS, DBMS, Network, etc (core CS subjects)
- Be positive and have confidence in yourself
All the best for your interviews.