conversations
listlengths
2
2
metadata
dict
id
stringlengths
36
36
[ { "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" }
ce678ff6-64df-4da0-824d-cb8a17ab116e
[ { "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" }
2ef89070-183f-45f9-b80f-9bcf9ca6b884
[ { "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" }
364b8a76-8f16-4216-9963-8516a28581f1
[ { "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" }
44e05e5c-42a1-48bf-a5c0-442b534a6517
[ { "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" }
5f028346-1db0-46ce-92f1-fe61b987559a
[ { "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" }
c2002f06-ad5d-476a-a59f-bf8f1c6090e8
[ { "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" }
a90b1942-03d8-450c-82be-e051f4616c2b
[ { "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" }
47003c7c-0856-41cb-b6e5-e8ec125a3ceb
[ { "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)" }
0545d93f-9d37-41e4-acd5-2eef3232fff6
[ { "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" }
8097674f-23b2-48a2-81b5-857fbd29a2c8
[ { "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" }
daff5501-61ca-4ab0-a683-769224aa18b8
[ { "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" }
8b82666c-77b8-4dce-a6bf-3e1b978c2e3d
[ { "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" }
dad1061d-99c6-40b0-859c-340efb2e3071
[ { "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" }
8398712f-4f13-4d9a-87af-7aa2c956ba8e
[ { "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" }
380880f6-7054-4e98-9fea-9e334d65f453
[ { "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" }
c3b0337a-d444-4988-950f-174fa67ff8d3
[ { "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" }
7f0b8de3-f2b6-4eb2-88a7-78e0ea65bd11
[ { "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" }
358e262c-8d27-4ed6-a95e-5305a0bc5b5c
[ { "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" }
b8d6fa97-0078-4014-a355-d2043442a814
[ { "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" }
7ce2b401-d1fd-4de4-a198-3781801c7742
[ { "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" }
c500edc5-0651-4c1b-976d-00dca685ecc8
[ { "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" }
93a542c7-5b7e-449e-a031-89413b81006e
[ { "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" }
af210b91-03cd-4a26-808f-f20e38d77bcb
[ { "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" }
ef46727b-aeb9-46bd-beed-a12add00ce50
[ { "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" }
4dcac1f3-808a-4899-b510-d3116923bd14
[ { "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" }
5982f175-fe8c-40b4-b3c4-3269bb1a55bd
[ { "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" }
6179a83d-40d5-45f9-914e-42a5999e3e67
[ { "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" }
b07f5455-1652-41a0-951b-6a40aef6da95
[ { "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" }
7c3f1722-ad90-4171-88fa-55f4eb6663f5
[ { "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" }
dcb16215-8a5f-4da6-92f2-1743fc701bcb
[ { "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" }
a3281a27-a660-4fd1-9761-4930ff1c822c
[ { "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" }
6314c29f-100d-4383-9f8c-9e6d2d9f6ca2
[ { "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" }
c1cc972a-9646-4eca-9263-a0d44d3fdd4f
[ { "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" }
49d60e2f-31f5-4c96-a6aa-ec6e5bd84026
[ { "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)" }
57fc72ed-80e8-4308-bb77-c4a286782aed
[ { "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" }
72a9d0dd-917f-4114-b57a-4dd86eba578d
[ { "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" }
07d7b894-cf34-4363-8f06-4f454c91b5e4
[ { "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" }
8f5d861e-e48a-47c6-b1c6-92a0dc7c95a2
[ { "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" }
c5db99b1-2612-4727-bbae-f1dbed89bda4
[ { "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" }
4b1a5656-b2f9-4200-903d-76dedbda80d8
[ { "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" }
e9e9e1ab-6441-4f6e-95b5-396ae77e9eaa
[ { "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" }
61740aa3-7b2c-43d4-ac76-7cc282a236a8
[ { "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" }
bf6308a9-db9e-49f2-af2e-8c268d9a6400
[ { "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" }
06c0c5bf-b4ef-4930-abf7-071f197ee849
[ { "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" }
56458824-d48c-4852-9935-a49e951f772f
[ { "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" }
d6279a1b-ac24-44f2-b323-670103f5859c
[ { "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" }
566e0cf6-cc1f-4733-ab2a-464373f99995
[ { "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)" }
f9881788-472c-41e1-8c98-15fef1caaaaf
[ { "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" }
153df3b1-7b32-4255-91cf-fe61c10aaaac
[ { "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" }
72de042d-a8bc-4c7c-a841-a3a5ccef0e94
[ { "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)" }
502f41c9-ef69-4661-b7f8-c657f76bdd93
[ { "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" }
ef1fc62f-8487-453f-b5b6-145eadbf586b
[ { "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" }
1e9386c6-1ed7-44ec-b580-5c2170ccd3c1
[ { "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" }
a9e21ec0-f5bb-4494-b3ef-db578980c39f
[ { "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" }
40215332-e8b9-4292-babf-12ae6ad1fb1a
[ { "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" }
296de59b-7ac4-4367-98fb-7696ec2daa47
[ { "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" }
6000e180-c1fb-4626-a834-816c2aa8c7c6
[ { "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" }
f53f1294-433d-426c-9ba6-ff5858179466
[ { "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" }
d180df36-9b4e-47a7-8d4e-ef7ca24a4db6
[ { "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" }
462453c8-74b7-44d7-9d14-217e6836c07c
[ { "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" }
834adda1-b4fe-4bcf-862e-1be401500e06
[ { "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" }
099596af-d08e-4be6-8aa1-50a776509c0b
[ { "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" }
d0800d38-96c5-4d50-a2e6-41ace4cfce95
[ { "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" }
c7de9e60-16c4-4c4d-a6a5-9d6fc4967504
[ { "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" }
439954e8-5cf0-4557-bac1-4e293ec6671f
[ { "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)" }
d2a7c5f3-d948-4293-9c83-a7949fdb0081
[ { "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)" }
71d49d8d-0704-4fb4-9528-598ffe177c18
[ { "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" }
bc119a68-c549-441a-a6d5-339bf4a901fb
[ { "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" }
3d8324ee-46e5-4425-acbe-09f1c84357d6
[ { "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" }
26ddada8-2b23-4cb3-823a-7e7a31af3c84
[ { "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" }
52369df1-8860-4b29-8830-b7d79b62c216
[ { "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" }
793a60d6-2b9f-4451-b070-3ce11c99b560
[ { "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" }
ed007023-378e-44ec-8368-e612132ea765
[ { "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" }
77748ca6-228a-46e6-9572-3b8fc80d0857
[ { "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" }
bf4956cc-c33a-4006-a287-119d9c2d9d2b
[ { "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" }
2fd14ab6-c857-4892-8d97-deebec0d6abd
[ { "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" }
fe5043c6-dc8d-4b85-b837-785ae0bc4d1f
[ { "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" }
010ee3d4-6217-4c7f-98b0-82adb9c3868c
[ { "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" }
f0cbdd54-94bc-4b68-9ea5-4ae5ef71f9b9
[ { "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" }
eb2493f2-a583-4e45-9591-c54ee4f4a4f5
[ { "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" }
2934dfdb-3d07-48a4-b42a-4714e514f129
[ { "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" }
6cb7313f-b11e-4c95-a7e5-671f7c062d88
[ { "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" }
caab00c7-014a-4639-a118-a601a7fe744c
[ { "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" }
759314df-b270-4580-af60-454c41e61ee3
[ { "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" }
4d7d3b42-4481-4fc5-9f8a-a87229cf5618
[ { "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" }
8cc67e2d-070f-43fd-8c51-988b364a30c7
[ { "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)" }
46dff932-4ac9-447b-8147-9028eb85444d
[ { "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" }
7d0a2906-8c34-4fe5-bc42-ded6fd7ffa97
[ { "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" }
073b7646-69a3-4609-bf81-d6eb35fcfb90
[ { "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" }
c0bd353f-94ec-47c7-98c1-bc475f185e66
[ { "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" }
a032b59e-d59c-4b4f-b128-a08b097da254
[ { "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" }
873cae79-1681-4e87-854b-5babae32754f
[ { "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" }
ac4da3bd-d01a-4598-9379-236bf0ebda0d
[ { "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" }
322bdbe5-b6d5-4cf0-9216-26fde7407108
[ { "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)" }
cd8cf98d-3d63-482c-a6a3-bc515421d9b2
[ { "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" }
0c7f0681-af4e-4b1b-8ff8-842b8f9b96f3
[ { "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" }
e065b625-8f11-43ce-998e-ff26b37adb29
[ { "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" }
7e64f0a9-6343-4fae-a9d7-eed286cb8b90
[ { "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" }
5d96ff69-024b-4d4e-a080-6ee5d20e093c
[ { "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)" }
5fbe8a5d-47de-4064-a895-99ef8df30798