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)Top K Frequent Words - Priority Queue Approach (LeetCode)Amazon Coding Interview Question - First Missing Positive (LeetCode)Common Sense Test That 90% of People FailAMAZON CODING INTERVIEW QUESTION - REORGANIZE STRINGAMAZON CODING INTERVIEW QUESTION - PARTITION LABELS (LeetCode)Amazon Coding Interview Question - Integer to Roman (LeetCode)Time Based Key Value Store | Netflix Coding Question | Binary SearchLeetCode 1152. Analyze User Website Visit Pattern - Interview Prep Ep 109Sliding Window Algorithm - Longest Substring Without Repeating Characters (LeetCode)Interview With A Self Taught Software Engineer Making Over 6 FiguresLeetCode 146. LRU Cache (Algorithm Explained)Trapping Rain Water - Google Interview Question - Leetcode 42Longest Increasing Path in a Matrix (DFS + Memoization)Merge K Sorted Lists - Divide and Conquer ApproachFACEBOOK CODING INTERVIEW QUESTION - LOWEST COMMON ANCESTORLRU Cache - Twitch Interview Question - Leetcode 146SOLVING AMAZON'S MOST ASKED INTERVIEW QUESTION (DEC 2020)| Leetcode 937 | Reorder Data in Log Files