The shortlisting was done through our university based on our resume and academic performance. I was shortlisted and had two interviews of 45 minutes, each with a break of fifteen minutes in between. Both of them were technical rounds involving hands-on coding in a shared google doc while I was on a video call through Hangouts with the interviewer from Google.
Round 1:
Question: A boolean expression is given in the form of a string. It contains one variable x; logical operators – ‘and’, ‘or’ and relational operators – ‘>’, ‘<‘ (there is no >= or <=). Find if the expression always evaluates to False. If yes, output False, otherwise if there exists at least one x such that the given expression can be true, output true.
Example:
1. “x<0 and x>5”
Output – False
Explanation – This can never be true as there is no ‘x’ such as x<0 and x>5. So, the given boolean expression always evaluates to false.
2. “x>0 or x<-1”
Output – True
Explanation – We have at least one ‘x’ for which given boolean expression evaluates to true. For example, put x=2 in the given expression, and it evaluates to true.
Hint: Whenever there is only ‘or’ in the boolean expression, the result is always true. (Eg: x>0 or x<0 – There exists some x such that this is true and whatever be the latter part of the expression, it evaluates to true as only ‘or’ is present. If there is no ‘or’ present (only ‘and’ is there), then we check for the expressions – if you find at least two contradicting expressions as in example 1 (that is their solution sets are disjoint), then the output is False (as we have only ‘and’ logical operation which evaluates to False unless all the expressions are True), otherwise it is True.
I have no idea how to approach the problem when both ‘and, ‘ ‘or’ are present in the expression, and I could not find such a problem anywhere on the internet.
I request someone who read this article to contribute the code to this problem kindly. (preferably in C++)
Round 2:
Question: Given a string, find the minimum number of cuts to split the string so that all the resulting substrings are palindromes.
Example: “google”
Output: 2
Explanation: Minimum number of cuts to partition “google” into palindromes = 2 that is –
goog|l|e – where ‘|’ refers to a cut, the three resulting palindromes are “goog”, “l”, “e”. Therefore, the minimum number of cuts required = 2.
Hint: Refer to this article.
Recommended Posts:
- Google STEP Intern Coding Challenge Experience
- Google Interview Experience | Set 7 (For Software Engineering Intern)
- Google Interview Experience for Software Engineering Intern
- Google Summer Trainee Engineering Program(STEP) Interview Experience
- Google's Online Challenge for 2021 Intern (India) Experience
- GOCG13: Google's Online Challenge Experience for Business Intern | Singapore
- Google Software Engineering Intern, Fall 2019 - North America
- Amazon interview Experience | Set 132 (For SDE Intern)
- Microsoft Interview Experience | Set 51 (For SDE Intern)
- Microsoft Interview experience | Set 73 (On-Campus for IT SDE Intern)
- Qualcomm Interview Experience | Set 4 (Intern + Full Time Employee)
- Amazon Interview Experience | Set 318 (For SDE Intern)
- MakeMyTrip Interview Experience | Set 15 (For DevOps Intern)
- Mphrx Intern Interview Experience | Set 4 (On-Campus)
- Microsoft Interview Experience - On campus SDE Intern
- Amazon QA role & Support Engineer Intern interview experience
- Arcesium Interview Experience 2018 (Intern)
- Amazon Interview Experience | ( 6 Months Intern for SDE-1 )
- Arcesium Interview Experience 2018 ( Intern, On Campus )
- Dailyhunt Intern Interview Experience
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.


