Solving Amazon's 2020 Most Asked Interview Question
🎧 Join the community Discord: https://discord.gg/aVWsAaaCtT
💰 Support me on Patreon: https://www.patreon.com/michaelmuinos
🔗Follow me on LinkedIn: https://www.linkedin.com/in/michael-muinos
📂Follow me on Github: https://github.com/MichaelMuinos
Amazon's most asked coding question for 2020 according to the LeetCode platform was "Reorder Data in Log Files". This problem is a string based problem which in just the past 6 months has been asked at Amazon over 330 times.
For this problem, we must sort log strings based on a variety of rules. There are two types of log strings: letter logs and digit logs. Letter logs contain a unique id separated with a space to the rest of the log portion. The log portion contains only lowercase letters; however, a digit log contains only digits. The rules we must implement our comparator class by are as follows:
letter logs always come before digit logs, letter logs are sorted lexicographically, if letter logs are equal we must sort by the id lexicographically, and digit logs should maintain their order.
The time complexity for our algorithm is big oh O(N*log(N)) where N is the number of elements we have in our array. Under the hood, the array sort uses a dual pivot quick sort algorithm which is due to the use of sorting primitives. If we were not sorting primitives, the sort function would use TimSort. The space complexity is big oh O(log(N)) since quick sort must utilize recursive calls to apply sorting.
----------------------------------------------------
LAKEY INSPIRED - Blue Boi
https://soundcloud.com/lakeyinspired
https://www.youtube.com/channel/UCOmy8wuTpC95lefU5d1dt2Q
Видео Solving Amazon's 2020 Most Asked Interview Question канала Michael Muinos
💰 Support me on Patreon: https://www.patreon.com/michaelmuinos
🔗Follow me on LinkedIn: https://www.linkedin.com/in/michael-muinos
📂Follow me on Github: https://github.com/MichaelMuinos
Amazon's most asked coding question for 2020 according to the LeetCode platform was "Reorder Data in Log Files". This problem is a string based problem which in just the past 6 months has been asked at Amazon over 330 times.
For this problem, we must sort log strings based on a variety of rules. There are two types of log strings: letter logs and digit logs. Letter logs contain a unique id separated with a space to the rest of the log portion. The log portion contains only lowercase letters; however, a digit log contains only digits. The rules we must implement our comparator class by are as follows:
letter logs always come before digit logs, letter logs are sorted lexicographically, if letter logs are equal we must sort by the id lexicographically, and digit logs should maintain their order.
The time complexity for our algorithm is big oh O(N*log(N)) where N is the number of elements we have in our array. Under the hood, the array sort uses a dual pivot quick sort algorithm which is due to the use of sorting primitives. If we were not sorting primitives, the sort function would use TimSort. The space complexity is big oh O(log(N)) since quick sort must utilize recursive calls to apply sorting.
----------------------------------------------------
LAKEY INSPIRED - Blue Boi
https://soundcloud.com/lakeyinspired
https://www.youtube.com/channel/UCOmy8wuTpC95lefU5d1dt2Q
Видео Solving Amazon's 2020 Most Asked Interview Question канала Michael Muinos
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![Amazon Coding Question - Insert Delete GetRandom O(1)](https://i.ytimg.com/vi/TD2g8UjXMLA/default.jpg)
![Top K Frequent Words - Priority Queue Approach (LeetCode)](https://i.ytimg.com/vi/cupg2TGIkyM/default.jpg)
![Amazon Coding Interview Question - First Missing Positive (LeetCode)](https://i.ytimg.com/vi/9SnkdYXNIzM/default.jpg)
![Common Sense Test That 90% of People Fail](https://i.ytimg.com/vi/mJVWX0vud-g/default.jpg)
![](https://i.ytimg.com/vi/NiMooCDxW78/default.jpg)
![](https://i.ytimg.com/vi/eAR5xsdf_m4/default.jpg)
![AMAZON CODING INTERVIEW QUESTION - REORGANIZE STRING](https://i.ytimg.com/vi/zaM_GLLvysw/default.jpg)
![AMAZON CODING INTERVIEW QUESTION - PARTITION LABELS (LeetCode)](https://i.ytimg.com/vi/ED4ateJu86I/default.jpg)
![Amazon Coding Interview Question - Integer to Roman (LeetCode)](https://i.ytimg.com/vi/yzB4M-UXqgI/default.jpg)
![Time Based Key Value Store | Netflix Coding Question | Binary Search](https://i.ytimg.com/vi/kZAZqn_J8Fo/default.jpg)
![LeetCode 1152. Analyze User Website Visit Pattern - Interview Prep Ep 109](https://i.ytimg.com/vi/V510Lbtrm5s/default.jpg)
![Sliding Window Algorithm - Longest Substring Without Repeating Characters (LeetCode)](https://i.ytimg.com/vi/4i6-9IzQHwo/default.jpg)
![Interview With A Self Taught Software Engineer Making Over 6 Figures](https://i.ytimg.com/vi/Ofw9ghQX66o/default.jpg)
![LeetCode 146. LRU Cache (Algorithm Explained)](https://i.ytimg.com/vi/NDpwj0VWz1U/default.jpg)
![Trapping Rain Water - Google Interview Question - Leetcode 42](https://i.ytimg.com/vi/ZI2z5pq0TqA/default.jpg)
![Longest Increasing Path in a Matrix (DFS + Memoization)](https://i.ytimg.com/vi/uLjO2LUlLN4/default.jpg)
![Merge K Sorted Lists - Divide and Conquer Approach](https://i.ytimg.com/vi/BBt9FB5Yt0M/default.jpg)
![FACEBOOK CODING INTERVIEW QUESTION - LOWEST COMMON ANCESTOR](https://i.ytimg.com/vi/xuvw11Ucqs8/default.jpg)
![LRU Cache - Twitch Interview Question - Leetcode 146](https://i.ytimg.com/vi/7ABFKPK2hD4/default.jpg)
![SOLVING AMAZON'S MOST ASKED INTERVIEW QUESTION (DEC 2020)| Leetcode 937 | Reorder Data in Log Files](https://i.ytimg.com/vi/Iy7SfUdDPo0/default.jpg)