conversations
listlengths
2
2
metadata
dict
id
stringlengths
36
36
[ { "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" }
aa295647-b85a-4d0d-9e6a-f31374afc56f
[ { "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" }
6847e941-2bbf-4a84-9af6-f74f6a95f758
[ { "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" }
fba0e503-08b1-4e06-a2b4-89609a31c051
[ { "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" }
7651c08d-e570-472a-9c65-2f2744d56ac2
[ { "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" }
61ee3194-7e1e-4d95-bc5b-18d4160f21e3
[ { "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)" }
85e9d3f4-a9ee-4fc0-9e98-658dd1cae663
[ { "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" }
b7343ea3-f3c1-40d0-994f-86c9c875b112
[ { "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)" }
32f29c0f-a6eb-4c16-bb1b-d0f175c4d8c0
[ { "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" }
dd5d3206-e2d0-4ea1-b4db-a450637fe17b
[ { "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" }
a79fdb75-bbf8-4211-8b2c-608827bd50c8
[ { "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" }
139756e1-acd1-426c-9ffc-a507dbab133a
[ { "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" }
c13979b2-e877-4a24-aed5-b25416427057
[ { "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" }
66da7c9c-0b36-4154-a5e7-c95a4b451d6f
[ { "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)" }
20698b88-712d-4f33-ba24-795bd59a4f98
[ { "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" }
e4733003-86e3-4090-a771-dcc0c0300a5a
[ { "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" }
568db277-be0b-472c-8c55-49adb26eba13
[ { "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" }
6ea75929-58e1-4943-8b82-9958b218c6e3
[ { "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" }
592dbf79-1223-41cb-be34-d786d236a05e
[ { "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" }
89fd06a9-5490-473d-8d65-66cba5828912
[ { "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" }
44737ad7-e9c3-496b-959b-aa2ea204b5a9
[ { "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)" }
48833725-c818-4d5a-bb53-d247c72e154b
[ { "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" }
59c8b3f8-f4a3-4abf-acb2-32aceccf3c0d
[ { "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" }
4243f5ec-e9d6-493c-9894-fa92815f1980
[ { "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" }
69ec371a-af0e-4ca0-a1b3-e0a2fedfe90b
[ { "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" }
251c0929-b260-4243-ad3e-f0e07b2a299a
[ { "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" }
c2b48272-f3da-413e-86ec-f089183e1ea7
[ { "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" }
54ef1fe1-5522-4b74-b287-4fba14be6664
[ { "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)" }
c7e2d66a-82ae-4b40-9fed-d10e5c33f185
[ { "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" }
38bbca23-1381-4504-becb-c66ea189e610
[ { "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" }
8fb0b604-e3bb-4630-a286-18027a4088b9
[ { "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)" }
ef065142-f052-4e7d-846c-089850fd49d5
[ { "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" }
35c31d30-9227-4e38-b208-ffd2fb9de704
[ { "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" }
a0138084-3ddb-44de-89ec-818508d42d9c
[ { "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" }
86bc8fa0-6fdf-46af-a4ac-a5886e950afa
[ { "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" }
d53b219d-0994-406e-818b-1e1926b8f4bc
[ { "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)" }
3e9a2bf6-c5f0-4592-949b-d421bf8dd5e9
[ { "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" }
4adc524e-00a7-4c71-ad87-a3b2674e2d73
[ { "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" }
5d70a358-c0ce-4550-bd47-f841dbd65465
[ { "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" }
56e04e7a-1f24-488a-b51d-f8690650c554
[ { "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" }
196ff3b2-2291-439a-9d17-3db62d733d15
[ { "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" }
93c4dcd8-442e-439f-927d-d5107e56c1c4
[ { "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" }
f1d973dc-ea9b-4b73-8d5e-57c5814f4f9b
[ { "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" }
33eebdfe-d25d-41e0-b6e5-7e1f68f563dd
[ { "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" }
e8e074e1-c9f5-4b46-bd9e-14b0b026d688
[ { "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" }
15c00583-e933-441a-9f77-7e811d2b3026
[ { "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" }
7422b0d1-a96a-40a6-b49f-4eb36a24799c
[ { "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)" }
03179e6c-dba6-488d-b5dd-8b85572fccce
[ { "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" }
052e7199-1c11-4e84-9066-7a4421a67132
[ { "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" }
2c0d5146-2af9-4d71-94af-77e14edca495
[ { "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" }
18945342-4d5e-42e2-88a1-b7b9284b818f
[ { "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" }
6a7c5d1a-a7c7-47f1-a1e2-2b26076aef96
[ { "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" }
b363ef49-98c6-4083-992a-211dbef9dc26
[ { "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" }
de4b3d05-7017-4dbe-9ace-d71f3a41ee67
[ { "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" }
f12ca6c3-a39c-4bd7-abaa-2805eade52b8
[ { "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" }
965dba3b-efc7-473e-8d07-1bac13dc5b82
[ { "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" }
b75e0153-f426-4a70-a628-b0697f0ebf87
[ { "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" }
2952fc0e-228e-4cd1-acb2-2599e308c845
[ { "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" }
1c3cd41e-598d-4ca8-ba55-d4704ee6de5c
[ { "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" }
eef19909-5b60-40cd-85d4-b9d0d560e06d
[ { "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" }
26f38960-fb96-4c75-bcbe-8c5de1290eb2
[ { "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" }
4d33d099-b162-43fd-804e-00d25b10b6f3
[ { "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" }
ff2b1fee-4944-4688-a091-89b3420fdd39
[ { "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" }
6f6cd3ed-cb8e-49bc-bffa-5888e4f607e5
[ { "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" }
5da0734d-baaf-48c3-9973-6b9fd7b940f8
[ { "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" }
f469adb2-fa18-41f0-a4aa-31ef87dc5ab7
[ { "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)" }
05c0c983-85a5-4a3f-8c15-c0ceec15fe4f
[ { "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" }
293fb2c2-0ad5-437f-80cd-b8dfd4edc623
[ { "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" }
78b61d0b-fa10-421f-a0ec-231880177cca
[ { "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" }
81b263b4-3e20-417e-868d-83477e5228e2
[ { "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" }
36e0f4a2-d630-4623-a63d-a12632fe0f6f
[ { "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" }
b7ab402f-b13a-4a2d-b6e1-f0d16bc73504
[ { "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" }
dd809aff-14f5-4c16-93ed-69a69215a268
[ { "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" }
1aa7e946-49a4-4473-a481-995ea7505758
[ { "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" }
02815033-2ffd-4154-b1f2-f419b04efcc6
[ { "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" }
75eb025d-19a4-4cd7-9ebc-8aabb5f58cd4
[ { "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" }
30b541d1-3abf-426a-8610-fa9151f1e883
[ { "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" }
0108e858-06f4-4695-85d0-5b6dc6d186c6
[ { "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" }
106738bb-979b-4c13-9c8a-7fc8be03064f
[ { "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" }
057414d7-186b-494e-b777-cc3b2e97d174
[ { "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" }
1a33116b-8734-4ccb-b219-46051ed3f17d
[ { "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" }
ea2afa49-e8f1-4603-a290-a50a23938cbc
[ { "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" }
22b62f2e-be99-474c-8d2d-dd185971faf1
[ { "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" }
23522b95-dfb8-4b40-8290-db4a4718c8fb
[ { "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" }
14ae1afb-38c8-4ca3-ae9d-d21c924df965
[ { "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" }
d5373c97-fd6c-49b6-bdac-4bb5f851e701
[ { "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" }
a1f80d80-81d3-4a77-a993-2bb963932670
[ { "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" }
84b9b969-e464-4f8d-a053-595fa7a6f2ce
[ { "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" }
23f62554-3135-4b39-a1d8-96b6654ff46f
[ { "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" }
769b47be-f913-4442-af94-17993c7ec997
[ { "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)" }
ffa975ea-7a7e-4d18-b8d8-d0761492583e
[ { "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" }
1f0d332a-2949-4708-92d3-398741e80d00
[ { "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" }
9bbcd709-694d-44ca-99ad-4d89a749da4c
[ { "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" }
a0d8b7b8-1b7c-4a03-86d3-686524df37b3
[ { "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" }
9eda45d1-2666-4d3b-b5c0-114524445f00
[ { "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" }
511638bb-2247-4981-8e15-f79c30cdb27c
[ { "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" }
edaee43d-0860-4136-bc8c-30965105c73b
[ { "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" }
45f92959-9fca-4c48-b9f0-8f89072c5ce8
[ { "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" }
0bf1f012-be2c-4cda-8c5f-e2e16ff60af3
[ { "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" }
f8ff2cd7-392e-4e5d-a47e-ba51d5fbdea1
[ { "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" }
95d855ea-6e12-4640-8a23-2b8516d4f733