LeetCode Question · Mar 2022 · Los Angeles

Shopee | Backend Intern | VietNam | Mar 2022 []

Backend OA Intern Easy
5 upvotes 443 views

Question Details

I\'ve just taken the OA of shopee There are 2 coding test in 60mins I think they belongs to Easy difficulty according to leetcode problem difficulty They are using Glider First one is...

Full Details

I\'ve just taken the OA of shopee
There are 2 coding test in 60mins
I think they belongs to Easy difficulty according to leetcode problem difficulty
They are using Glider

\t>But it is a little weird, that ")()" is valid, so all the close bracket is ok to be leftover.
\t>So check stack is null after loop make it false, I failed 1/9 testcase which I\'ve still cannot figure out what wrong. I did pass valid-parentheses with 0ms but cannot pass this one
\t>I did check stack find if there\'s any open bracket being leftover.
\t
* Second one is funny sort, which can explain like:
\tThe biggest floor in ascending order in 0th, 2th, 4th,..
\tThe smallest ceil in descending order in 1th, 3th, 5th..
\t
\tInput: a list of number
\tOutput: a list applying funny sort

\tExample: 3 8 4 5 6 1 7
\tOutput: 1 8 3 7 4 6 5
\t
\t> as you can see: 1 3 4 5 is in ascend order, 8 7 6 is in descend order
\t> I solved this problem with O(n)

Time Complexity and O(n) Space Complexity, in about 5 mins, I mean it\'s quite easy though. Then go back to messing with the first problem. I think they\'re finding someone solve this with O(1)

Space Complexity

Note: This was the first time I took a OA. I need to write a program to solve the problem (not just a class or a function like Leetcode)

About This Question

This is a reported interview question from a shopee interview for a backend role (intern level) during the oa round reported in 2022.

It covers the following topics: Stack, Strings .

Difficulty rating: Easy