I have read through all the other posts and I am confused as some people say they got LC questions while others said that Square doesn't do LC... So if you have previously interviewed with Square, how would you prepare for the interview as Backend engineer?
Tech Industry
Yesterday
3474
1 vs 5 Million - no lifestyle change
India
7h
638
What do vegetarian Indians eat for protein?
Tech Industry
Yesterday
2412
Netflix vs Snowflake
Ask Blinders
Yesterday
974
Why is our country owned by Israel? I don't want my tax dollars fund genocide. How can we stop this nonsense?
Personal Finance
7h
1495
Should I marry a lazy girl?
Square doesn't do LC precisely, but rather multi-phase themed questions that can be solved with the same algos most LC questions can. All the interviewers come up with thier own question, usually implementing a popular game or a toy version of some well-known software utility. It's not LC in that it's "reverse this doubly linked list, except do it in constant space and logN time" bs, but yeah if you don't know how to generate permutations or traverse a tree or BFS/DFS or understand dynamic programming you're gonna have a bad time. being able to describe what you plan to do to solve it before you start coding, and then writing code with multiple reusable functions rather than a big long script (remember the problems are phased and build on themselves) is good. Also as a senior candidate you should pretend you are helping the interviewer solve this problem. Treat it as a chance to show off your mentoring chops, teach them something. I used c# as my language and none of my interviewers knew c# (square is java heavy) so I explained the difference between multi dimentional [,] and jagged arrays [][] in c#, and how for loops don't actually need anything except the semi colons to run: `for(;;){}` though you'd never want that. They seemed to enjoy the tidbits.
Thanks for your answer. In such an interview what is the interviewer looking for? Should I focus on giving the most efficient solution from a complexity perspective. Or should I focus on giving a solution that works and focus on design patterns, class design and clean code?
Definitely a solution that works with focus on design and cleanliness. Because everytime you solve the question, there's another part ( a new "feature request") for you to solve until you run out of time. If you see an optimal solution for a part, then by all means implement it, but focus on writing readable code that will be easy to change in the future, because you are going to have to update it to fit new requirements everytime you finish your current requirement. Just like real work, though real work isn't as time constrained. Most questions have 4-6 parts. They are designed so that they can't be finished in time. Thats ok. Aim to get to part 3 at least. The questions just exist to help us get signal on your ability to design and write software, and work with other people.