conversations
listlengths
2
2
metadata
dict
id
stringlengths
36
36
[ { "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" }
dec13069-7b47-4ab4-ad4c-59d33c156fd6
[ { "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)" }
521ac2b0-76ee-4ef0-881a-f28f3a4f45dd
[ { "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" }
f1a36870-252f-404d-8d27-3fc2d9c80307
[ { "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" }
4170c820-c9d1-45ae-83d9-6557bda2c83f
[ { "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" }
f61b8952-41c8-48ac-8e62-d1b1be7891e8
[ { "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" }
3beb5a4d-9d07-43b2-a98b-3cb98e3aca0f
[ { "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" }
df6913f7-e57d-46c7-82b2-2c1d56a74d52
[ { "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" }
b4a9e031-a4e7-4cde-bc2c-7655c1ae0c36
[ { "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" }
acb6fe62-3ea7-48a1-9ab5-8f0f02eeba5e
[ { "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" }
b86f69d5-eff2-4202-84ce-b75c48add4b8
[ { "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" }
169a78ab-d55a-45ca-a389-a5f6cafe8de3
[ { "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" }
15c2ccdc-8459-4abf-b73c-733a29ec6e48
[ { "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" }
7c282425-8dc2-41d8-86af-cab27219407d
[ { "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" }
b48973c3-6787-410c-9394-f00999670196
[ { "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" }
00c72121-6cb2-4f96-90f5-afac706a276f
[ { "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" }
4b515b43-5d8c-441b-b9ea-ba29c3d438d7
[ { "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" }
17f2e0f2-5efd-4842-b148-ce32c17dac01
[ { "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" }
4f4c89f8-dc1b-49c8-80a5-e2e8c97ff5b4
[ { "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" }
8282943a-a3b4-4a39-b91c-12924ec9a292
[ { "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" }
9bd5216d-ed07-419b-92e6-b9d8c9c50431
[ { "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" }
a84cb181-be57-4bc6-a00f-bb6ad86e609e
[ { "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" }
7c462897-8a03-42e1-9372-ccd60cf8fd4a
[ { "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" }
90609a46-fad5-4b03-a557-a8b016816b7d
[ { "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" }
1f801c77-597e-405b-ad5c-319cdad83be4
[ { "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)" }
a0687651-f962-4a7a-a582-e6abc247d96b
[ { "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" }
fef3db29-d604-4d22-8898-6643cb90eacd
[ { "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" }
3f978cb6-dec6-4abd-a900-b0e70eeec72a
[ { "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" }
e5191565-d987-49ef-8506-7bce920bccd1
[ { "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" }
2b70f66a-cf7a-4458-a5ed-cf2058d40588
[ { "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)" }
fb8527e3-66f9-46fa-93c0-18417b706232
[ { "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" }
d30aa510-5c13-4ce0-b96b-aceab7022347
[ { "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" }
599bed19-4a65-4733-ae53-2e79149081a7
[ { "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" }
84274e7c-8405-4439-994a-40dd7030bbf2
[ { "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" }
b96a7292-4eea-4247-a5aa-fd0e184c8e40
[ { "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" }
5ccb8877-0fd8-41ac-87c5-159de475ace5
[ { "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)" }
1710e2c5-9592-4578-ac1f-77da12fec36e
[ { "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" }
cdfd1526-8e9e-4d72-b8c2-eb7048503ad8
[ { "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" }
108662f0-bd69-4982-b899-043db67bf804
[ { "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" }
3c46d853-2404-4725-90eb-b35f4a1facfe
[ { "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" }
45370b4e-abe6-4e96-bc66-407702a01d14
[ { "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" }
6483a7ef-aed8-4b98-9faa-2c77f14a6d84
[ { "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" }
6ea72ccf-5640-4829-9c6c-132af498ff9b
[ { "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" }
89994068-207f-4d9b-a60d-7e8eb44a07df
[ { "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" }
ab0ae2c5-52a2-4778-b4a4-8f699f30989c
[ { "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" }
51365cea-a694-445f-a3b7-413d345ba706
[ { "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" }
08d6a2f7-bdcc-4be7-9afe-58c3477fe85f
[ { "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" }
7dd2f22d-8da9-4b42-a42f-e03a7105cc5e
[ { "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" }
b76b7ac4-0791-4ccb-ba41-6b604542314d
[ { "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)" }
5d6dd881-785a-468d-8950-5ff34a25a343
[ { "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" }
80d6f211-3a4a-423d-a65e-0d902813d38d
[ { "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" }
1418c7fd-8501-4d4d-a2c4-d08bd3660286
[ { "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" }
90345a92-aa0b-4707-9b5e-b39294679ab5
[ { "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)" }
0ed51aa8-efee-45fb-acf8-fcebfc80b0ab
[ { "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" }
f6601212-eb54-444c-859c-36d003eaf709
[ { "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" }
4077bad3-15b0-4ba5-a062-cf95a27070f3
[ { "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" }
40ff9e6d-2799-4ea0-9163-c9ca60d2462e
[ { "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" }
72c6d6f4-470e-4cc7-8fa8-1a5e1abd0979
[ { "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" }
bc0ea7ec-e215-414d-b046-aedaa9f74ffb
[ { "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)" }
781b9f4f-30f2-41e5-8208-b65d7c86ff09
[ { "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" }
d2d7e2c8-3bc6-4eb7-a5bc-399a031cb03f
[ { "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" }
d983361a-fa74-4942-9f6f-8387a353f4c0
[ { "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" }
99101aca-73cf-4aad-8a94-4c00beac8048
[ { "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" }
b9a35b8f-e74a-4868-b8bc-e58488872ee1
[ { "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" }
043ccafe-2275-4ef4-ad44-29244224c0a4
[ { "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" }
ba14d016-7af6-4123-85b6-f0f3bd639b14
[ { "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" }
24eea3f9-33a2-4c63-8c33-8928c8d09e20
[ { "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" }
b53776e3-ba0d-4f17-bd7f-fbf743c57a46
[ { "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" }
659ae864-50fa-467b-baff-6f9858e6cd0e
[ { "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" }
735e1c25-3619-4d8e-abbf-ea9a048f480f
[ { "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)" }
a7c9f75b-9da4-4315-aebd-e9e3c9e5d556
[ { "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)" }
b0d04456-b71d-4c74-a26e-0651e343f21a
[ { "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" }
2053b398-b3de-4ffa-a0c5-3d0a82e32c02
[ { "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" }
45c45596-c43a-4bdf-942b-349e95724227
[ { "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" }
4419baf1-adad-40c5-94f9-14104a1302fd
[ { "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" }
4625472f-74cb-47a4-8516-44beb0b33921
[ { "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)" }
224abc24-a1c7-4b48-bea1-f1c7e5f8d3cf
[ { "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" }
8eeec477-fffb-4791-b01f-a4fb5eb72e86
[ { "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" }
b9e8bc18-ee27-4ec6-9419-f9e7dfb618e9
[ { "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" }
ec9cab7d-59b7-49d6-b60d-6162d9d9bdb2
[ { "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" }
2f099e6a-2583-457b-b7a9-751818309ce5
[ { "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" }
e081c877-caf4-4dfe-9ad3-c6f213066050
[ { "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" }
31088b03-646d-4863-9c0f-83cd1d22ef62
[ { "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" }
67446cd7-ae16-42bb-8b05-14028a196a73
[ { "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" }
9db313cb-f4bf-4956-a583-e3e3e6acba8c
[ { "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" }
bcbf6df9-d65d-42e5-9f6d-18189bec70d0
[ { "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" }
bef0fc0d-b49b-437a-9306-fc0b4d74c624
[ { "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" }
936cf93d-0757-4c28-b8fb-4336b5699efe
[ { "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)" }
389719e0-f684-4d80-a9f6-90ebc1b8092b
[ { "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" }
bec7a04d-0d9f-4180-ac06-e3737b6b4d5b
[ { "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" }
88628fd3-cdd6-4ecb-a07b-2d3d067bc17d
[ { "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" }
04bdf3c1-cf4c-446c-9813-6f664959f001
[ { "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" }
ee5bdabc-f184-4420-8bc4-af348ed5da90
[ { "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" }
480d7495-3c00-4d07-ae50-697fd38734cc
[ { "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" }
710d59fb-1aa9-4dce-b516-dbb23b710d46
[ { "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" }
f82a35aa-a446-4e61-8e25-6dde6b83ec48
[ { "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" }
9e1904f4-6029-4851-a2ea-73e7009f401e
[ { "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" }
6134241d-9806-4b22-85a0-f91256a231ef
[ { "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" }
c9a95c52-4688-4eb8-b391-001121b91625
[ { "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" }
574ca5b9-7e41-4f71-812d-0e335c7f441e
[ { "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" }
878cc70b-30e4-4757-a92e-9b0bd70482d9