必须为基于产品的公司做编码问题
随着安置季节的回归,GeeksforGeeks 在这里帮助您完成面试。我们选择了一些最常见的和必须做的练习题来破解基于产品的公司面试。
您还可以参加我们的模拟分班竞赛,这将帮助您同时学习不同的主题和练习,模拟真实分班考试环境的感觉。
注意:现在您可以跟踪您的进度并从这些问题的视频社论中学习Must Do Interview Preparation Course 。
话题:
- 数学
- 大批
- 搜索
- 排序
- 矩阵
- 细绳
- 散列
- 位掩码
- 链表
- 堆
- 队列
- 堆
- 二叉树
- BST
- 图形
- 特里
- 贪婪的
- DP
- 递归
- 回溯
- 算法
- 设计
数学
Question | Article | Practice |
---|---|---|
Missing Number in Array | Link | Link |
Trailing Zeros in Factorial | Link | Link |
A Simple Fraction | Link | Link |
Nth Natural Number | Link | Link |
Smallest Positive Integer that can not be represented as Sum | Link | Link |
数组
数组是存储在连续内存位置的项目的集合。这个想法是将多个相同类型的项目存储在一起。Question Article Practice Rotate Array Link Link Majority Element Link Link Plus one Link Link Array of alternative +ve and -ve no.s Link Link Product Array puzzle Link Link Frequencies of Limited Range Array Elements Link Link Large Factorial Link Link Jump Game Link Link Maximum number of 1’s Link Link Stock Buy and Sell Link Link Longest Consecutive Subsequence Link Link Maximum value of difference of a pair of elements and their Index Link Link Maximum index Link Link K-th element of two sorted Arrays Link Link Trapping Rain Water Link Link 3 sum closest Link Link Maximum circular Subarray Sum Link Link Merge without Extra Space Link Link
搜索
Question | Article | Practice |
---|---|---|
Search insert position of K in a sorted array | Link | Link |
Collecting Wood | Link | Link |
Left most and right most index | Link | Link |
Bitonic Point | Link | Link |
Search an element in sorted and rotated array | Link | Link |
Square root of a number | Link | Link |
Find missing in second array | Link | Link |
Painter’s Partition Problem | Link | Link |
Median of 2 sorted arrays of Different sizes | Link | Link |
Allocate minimum number of pages | Link | Link |
排序
Question | Article | Practice |
---|---|---|
Wave array | Link | Link |
Count the number of possible triangles | Link | Link |
Triplets with sum with given range | Link | Link |
Count Inversions | Link | Link |
Relative Sorting | Link | Link |
Minimum Platforms | Link | Link |
Maximum Index | Link | Link |
矩阵
矩阵表示按行和列顺序排列的数字集合。必须将矩阵的元素括在圆括号或方括号中。Question Article Practice Sort a 2D vector diagonally Link Link Spiral Matrix Link Link Boolean matrix Link Link Rotate matrix by 90 degrees Link Link Search in a row-column sorted Matrix Link Link Row with maximum 1s Link Link
细绳
字符串被定义为一个字符数组。字符数组和字符串的区别在于字符串以特殊字符'\0' 结尾。Question Article Practice Reverse words in a given string Link Link Longest Common Prefix Link Link Roman Number to Integer Link Link Next higher palindrome number using the same set of digits Link Link Length of longest prefix suffix Link Link Smallest window in string containing all characters Link Link Validate an IP address Link Link Implement Atoi Link Link Look and say Pattern Link Link Longest K unique characters substring Link Link
散列
Question | Article | Practice |
---|---|---|
Key Pair | Link | Link |
Top K Frequent Elements in Array | Link | Link |
Intersection of two arrays | Link | Link |
Array Pair Sum Divisibility Problem | Link | Link |
Triplet Sum in Array | Link | Link |
Length of the longest substring | Link | Link |
Is Sudoku Valid | Link | Link |
Print Anagrams Together | Link | Link |
Subarrays with sum K | Link | Link |
Longest subarray with sum divisible by K | Link | Link |
位掩码
Question | Article | Practice |
---|---|---|
Reverse bits | Link | Link |
Number of set bits | Link | Link |
Sum of two integers | Link | Link |
Check whether K-th bit is set or not | Link | Link |
Longest Consecutive 1’s | Link | Link |
Find the element that appears once | Link | Link |
Gray code | Link | Link |
Maximum AND | Link | Link |
Maximum subset XOR | Link | Link |
Bit Difference | Link | Link |
链表
链表是一种线性数据结构,其中元素不存储在连续的内存位置。Question Article Practice Merge Two Sorted Linked Lists Link Link Reverse a Linked List Link Link Delete a Node without Head Pointer Link Link Add two Numbers represented by linked lists Link Link Finding middle element in a linked list Link Link Check if linked list is palindrome Link Link Rearrange a linked list Link Link Detect and Remove a loop In Linked List Link Link Merge Sort for Linked List Link Link Intersection of Linked List Link Link Rotate Linked List by K places Link Link Flattening a Linked List Link Link Reverse a linked list in groups of given size Link Link Partition a linked list around a given value Link Link Clone a linked list with next and random pointers Link Link
堆
堆栈是一种线性数据结构,其中元素只能从列表的一侧(称为顶部)插入和删除。堆栈遵循 LIFO(后进先出)原则。Question Article Practice Parenthesis Checker Link Link Infix to Postfix Link Link Restrictive Candy Crush Link Link Next Larger Element Link Link Stock span problem Link Link The Celebrity Problem Link Link Maximum Rectangular Area in a Histogram Link Link Longest Valid Parentheses Link Link Maximum of minimum for every window size Link Link Remove K digits Link Link 132 Geeky Buildings Link Link
队列
队列是一种线性数据结构,其中元素只能从列表的一侧插入,称为后部,元素只能从列表的另一侧删除,称为前部。队列数据结构遵循FIFO(先进先出)原则。Question Article Practice Maximum of all subarrays of size K Link Link Circular tour (Sliding Window) Link Link
堆
堆是一种特殊的基于树的数据结构,其中树是完全二叉树。Question Article Practice Rearrange Characters Link Link Minimum Cost of ropes Link Link Kth largest element of stream Link Link Merge k sorted arrays Link Link Median of stream Link Link
二叉树
元素最多有 2 个子节点的树称为二叉树。由于二叉树中的每个元素只能有 2 个孩子,我们通常将它们命名为左孩子和右孩子。Question Article Practice Symmetric Tree Link Link Zigzag Tree Traversal Link Link Checked for Balanced tree Link Link Height of Binary Tree Link Link Diameter of Binary tree Link Link Determine if two trees are identical Link Link Minimum depth of binary tree Link Link Check if subtree Link Link Inorder Traversal (iterative) Link Link Preorder Traversal (iterative) Link Link Postorder Traversal(iterative) Link Link Vertical Traversal of a Binary Tree Link Link Construct Binary Tree from Preorder and Inorder Traversal Link Link Connect nodes at same level Link Link Lowest Common Ancestor of a Binary Tree Link Link Boundary Traversal Link Link Sum tree Link Link Binary Tree to Doubly Linked List Link Link Maximum sum path between two leaf nodes Link Link Burning Tree Link Link
二叉搜索树
二叉搜索树是一种基于节点的二叉树数据结构,具有以下属性:
- 节点的左子树仅包含键小于节点键的节点。
- 节点的右子树只包含键大于节点键的节点。
- 左右子树也必须是二叉搜索树。
Question | Article | Practice |
---|---|---|
Check for BST | Link | Link |
Array to BST | Link | Link |
Inorder Successor in BST | Link | Link |
Kth Largest Element in a BST | Link | Link |
Remove BST keys outside the given range | Link | Link |
Pair with given target in BST | Link | Link |
Unique BSTs | Link | Link |
Preorder Traversal and BST | Link | Link |
Merge two BST’s | Link | Link |
Fixing two nodes of a BST | Link | Link |
图形
图是由节点和边组成的非线性数据结构。节点有时也称为顶点,边是连接图中任意两个节点的线或弧。Question Article Practice Number of Islands Link Link COVID Spread Link Link Prerequisite tasks Link Link Strongly Connected Component Link Link Minimum swaps to sort Link Link Shortest path Link Link Circle of Strings Link Link Snake and Ladder Problem Link Link Detect cycle in an undirected graph Link Link Detect cycle in a directed graph Link Link Check for Bipartite graph Link Link Unit Area of Largest region of 1s Link Link Alien Dictionary Link Link Word Ladder Link Link
特里
Trie 是一种高效的信息检索数据结构。使用 Trie,搜索复杂性可以达到最佳限制(密钥长度)。Question Article Practice Minimum XOR value pair Link Link Word Boggle – II Link Link Most frequent word in an array of strings Link Link Minimum XOR value pair Link Link
贪婪的
贪婪是一种算法范式,它逐步构建解决方案,总是选择下一个提供最明显和直接好处的部分。Question Article Practice N meetings in one room Link Link Coin Piles Link Link Maximize Toys Link Link Largest number with given sum Link Link Minimize the heights Link Link Fractional Knapsack Link Link Job Sequencing Link Link Police and Thieves Link Link Water the Plants Link Link
DP
动态规划主要是对普通递归的优化。无论我们在哪里看到重复调用相同输入的递归解决方案,我们都可以使用动态编程对其进行优化。Question Article Practice Count ways to reach the n’th stair Link Link Get Minimum Squares Link Link Nth Fibonacci Number Link Link 0 – 1 Knapsack Problem Link Link Number of Coins Link Link Edit distance Link Link Maximize The Cut Segments Link Link Box Stacking Link Link Longest Increasing Subsequence Link Link Longest Palindromic Substring Link Link Longest Common Substring Link Link Longest Common Subsequence Link Link Wildcard Pattern Matching Link Link Total Decoding Messages Link Link Max length chain Link Link Maximum sum increasing subsequence Link Link Minimum number of jumps Link Link Subset Sum Problem Link Link Maximum path sum in matrix Link Link Player with max score Link Link Shortest Common Supersequence Link Link Palindrome Partitioning Link Link Form a Palindrome Link Link Boolean Parenthesization Link Link Matrix Chain Link Link Maximum Profit Link Link Minimum Cost Path Link Link Partition Equal Subset Sum Link Link
递归
函数直接或间接调用自身的过程称为递归,相应的函数称为递归函数。Question Article Practice Number of Paths Link Link Pascals Triangle Link Link Josephus problem Link Link Tower of Hanoi Link Link Special Keyboard Link Link Flood Fill Algorithm Link Link
回溯
回溯是一种递归解决问题的算法技术,它通过尝试逐步构建解决方案,一次一个,删除那些在任何时间点都不能满足问题约束的解决方案(这里指的是时间)到达搜索树的任何级别所经过的时间)。Question Article Practice Permutations Link Link Letter Combinations of a Phone Number Link Link Generate Parentheses Link Link Word Boggle – 1 Link Link Rat in a Maze Problem Link Link Largest number in K swaps Link Link Combination Sum Link Link Palindrome Partitioning Link Link N-Queen Problem Link Link Solve the Sudoku Link Link
算法
Question | Article | Practice |
---|---|---|
Bubble Sort | Link | Link |
Insertion Sort | Link | Link |
Selection Sort | Link | Link |
Merge Sort | Link | Link |
Quick Sort | Link | Link |
Heap Sort | Link | Link |
Count Sort | Link | Link |
Kadane Algorithm | Link | Link |
Minimum Spanning Tree | Link | Link |
Implementing Dijkstra Algorithm | Link | Link |
Floyd Warshall | Link | Link |
Bellman Ford Algorithm | Link | Link |
Rabin-Karp Algorithm | Link | Link |
KMP algorithm | Link | Link |
Z Algorithm | Link | Link |
Huffman Encoding | Link | Link |
设计
Question | Article | Practice |
---|---|---|
Stack using two queues | Link | Link |
Queue using stack | Link | Link |
Ternary Search | Link | Link |
Binary Heap Operations | Link | Link |
LRU cache | Link | Link |
Trie | (Insert and Search) | Link | Link |
您还可以查看我们最新的在线课程系列,了解 DS & Algo 被命名为 DSA,它涵盖了从基础到高级的数据结构的所有内容。
笔记:
- 如果您正在寻找最常见的 CS 科目面试问题或理论问题,请参阅以下链接 - Amazon、Microsoft、Flipkart 中计算机科学科目的面试问题最多
- 我们还准备了一份关于公司的顶级编码问题列表。请参阅以下链接 - 公司必须做的编码问题
- 如果您正在寻找有关竞争性编程之旅的完整指南,请参阅以下链接 - 竞争性编程 - 完整指南。
GeeksforGeeks 课程
Complete Interview Preparation
An enriching course designed by the experts to help you crack the coding interview of top product or service-based organizations. Get 200+ algorithmic coding problems, premium lecture videos, subject-wise theoretical content, lifetime access, and much more. Here you’ll get prepared for each and every subject & skill relevant to the interview whether it be core CS subjects, programming language, reasoning & aptitude, resume building, etc.
Live Courses
Get best-in-industry real-time GFG Live Courses to upskill yourself and get into your dream company. You can attend these live classes from any geographical location and here you can ask your doubts to the instructor just like an offline classroom program. Do check out these worthwhile Live Courses by GeeksforGeeks – DSA Live for Working Professionals, System Design Live, Competitive Programming Live, and more!
Language Foundation Courses[C++ / JAVA / Python ]
Learn any programming language from scratch and understand all its fundamental concepts for a strong programming foundation in the easiest possible manner with help of GeeksforGeeks Language Foundation Courses – Java Foundation | Python Foundation | C++ Foundation. These courses have been designed for absolute beginners who wish to kickstart and build their foundations of programming.