Phone interview question at Meta. Fair?

Apparently, here is the question that was asked. https://leetcode.com/problems/bulb-switcher/description/ After grinding leetcode for months, you get this question in your interview. I honestly want to know what you guys feel. There is no way I will have been able to solve that.. #meta Edit: Don't think XOR or anything like that.. The answer is the square root of the number... seriously, you will have solved that in 20 mins? in an interview setting? Unless you have seen this before, that seems like an impossible task.. FYI the answer is return Math.sqrt(n)

Poll
42 Participants
Select only one answer
Amazon e3fOxz Mar 21

is this supposed to be hard? why?

Amazon e3fOxz Mar 21

it feela like lc monkeys practiced too much lc and can not code simple logic. unless i am smoking something this is straight forward simple

ServiceNow XljY40 OP Mar 21

The answer is square root of the number... are you serious that you will have solved it in 15 mins? or are you being sarcastic?... Is that an algorithmic question... what does this test in DSA?

This comment was deleted by the original commenter.
ServiceNow XljY40 OP Mar 21

Are you saying you will have solved this in 20 mins? The answer is the square root of the number.. What in DSA does this test?

Amazon @MZN4 Mar 21

What are you complaining about?

ServiceNow XljY40 OP Mar 21

Read the poll properly and answer.. IMO thats an unfair question... Who said I was complaining... I said I will not have been able to solve that... If you think you can solve it, then you probably don't understand what the answer is... Try getting that accepted on leetcode to understand what this is about...

ServiceNow poorilover Mar 21

Do not go to Meta. Why you want to leave our beautiful company rocket ship. Where stock will 10x soon

Meta closetcon2 Mar 22

You know that meta already 5x'd in 1 year right?

ByteDance maga_ops Mar 21

Ridiculous to ask that for an swe interview. To solve one needs to realize it's about the number of divisors of a given integer. Then write the formula, realize that's it's only even for full squares. Then count the squares. Non of it has anything to do with software, not even close. Decent math brainteaser for a quant researcher, but not for swe. The interviewer was either trying to prove something to themselves or didn't want to pass for some reason

ServiceNow XljY40 OP Mar 21

This! and to everyone who posted that they will have solved it... sure SMH... This right here is the answer...

Amazon ve56ga Mar 21

Did you need to solve it with square root idea or you could have coded it in a for loop?

ServiceNow XljY40 OP Mar 21

Were you able to get your code accepted on leetcode with the for loop you had in mind?

ex-Snap XgLm85 Mar 21

This is the worst question to ask on the interview! Honestly, you just had a bad luck.

TripActions CXmx24 Mar 21

Why do you think they expected that math solution? Did you code at least brute force solution?

ServiceNow XljY40 OP Mar 22

Were you able to get your solution accepted for all the test cases on leetcode?

Snap humble pi Mar 22

Brute force solutions don't pass the test cases for time or memory, but if you don't know the real solution you at least do the bf

Amazon IAm☀️dar Mar 22

Pretty fair question in fact

ex-Snap XgLm85 Mar 22

Worst question ever. Do not tell anything about SDE skills

Amazon IAm☀️dar Mar 22

But tells a lot about analytical skills, communication and collaborative attitude of the candidate.

Flagged by the community.