conversations
listlengths
2
2
metadata
dict
id
stringlengths
36
36
[ { "from": "human", "value": "**Top K Frequent Elements** (Medium)\n\nGiven an integer array `nums` and an integer `k`, return the `k` most frequent elements. You may return the answer in any order.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and an...
{ "category": "heap_priority_queue", "difficulty": "medium", "language": "python", "title": "Top K Frequent Elements" }
1f94ec23-231b-43d8-842b-fd4958958c60
[ { "from": "human", "value": "**Longest Substring Without Repeating Characters** (Medium)\n\nGiven a string `s`, find the length of the longest substring without repeating characters.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edg...
{ "category": "sliding_window", "difficulty": "medium", "language": "python", "title": "Longest Substring Without Repeating Characters" }
8e428918-858a-43a9-876d-26109f978a14
[ { "from": "human", "value": "**Binary Tree Level Order Traversal** (Medium)\n\nGiven the root of a binary tree, return the level order traversal of its nodes' values (i.e., from left to right, level by level).\n\nPlease provide a solution in python with a clear explanation of the approach, time/space comple...
{ "category": "trees", "difficulty": "medium", "language": "python", "title": "Binary Tree Level Order Traversal" }
f42c3c7d-3ce1-4a17-a562-83bdf2bcd3f9
[ { "from": "human", "value": "**Longest Substring Without Repeating Characters** (Medium)\n\nGiven a string `s`, find the length of the longest substring without repeating characters.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edg...
{ "category": "sliding_window", "difficulty": "medium", "language": "python", "title": "Longest Substring Without Repeating Characters" }
69f99f18-e1d2-404a-9d1d-6c3c8bb7c910
[ { "from": "human", "value": "Design a scalable notification system that supports push notifications, email, and SMS. The system should handle millions of users and support different notification types with user preferences." }, { "from": "gpt", "value": "## System Design: Notification System\n\n...
{ "category": "system_design", "difficulty": "hard", "language": "conceptual", "title": "Design a Notification System" }
2667e6aa-9566-48e2-8167-8b6715e991b2
[ { "from": "human", "value": "**Search in Rotated Sorted Array** (Medium)\n\nAn integer array `nums` is sorted in ascending order and then rotated at some pivot. Given the array after rotation and an integer `target`, return the index of `target` if it is in `nums`, or -1 if it is not.\n\nPlease provide a so...
{ "category": "binary_search", "difficulty": "medium", "language": "python", "title": "Search in Rotated Sorted Array" }
88e243f0-c4e3-4371-84c2-90e0524df365
[ { "from": "human", "value": "**Top K Frequent Elements** (Medium)\n\nGiven an integer array `nums` and an integer `k`, return the `k` most frequent elements. You may return the answer in any order.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and an...
{ "category": "heap_priority_queue", "difficulty": "medium", "language": "python", "title": "Top K Frequent Elements" }
e3fbbcd4-c7ba-4000-97c5-f7b171ded492
[ { "from": "human", "value": "Design a URL shortening service like bit.ly. The system should support: creating short URLs from long URLs, redirecting short URLs to original URLs, and optionally tracking click analytics." }, { "from": "gpt", "value": "## System Design: URL Shortener\n\n### Require...
{ "category": "system_design", "difficulty": "hard", "language": "conceptual", "title": "Design a URL Shortener" }
df880d78-58ef-4ca3-bede-a6e0ecdae4b2
[ { "from": "human", "value": "**Longest Substring Without Repeating Characters** (Medium)\n\nGiven a string `s`, find the length of the longest substring without repeating characters.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edg...
{ "category": "sliding_window", "difficulty": "medium", "language": "python", "title": "Longest Substring Without Repeating Characters" }
7112da9b-be8a-436e-906b-23615180d340
[ { "from": "human", "value": "**Group Anagrams** (Medium)\n\nGiven an array of strings `strs`, group the anagrams together. You can return the answer in any order.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edge cases." }, { ...
{ "category": "arrays_hashing", "difficulty": "medium", "language": "python", "title": "Group Anagrams" }
6713de6d-20a6-45d1-b9c4-34c3bc16c0be
[ { "from": "human", "value": "**Binary Tree Level Order Traversal** (Medium)\n\nGiven the root of a binary tree, return the level order traversal of its nodes' values (i.e., from left to right, level by level).\n\nPlease provide a solution in python with a clear explanation of the approach, time/space comple...
{ "category": "trees", "difficulty": "medium", "language": "python", "title": "Binary Tree Level Order Traversal" }
a589261d-349f-4a3b-bbef-e064233be93e
[ { "from": "human", "value": "**Container With Most Water** (Medium)\n\nGiven an integer array `height` of length n, where each element represents the height of a vertical line at position i. Find two lines that together with the x-axis form a container that holds the most water. Return the maximum amount of...
{ "category": "two_pointers", "difficulty": "medium", "language": "python", "title": "Container With Most Water" }
cf14115b-12b5-4cad-b4c3-8f0f4871125c
[ { "from": "human", "value": "**Coin Change** (Medium)\n\nYou are given an integer array `coins` representing coins of different denominations and an integer `amount` representing a total amount of money. Return the fewest number of coins needed to make up that amount. If that amount of money cannot be made ...
{ "category": "dynamic_programming", "difficulty": "medium", "language": "python", "title": "Coin Change" }
0aac6e2a-d7b0-4a4c-bdee-9d6be3fbc5ce
[ { "from": "human", "value": "Design a rate limiter that can be used as middleware for a web API. Support multiple rate limiting strategies and work across distributed servers." }, { "from": "gpt", "value": "## System Design: Distributed Rate Limiter\n\n### Requirements\n- Limit requests per user...
{ "category": "system_design", "difficulty": "hard", "language": "conceptual", "title": "Design a Rate Limiter" }
de24a805-c854-4dac-9e41-ef703858f792
[ { "from": "human", "value": "**Group Anagrams** (Medium)\n\nGiven an array of strings `strs`, group the anagrams together. You can return the answer in any order.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edge cases." }, { ...
{ "category": "arrays_hashing", "difficulty": "medium", "language": "python", "title": "Group Anagrams" }
96f5176b-9668-4cfb-9abe-3d501086c7b9
[ { "from": "human", "value": "**Coin Change** (Medium)\n\nYou are given an integer array `coins` representing coins of different denominations and an integer `amount` representing a total amount of money. Return the fewest number of coins needed to make up that amount. If that amount of money cannot be made ...
{ "category": "dynamic_programming", "difficulty": "medium", "language": "python", "title": "Coin Change" }
bd4c4a0e-c4c0-40bd-a463-b3e601e79d5a
[ { "from": "human", "value": "Design a URL shortening service like bit.ly. The system should support: creating short URLs from long URLs, redirecting short URLs to original URLs, and optionally tracking click analytics." }, { "from": "gpt", "value": "## System Design: URL Shortener\n\n### Require...
{ "category": "system_design", "difficulty": "hard", "language": "conceptual", "title": "Design a URL Shortener" }
f478d245-92dc-4c47-bdd7-1d67b2b13824
[ { "from": "human", "value": "**Container With Most Water** (Medium)\n\nGiven an integer array `height` of length n, where each element represents the height of a vertical line at position i. Find two lines that together with the x-axis form a container that holds the most water. Return the maximum amount of...
{ "category": "two_pointers", "difficulty": "medium", "language": "python", "title": "Container With Most Water" }
a6da77de-6d2a-4165-a7af-ef3f136561a6
[ { "from": "human", "value": "**Binary Tree Level Order Traversal** (Medium)\n\nGiven the root of a binary tree, return the level order traversal of its nodes' values (i.e., from left to right, level by level).\n\nPlease provide a solution in python with a clear explanation of the approach, time/space comple...
{ "category": "trees", "difficulty": "medium", "language": "python", "title": "Binary Tree Level Order Traversal" }
89b5ae3f-5f5b-4d4e-bb50-d259ba00d0a9
[ { "from": "human", "value": "**Search in Rotated Sorted Array** (Medium)\n\nAn integer array `nums` is sorted in ascending order and then rotated at some pivot. Given the array after rotation and an integer `target`, return the index of `target` if it is in `nums`, or -1 if it is not.\n\nPlease provide a so...
{ "category": "binary_search", "difficulty": "medium", "language": "python", "title": "Search in Rotated Sorted Array" }
dd2b7084-ae62-42fd-850f-25ee97083544
[ { "from": "human", "value": "**Longest Substring Without Repeating Characters** (Medium)\n\nGiven a string `s`, find the length of the longest substring without repeating characters.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edg...
{ "category": "sliding_window", "difficulty": "medium", "language": "python", "title": "Longest Substring Without Repeating Characters" }
d0092a37-a73b-41cc-9159-368181e87b58
[ { "from": "human", "value": "How would you answer the behavioral interview question: 'Tell me about a time you disagreed with your manager or a technical decision, and how you handled it.'" }, { "from": "gpt", "value": "**Strong Answer (STAR Format):**\n\n**Situation:**\nAt my previous role, our...
{ "category": "behavioral", "difficulty": "medium", "language": "behavioral", "title": "Tell Me About a Time You Disagreed With Your Manager" }
f978ea3a-16ad-4f96-88e5-7f067c9e5b1c
[ { "from": "human", "value": "**Course Schedule II (Topological Sort)** (Hard)\n\nThere are `numCourses` courses labeled from 0 to numCourses-1. Given `prerequisites[i] = [a, b]` meaning you must take course b before course a, return the ordering of courses you should take to finish all courses. If impossibl...
{ "category": "graphs", "difficulty": "hard", "language": "python", "title": "Course Schedule II (Topological Sort)" }
d49f7360-1bd4-4585-bf4b-d79156ac583c
[ { "from": "human", "value": "**Subsets** (Medium)\n\nGiven an integer array `nums` of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order.\n\nPlease provide a solution in python with a clear explanation of the ap...
{ "category": "backtracking", "difficulty": "medium", "language": "python", "title": "Subsets" }
3ebfcac6-5aae-41e5-80dc-606167eda017
[ { "from": "human", "value": "**Search in Rotated Sorted Array** (Medium)\n\nAn integer array `nums` is sorted in ascending order and then rotated at some pivot. Given the array after rotation and an integer `target`, return the index of `target` if it is in `nums`, or -1 if it is not.\n\nPlease provide a so...
{ "category": "binary_search", "difficulty": "medium", "language": "python", "title": "Search in Rotated Sorted Array" }
d52abbd2-17d9-40b7-b972-a170bb43941c
[ { "from": "human", "value": "**Longest Substring Without Repeating Characters** (Medium)\n\nGiven a string `s`, find the length of the longest substring without repeating characters.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edg...
{ "category": "sliding_window", "difficulty": "medium", "language": "python", "title": "Longest Substring Without Repeating Characters" }
1050d79b-1f56-4fb3-b573-475e923a312d
[ { "from": "human", "value": "**Two Sum** (Easy)\n\nGiven an array of integers `nums` and an integer `target`, return the indices of the two numbers that add up to `target`. You may assume that each input would have exactly one solution, and you may not use the same element twice.\n\nPlease provide a solutio...
{ "category": "arrays_hashing", "difficulty": "easy", "language": "python", "title": "Two Sum" }
546953d5-bd54-4078-9eee-1a1275d53ab7
[ { "from": "human", "value": "**Course Schedule II (Topological Sort)** (Hard)\n\nThere are `numCourses` courses labeled from 0 to numCourses-1. Given `prerequisites[i] = [a, b]` meaning you must take course b before course a, return the ordering of courses you should take to finish all courses. If impossibl...
{ "category": "graphs", "difficulty": "hard", "language": "python", "title": "Course Schedule II (Topological Sort)" }
6e842539-d66c-4b74-b31f-eab4fa17962d
[ { "from": "human", "value": "**Container With Most Water** (Medium)\n\nGiven an integer array `height` of length n, where each element represents the height of a vertical line at position i. Find two lines that together with the x-axis form a container that holds the most water. Return the maximum amount of...
{ "category": "two_pointers", "difficulty": "medium", "language": "python", "title": "Container With Most Water" }
a85b37d6-de8e-4285-91d0-2424aecec697
[ { "from": "human", "value": "**Daily Temperatures** (Medium)\n\nGiven an array of integers `temperatures` representing daily temperatures, return an array `answer` such that `answer[i]` is the number of days you have to wait after the `i`-th day to get a warmer temperature. If there is no future day with a ...
{ "category": "stack_queue", "difficulty": "medium", "language": "python", "title": "Daily Temperatures" }
9fba9586-6d57-4297-b744-0b488e436cbb
[ { "from": "human", "value": "**Number of Islands** (Medium)\n\nGiven an `m x n` 2D binary grid where '1' represents land and '0' represents water, return the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically.\n\nPlease provide a solutio...
{ "category": "graphs", "difficulty": "medium", "language": "python", "title": "Number of Islands" }
1cc2649b-ef73-4dc9-87b4-b524e2bc509e
[ { "from": "human", "value": "**Longest Increasing Subsequence** (Hard)\n\nGiven an integer array `nums`, return the length of the longest strictly increasing subsequence.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edge cases." ...
{ "category": "dynamic_programming", "difficulty": "hard", "language": "python", "title": "Longest Increasing Subsequence" }
c1c7d01f-6488-4940-89ce-7c95f8e0804f
[ { "from": "human", "value": "**Reverse a Linked List** (Easy)\n\nGiven the head of a singly linked list, reverse the list and return the reversed list's head. Solve it both iteratively and recursively.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, an...
{ "category": "linked_list", "difficulty": "easy", "language": "python", "title": "Reverse a Linked List" }
606b1f08-1f61-449d-bd29-0a7987d3789e
[ { "from": "human", "value": "**Two Sum** (Easy)\n\nGiven an array of integers `nums` and an integer `target`, return the indices of the two numbers that add up to `target`. You may assume that each input would have exactly one solution, and you may not use the same element twice.\n\nPlease provide a solutio...
{ "category": "arrays_hashing", "difficulty": "easy", "language": "python", "title": "Two Sum" }
107aaa81-eeb7-48b9-af15-41b58cfeab8b
[ { "from": "human", "value": "**Number of Islands** (Medium)\n\nGiven an `m x n` 2D binary grid where '1' represents land and '0' represents water, return the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically.\n\nPlease provide a solutio...
{ "category": "graphs", "difficulty": "medium", "language": "python", "title": "Number of Islands" }
1e031fce-0068-479f-824d-8c38e0de58e4
[ { "from": "human", "value": "How would you answer the behavioral interview question: 'Tell me about a time you disagreed with your manager or a technical decision, and how you handled it.'" }, { "from": "gpt", "value": "**Strong Answer (STAR Format):**\n\n**Situation:**\nAt my previous role, our...
{ "category": "behavioral", "difficulty": "medium", "language": "behavioral", "title": "Tell Me About a Time You Disagreed With Your Manager" }
3a71ce18-0e37-4e3c-b71f-556e85d71ab8
[ { "from": "human", "value": "How would you answer the behavioral interview question: 'Tell me about a time you disagreed with your manager or a technical decision, and how you handled it.'" }, { "from": "gpt", "value": "**Strong Answer (STAR Format):**\n\n**Situation:**\nAt my previous role, our...
{ "category": "behavioral", "difficulty": "medium", "language": "behavioral", "title": "Tell Me About a Time You Disagreed With Your Manager" }
b86d1dc4-ed47-4a21-9af1-22c6cb7771a0
[ { "from": "human", "value": "**Reverse a Linked List** (Easy)\n\nGiven the head of a singly linked list, reverse the list and return the reversed list's head. Solve it both iteratively and recursively.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, an...
{ "category": "linked_list", "difficulty": "easy", "language": "python", "title": "Reverse a Linked List" }
3f46ee25-e836-4aac-b478-a61317d04141
[ { "from": "human", "value": "**Group Anagrams** (Medium)\n\nGiven an array of strings `strs`, group the anagrams together. You can return the answer in any order.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edge cases." }, { ...
{ "category": "arrays_hashing", "difficulty": "medium", "language": "python", "title": "Group Anagrams" }
c14de299-6c93-4dd8-af2e-5c46c68ff390
[ { "from": "human", "value": "**Coin Change** (Medium)\n\nYou are given an integer array `coins` representing coins of different denominations and an integer `amount` representing a total amount of money. Return the fewest number of coins needed to make up that amount. If that amount of money cannot be made ...
{ "category": "dynamic_programming", "difficulty": "medium", "language": "python", "title": "Coin Change" }
92c4653b-588b-4eea-8f84-52a0e68e02ac
[ { "from": "human", "value": "**Two Sum** (Easy)\n\nGiven an array of integers `nums` and an integer `target`, return the indices of the two numbers that add up to `target`. You may assume that each input would have exactly one solution, and you may not use the same element twice.\n\nPlease provide a solutio...
{ "category": "arrays_hashing", "difficulty": "easy", "language": "python", "title": "Two Sum" }
aada5686-af7a-4eeb-b090-6e4eab001c23
[ { "from": "human", "value": "How would you answer: 'Tell me about a significant technical mistake you made and what you learned from it.'" }, { "from": "gpt", "value": "**Strong Answer:**\n\n**The Mistake:**\nTwo years ago, I was deploying a database schema migration on a production PostgreSQL t...
{ "category": "behavioral", "difficulty": "medium", "language": "behavioral", "title": "Describe a Time You Made a Mistake" }
b573143c-08bd-49ca-a3c4-ad69cf9fcdfa
[ { "from": "human", "value": "**Binary Tree Level Order Traversal** (Medium)\n\nGiven the root of a binary tree, return the level order traversal of its nodes' values (i.e., from left to right, level by level).\n\nPlease provide a solution in python with a clear explanation of the approach, time/space comple...
{ "category": "trees", "difficulty": "medium", "language": "python", "title": "Binary Tree Level Order Traversal" }
e3c6c7e9-7cca-4fa2-b6e2-c475f920b1e4
[ { "from": "human", "value": "**Number of Islands** (Medium)\n\nGiven an `m x n` 2D binary grid where '1' represents land and '0' represents water, return the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically.\n\nPlease provide a solutio...
{ "category": "graphs", "difficulty": "medium", "language": "python", "title": "Number of Islands" }
78a52abd-e741-4015-ac0e-dc7165a9636b
[ { "from": "human", "value": "How would you answer the behavioral interview question: 'Tell me about a time you disagreed with your manager or a technical decision, and how you handled it.'" }, { "from": "gpt", "value": "**Strong Answer (STAR Format):**\n\n**Situation:**\nAt my previous role, our...
{ "category": "behavioral", "difficulty": "medium", "language": "behavioral", "title": "Tell Me About a Time You Disagreed With Your Manager" }
642427d5-b2fb-43b2-9b5d-8966a9408796
[ { "from": "human", "value": "**Subsets** (Medium)\n\nGiven an integer array `nums` of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order.\n\nPlease provide a solution in python with a clear explanation of the ap...
{ "category": "backtracking", "difficulty": "medium", "language": "python", "title": "Subsets" }
2b744de0-1335-4bcf-a7e5-1101599ba305
[ { "from": "human", "value": "**Container With Most Water** (Medium)\n\nGiven an integer array `height` of length n, where each element represents the height of a vertical line at position i. Find two lines that together with the x-axis form a container that holds the most water. Return the maximum amount of...
{ "category": "two_pointers", "difficulty": "medium", "language": "python", "title": "Container With Most Water" }
7942b478-dbc2-4a10-85ab-3d1bca35c01d
[ { "from": "human", "value": "**Container With Most Water** (Medium)\n\nGiven an integer array `height` of length n, where each element represents the height of a vertical line at position i. Find two lines that together with the x-axis form a container that holds the most water. Return the maximum amount of...
{ "category": "two_pointers", "difficulty": "medium", "language": "python", "title": "Container With Most Water" }
9b4ccfa0-dd4d-4484-8d7e-018971a292ac
[ { "from": "human", "value": "Design a rate limiter that can be used as middleware for a web API. Support multiple rate limiting strategies and work across distributed servers." }, { "from": "gpt", "value": "## System Design: Distributed Rate Limiter\n\n### Requirements\n- Limit requests per user...
{ "category": "system_design", "difficulty": "hard", "language": "conceptual", "title": "Design a Rate Limiter" }
47ac43d0-cb09-4606-aa7d-cfb3f0c85e6a
[ { "from": "human", "value": "**Subsets** (Medium)\n\nGiven an integer array `nums` of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order.\n\nPlease provide a solution in python with a clear explanation of the ap...
{ "category": "backtracking", "difficulty": "medium", "language": "python", "title": "Subsets" }
84130d26-7b68-46ef-9a4a-5f7b44d9568b
[ { "from": "human", "value": "**Group Anagrams** (Medium)\n\nGiven an array of strings `strs`, group the anagrams together. You can return the answer in any order.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edge cases." }, { ...
{ "category": "arrays_hashing", "difficulty": "medium", "language": "python", "title": "Group Anagrams" }
ceee98fe-2872-4d58-b441-eef006e0a3fb
[ { "from": "human", "value": "**Subsets** (Medium)\n\nGiven an integer array `nums` of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order.\n\nPlease provide a solution in python with a clear explanation of the ap...
{ "category": "backtracking", "difficulty": "medium", "language": "python", "title": "Subsets" }
8acce29f-8a4a-4df3-bd4d-b64600302a01
[ { "from": "human", "value": "**Subsets** (Medium)\n\nGiven an integer array `nums` of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order.\n\nPlease provide a solution in python with a clear explanation of the ap...
{ "category": "backtracking", "difficulty": "medium", "language": "python", "title": "Subsets" }
93b9ea30-7979-45f5-b727-4173a8110e6c
[ { "from": "human", "value": "**Daily Temperatures** (Medium)\n\nGiven an array of integers `temperatures` representing daily temperatures, return an array `answer` such that `answer[i]` is the number of days you have to wait after the `i`-th day to get a warmer temperature. If there is no future day with a ...
{ "category": "stack_queue", "difficulty": "medium", "language": "python", "title": "Daily Temperatures" }
198dd2fc-6c66-4559-970c-7eee902feeb5
[ { "from": "human", "value": "Design a URL shortening service like bit.ly. The system should support: creating short URLs from long URLs, redirecting short URLs to original URLs, and optionally tracking click analytics." }, { "from": "gpt", "value": "## System Design: URL Shortener\n\n### Require...
{ "category": "system_design", "difficulty": "hard", "language": "conceptual", "title": "Design a URL Shortener" }
a7ec543e-ef5a-4294-98d5-a6d054516bc3
[ { "from": "human", "value": "**Container With Most Water** (Medium)\n\nGiven an integer array `height` of length n, where each element represents the height of a vertical line at position i. Find two lines that together with the x-axis form a container that holds the most water. Return the maximum amount of...
{ "category": "two_pointers", "difficulty": "medium", "language": "python", "title": "Container With Most Water" }
dfaf752e-5142-4db7-ae99-05454512ad73
[ { "from": "human", "value": "**Course Schedule II (Topological Sort)** (Hard)\n\nThere are `numCourses` courses labeled from 0 to numCourses-1. Given `prerequisites[i] = [a, b]` meaning you must take course b before course a, return the ordering of courses you should take to finish all courses. If impossibl...
{ "category": "graphs", "difficulty": "hard", "language": "python", "title": "Course Schedule II (Topological Sort)" }
c411b011-1721-4969-8e44-74c7810737d5
[ { "from": "human", "value": "**Coin Change** (Medium)\n\nYou are given an integer array `coins` representing coins of different denominations and an integer `amount` representing a total amount of money. Return the fewest number of coins needed to make up that amount. If that amount of money cannot be made ...
{ "category": "dynamic_programming", "difficulty": "medium", "language": "python", "title": "Coin Change" }
b37cbbe4-b50a-435d-84d5-1a4ef05fad32
[ { "from": "human", "value": "Design a scalable notification system that supports push notifications, email, and SMS. The system should handle millions of users and support different notification types with user preferences." }, { "from": "gpt", "value": "## System Design: Notification System\n\n...
{ "category": "system_design", "difficulty": "hard", "language": "conceptual", "title": "Design a Notification System" }
33dcb6d8-2710-49e2-95ec-277e5fea4332
[ { "from": "human", "value": "**Course Schedule II (Topological Sort)** (Hard)\n\nThere are `numCourses` courses labeled from 0 to numCourses-1. Given `prerequisites[i] = [a, b]` meaning you must take course b before course a, return the ordering of courses you should take to finish all courses. If impossibl...
{ "category": "graphs", "difficulty": "hard", "language": "python", "title": "Course Schedule II (Topological Sort)" }
e2a098d1-60f7-4048-9688-e87788cea99e
[ { "from": "human", "value": "**Binary Tree Level Order Traversal** (Medium)\n\nGiven the root of a binary tree, return the level order traversal of its nodes' values (i.e., from left to right, level by level).\n\nPlease provide a solution in python with a clear explanation of the approach, time/space comple...
{ "category": "trees", "difficulty": "medium", "language": "python", "title": "Binary Tree Level Order Traversal" }
9c4ba39e-9692-4d24-a21c-0aca1ca34356
[ { "from": "human", "value": "**Course Schedule II (Topological Sort)** (Hard)\n\nThere are `numCourses` courses labeled from 0 to numCourses-1. Given `prerequisites[i] = [a, b]` meaning you must take course b before course a, return the ordering of courses you should take to finish all courses. If impossibl...
{ "category": "graphs", "difficulty": "hard", "language": "python", "title": "Course Schedule II (Topological Sort)" }
5ae10699-22b6-4b63-a9c9-e054b1b5406c
[ { "from": "human", "value": "**Binary Tree Level Order Traversal** (Medium)\n\nGiven the root of a binary tree, return the level order traversal of its nodes' values (i.e., from left to right, level by level).\n\nPlease provide a solution in python with a clear explanation of the approach, time/space comple...
{ "category": "trees", "difficulty": "medium", "language": "python", "title": "Binary Tree Level Order Traversal" }
7fe4f7f5-4331-4e89-87df-61342927741c
[ { "from": "human", "value": "How would you answer: 'Tell me about a significant technical mistake you made and what you learned from it.'" }, { "from": "gpt", "value": "**Strong Answer:**\n\n**The Mistake:**\nTwo years ago, I was deploying a database schema migration on a production PostgreSQL t...
{ "category": "behavioral", "difficulty": "medium", "language": "behavioral", "title": "Describe a Time You Made a Mistake" }
1dd2bdc1-8db3-419c-8ddb-52f78afa1227
[ { "from": "human", "value": "**Number of Islands** (Medium)\n\nGiven an `m x n` 2D binary grid where '1' represents land and '0' represents water, return the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically.\n\nPlease provide a solutio...
{ "category": "graphs", "difficulty": "medium", "language": "python", "title": "Number of Islands" }
475df322-a5c4-4852-a038-78307878c40e
[ { "from": "human", "value": "**Number of Islands** (Medium)\n\nGiven an `m x n` 2D binary grid where '1' represents land and '0' represents water, return the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically.\n\nPlease provide a solutio...
{ "category": "graphs", "difficulty": "medium", "language": "python", "title": "Number of Islands" }
b0f5fdcd-5cd4-451f-8fd7-e9bd48cb7960
[ { "from": "human", "value": "**Two Sum** (Easy)\n\nGiven an array of integers `nums` and an integer `target`, return the indices of the two numbers that add up to `target`. You may assume that each input would have exactly one solution, and you may not use the same element twice.\n\nPlease provide a solutio...
{ "category": "arrays_hashing", "difficulty": "easy", "language": "python", "title": "Two Sum" }
579999a3-c0a3-449c-9a9a-fd1eb4dabfd2
[ { "from": "human", "value": "**Container With Most Water** (Medium)\n\nGiven an integer array `height` of length n, where each element represents the height of a vertical line at position i. Find two lines that together with the x-axis form a container that holds the most water. Return the maximum amount of...
{ "category": "two_pointers", "difficulty": "medium", "language": "python", "title": "Container With Most Water" }
a88c7b69-63fc-4984-b59a-db54603cf720
[ { "from": "human", "value": "How would you answer: 'Tell me about a significant technical mistake you made and what you learned from it.'" }, { "from": "gpt", "value": "**Strong Answer:**\n\n**The Mistake:**\nTwo years ago, I was deploying a database schema migration on a production PostgreSQL t...
{ "category": "behavioral", "difficulty": "medium", "language": "behavioral", "title": "Describe a Time You Made a Mistake" }
d26a0586-1f11-479b-bffa-338415a730d0
[ { "from": "human", "value": "**Daily Temperatures** (Medium)\n\nGiven an array of integers `temperatures` representing daily temperatures, return an array `answer` such that `answer[i]` is the number of days you have to wait after the `i`-th day to get a warmer temperature. If there is no future day with a ...
{ "category": "stack_queue", "difficulty": "medium", "language": "python", "title": "Daily Temperatures" }
7c36a716-086e-43a1-9a87-45f3fd326c95
[ { "from": "human", "value": "Design a URL shortening service like bit.ly. The system should support: creating short URLs from long URLs, redirecting short URLs to original URLs, and optionally tracking click analytics." }, { "from": "gpt", "value": "## System Design: URL Shortener\n\n### Require...
{ "category": "system_design", "difficulty": "hard", "language": "conceptual", "title": "Design a URL Shortener" }
27d4d864-45c7-4215-9c84-845176d85f19
[ { "from": "human", "value": "Design a scalable notification system that supports push notifications, email, and SMS. The system should handle millions of users and support different notification types with user preferences." }, { "from": "gpt", "value": "## System Design: Notification System\n\n...
{ "category": "system_design", "difficulty": "hard", "language": "conceptual", "title": "Design a Notification System" }
4e38ccea-0339-43cc-b838-cdbe87c3ecf2
[ { "from": "human", "value": "**Edit Distance (Levenshtein Distance)** (Hard)\n\nGiven two strings `word1` and `word2`, return the minimum number of operations required to convert `word1` to `word2`. Operations allowed: insert a character, delete a character, replace a character.\n\nPlease provide a solution...
{ "category": "dynamic_programming", "difficulty": "hard", "language": "python", "title": "Edit Distance (Levenshtein Distance)" }
9ad751ef-2b42-4401-b26a-ed3e7f52a759
[ { "from": "human", "value": "**Longest Increasing Subsequence** (Hard)\n\nGiven an integer array `nums`, return the length of the longest strictly increasing subsequence.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edge cases." ...
{ "category": "dynamic_programming", "difficulty": "hard", "language": "python", "title": "Longest Increasing Subsequence" }
351b6979-a04b-4616-85f5-8ca15425b356
[ { "from": "human", "value": "**Search in Rotated Sorted Array** (Medium)\n\nAn integer array `nums` is sorted in ascending order and then rotated at some pivot. Given the array after rotation and an integer `target`, return the index of `target` if it is in `nums`, or -1 if it is not.\n\nPlease provide a so...
{ "category": "binary_search", "difficulty": "medium", "language": "python", "title": "Search in Rotated Sorted Array" }
5c708eb6-4584-4c6d-b3da-9ffced3bebc1
[ { "from": "human", "value": "Design a URL shortening service like bit.ly. The system should support: creating short URLs from long URLs, redirecting short URLs to original URLs, and optionally tracking click analytics." }, { "from": "gpt", "value": "## System Design: URL Shortener\n\n### Require...
{ "category": "system_design", "difficulty": "hard", "language": "conceptual", "title": "Design a URL Shortener" }
2d9f0c8c-a294-4b46-8a9c-281dbc436d5a
[ { "from": "human", "value": "**Edit Distance (Levenshtein Distance)** (Hard)\n\nGiven two strings `word1` and `word2`, return the minimum number of operations required to convert `word1` to `word2`. Operations allowed: insert a character, delete a character, replace a character.\n\nPlease provide a solution...
{ "category": "dynamic_programming", "difficulty": "hard", "language": "python", "title": "Edit Distance (Levenshtein Distance)" }
42c4a972-5fcd-415d-94d7-cc7a2c4e3ceb
[ { "from": "human", "value": "**Course Schedule II (Topological Sort)** (Hard)\n\nThere are `numCourses` courses labeled from 0 to numCourses-1. Given `prerequisites[i] = [a, b]` meaning you must take course b before course a, return the ordering of courses you should take to finish all courses. If impossibl...
{ "category": "graphs", "difficulty": "hard", "language": "python", "title": "Course Schedule II (Topological Sort)" }
f7785d9b-a0dd-4e9d-95d6-c8d84c174da7
[ { "from": "human", "value": "**Group Anagrams** (Medium)\n\nGiven an array of strings `strs`, group the anagrams together. You can return the answer in any order.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edge cases." }, { ...
{ "category": "arrays_hashing", "difficulty": "medium", "language": "python", "title": "Group Anagrams" }
ae07d65a-46aa-4787-ba30-5e252cd25f9f
[ { "from": "human", "value": "**Longest Substring Without Repeating Characters** (Medium)\n\nGiven a string `s`, find the length of the longest substring without repeating characters.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edg...
{ "category": "sliding_window", "difficulty": "medium", "language": "python", "title": "Longest Substring Without Repeating Characters" }
126e6732-7576-4d1a-9f8a-37ae97ad80b6
[ { "from": "human", "value": "**Subsets** (Medium)\n\nGiven an integer array `nums` of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order.\n\nPlease provide a solution in python with a clear explanation of the ap...
{ "category": "backtracking", "difficulty": "medium", "language": "python", "title": "Subsets" }
99e26b25-17b3-4703-a7f1-9e6959985858
[ { "from": "human", "value": "**Daily Temperatures** (Medium)\n\nGiven an array of integers `temperatures` representing daily temperatures, return an array `answer` such that `answer[i]` is the number of days you have to wait after the `i`-th day to get a warmer temperature. If there is no future day with a ...
{ "category": "stack_queue", "difficulty": "medium", "language": "python", "title": "Daily Temperatures" }
a2561657-ce9f-47e3-8940-efc9ff4a6217
[ { "from": "human", "value": "Design a rate limiter that can be used as middleware for a web API. Support multiple rate limiting strategies and work across distributed servers." }, { "from": "gpt", "value": "## System Design: Distributed Rate Limiter\n\n### Requirements\n- Limit requests per user...
{ "category": "system_design", "difficulty": "hard", "language": "conceptual", "title": "Design a Rate Limiter" }
a7088edc-3d2c-42ef-b4c6-c7b01386884c
[ { "from": "human", "value": "How would you answer: 'Tell me about a significant technical mistake you made and what you learned from it.'" }, { "from": "gpt", "value": "**Strong Answer:**\n\n**The Mistake:**\nTwo years ago, I was deploying a database schema migration on a production PostgreSQL t...
{ "category": "behavioral", "difficulty": "medium", "language": "behavioral", "title": "Describe a Time You Made a Mistake" }
e68e31ce-f7a4-4b7d-8228-8beec7fe56bc
[ { "from": "human", "value": "**Search in Rotated Sorted Array** (Medium)\n\nAn integer array `nums` is sorted in ascending order and then rotated at some pivot. Given the array after rotation and an integer `target`, return the index of `target` if it is in `nums`, or -1 if it is not.\n\nPlease provide a so...
{ "category": "binary_search", "difficulty": "medium", "language": "python", "title": "Search in Rotated Sorted Array" }
9a2be9b2-4d11-488a-8717-0e7a776f2cc0
[ { "from": "human", "value": "**Longest Increasing Subsequence** (Hard)\n\nGiven an integer array `nums`, return the length of the longest strictly increasing subsequence.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edge cases." ...
{ "category": "dynamic_programming", "difficulty": "hard", "language": "python", "title": "Longest Increasing Subsequence" }
9e2a8337-22bc-4ff8-b734-af994e936722
[ { "from": "human", "value": "**Longest Increasing Subsequence** (Hard)\n\nGiven an integer array `nums`, return the length of the longest strictly increasing subsequence.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edge cases." ...
{ "category": "dynamic_programming", "difficulty": "hard", "language": "python", "title": "Longest Increasing Subsequence" }
c1fdd7b2-a2bc-4f10-805e-381c9551b660
[ { "from": "human", "value": "**Longest Substring Without Repeating Characters** (Medium)\n\nGiven a string `s`, find the length of the longest substring without repeating characters.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edg...
{ "category": "sliding_window", "difficulty": "medium", "language": "python", "title": "Longest Substring Without Repeating Characters" }
30cad996-dbf9-4302-bac6-ee5340314207
[ { "from": "human", "value": "Design a scalable notification system that supports push notifications, email, and SMS. The system should handle millions of users and support different notification types with user preferences." }, { "from": "gpt", "value": "## System Design: Notification System\n\n...
{ "category": "system_design", "difficulty": "hard", "language": "conceptual", "title": "Design a Notification System" }
e364e39c-e4b9-4389-8015-86118819efaf
[ { "from": "human", "value": "**Course Schedule II (Topological Sort)** (Hard)\n\nThere are `numCourses` courses labeled from 0 to numCourses-1. Given `prerequisites[i] = [a, b]` meaning you must take course b before course a, return the ordering of courses you should take to finish all courses. If impossibl...
{ "category": "graphs", "difficulty": "hard", "language": "python", "title": "Course Schedule II (Topological Sort)" }
034325e1-fcbe-4f52-8a41-ee54b4715514
[ { "from": "human", "value": "**Edit Distance (Levenshtein Distance)** (Hard)\n\nGiven two strings `word1` and `word2`, return the minimum number of operations required to convert `word1` to `word2`. Operations allowed: insert a character, delete a character, replace a character.\n\nPlease provide a solution...
{ "category": "dynamic_programming", "difficulty": "hard", "language": "python", "title": "Edit Distance (Levenshtein Distance)" }
9d753eba-8eb8-4049-8687-f6f87d57bd39
[ { "from": "human", "value": "**Coin Change** (Medium)\n\nYou are given an integer array `coins` representing coins of different denominations and an integer `amount` representing a total amount of money. Return the fewest number of coins needed to make up that amount. If that amount of money cannot be made ...
{ "category": "dynamic_programming", "difficulty": "medium", "language": "python", "title": "Coin Change" }
bc453650-4ca4-4ef7-a84e-70ec96db1ccc
[ { "from": "human", "value": "**Subsets** (Medium)\n\nGiven an integer array `nums` of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order.\n\nPlease provide a solution in python with a clear explanation of the ap...
{ "category": "backtracking", "difficulty": "medium", "language": "python", "title": "Subsets" }
94b4d6c1-aa72-4209-bf51-e094d06c524f
[ { "from": "human", "value": "How would you answer: 'Tell me about a significant technical mistake you made and what you learned from it.'" }, { "from": "gpt", "value": "**Strong Answer:**\n\n**The Mistake:**\nTwo years ago, I was deploying a database schema migration on a production PostgreSQL t...
{ "category": "behavioral", "difficulty": "medium", "language": "behavioral", "title": "Describe a Time You Made a Mistake" }
7f206623-7524-42d8-ad20-e8ca4b442658
[ { "from": "human", "value": "**Group Anagrams** (Medium)\n\nGiven an array of strings `strs`, group the anagrams together. You can return the answer in any order.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edge cases." }, { ...
{ "category": "arrays_hashing", "difficulty": "medium", "language": "python", "title": "Group Anagrams" }
a3b9f67a-260c-4ee8-9a11-c0cc8af1b356
[ { "from": "human", "value": "**Binary Tree Level Order Traversal** (Medium)\n\nGiven the root of a binary tree, return the level order traversal of its nodes' values (i.e., from left to right, level by level).\n\nPlease provide a solution in python with a clear explanation of the approach, time/space comple...
{ "category": "trees", "difficulty": "medium", "language": "python", "title": "Binary Tree Level Order Traversal" }
c385005c-b34c-4837-acc5-6dd0771f5773
[ { "from": "human", "value": "**Longest Increasing Subsequence** (Hard)\n\nGiven an integer array `nums`, return the length of the longest strictly increasing subsequence.\n\nPlease provide a solution in python with a clear explanation of the approach, time/space complexity, and any important edge cases." ...
{ "category": "dynamic_programming", "difficulty": "hard", "language": "python", "title": "Longest Increasing Subsequence" }
83f95956-9e58-4c5a-8162-46f4f9cf29fe
[ { "from": "human", "value": "**Course Schedule II (Topological Sort)** (Hard)\n\nThere are `numCourses` courses labeled from 0 to numCourses-1. Given `prerequisites[i] = [a, b]` meaning you must take course b before course a, return the ordering of courses you should take to finish all courses. If impossibl...
{ "category": "graphs", "difficulty": "hard", "language": "python", "title": "Course Schedule II (Topological Sort)" }
6d7ec2eb-a998-448b-a4db-1f8ca1b1b137
[ { "from": "human", "value": "**Subsets** (Medium)\n\nGiven an integer array `nums` of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order.\n\nPlease provide a solution in python with a clear explanation of the ap...
{ "category": "backtracking", "difficulty": "medium", "language": "python", "title": "Subsets" }
b0c499c6-35db-4e16-9f58-d13b0e32ddcb
[ { "from": "human", "value": "**Course Schedule II (Topological Sort)** (Hard)\n\nThere are `numCourses` courses labeled from 0 to numCourses-1. Given `prerequisites[i] = [a, b]` meaning you must take course b before course a, return the ordering of courses you should take to finish all courses. If impossibl...
{ "category": "graphs", "difficulty": "hard", "language": "python", "title": "Course Schedule II (Topological Sort)" }
4bbd9b4c-c70b-461c-b83b-df7393439e53