Coding practice
Coding problems candidates reported from company coding rounds (memory-based), written up with our own examples and hints. A live code editor with test cases is coming soon.
- Second largest number Easy · Arrays · Infosys (2022–25), Accenture, Cognizant GenC, LTIMindtree
- Rotate an array Easy · Arrays · Infosys (2021–25), Accenture
- Find the missing number Easy · Arrays · Infosys (2021–26), Wipro Elite NTH, Accenture, Cognizant GenC, Deloitte (2025)
- Move zeros to the end Easy · Arrays · HCLTech, Deloitte
- Even numbers first Easy · Arrays · Wipro Elite NTH
- Count the record-breakers Easy · Arrays · TCS NQT (Sep 2023)
- Peak guests on board Easy · Arrays · TCS NQT (Sep 2023)
- First colour with an odd count Easy · Arrays · TCS NQT (Sep 2023)
- Row with the most 1s Easy · Arrays · TCS NQT (Sep 2023)
- Maximum subarray sum Medium · Arrays · Infosys (SP / DSE), Cognizant GenC
- Greatest element on the right Easy · Arrays · Cognizant GenC (GenC Next)
- Middle equals the sum of its neighbours Easy · Arrays · Cognizant GenC
- Merge two sorted arrays Easy · Sorting and searching · LTIMindtree (2025), Cognizant GenC
- Subarrays with sum K Medium · Arrays · HCLTech
- Subarrays with an odd sum Medium · Arrays · Deloitte
- Count values close to a number Easy · Arrays · Accenture (Aug 2022), Deloitte
- Longest decreasing run Easy · Arrays · Capgemini (2026 batch)
- Best sum of pair minimums Easy · Sorting and searching · Capgemini (2026 batch)
- Sum of both diagonals Easy · Arrays · Infosys (2022–24), Wipro Elite NTH
- Houses needed to feed the rats Easy · Arrays · Accenture (Aug 2022)
- Odd count minus even count Easy · Arrays · Tech Mahindra (2024)
- Pen switches Easy · Arrays · Cognizant GenC
- Longest increasing subsequence Medium · Dynamic programming · Infosys (DSE / SP, 2021–26)
- Fewest coins Hard · Dynamic programming · Infosys (DSE / SP, 2021–26)
- Palindrome check Easy · Strings · Infosys (2021–26), Accenture, Cognizant GenC, Deloitte (Feb 2026), LTIMindtree
- Count vowels Easy · Strings · Infosys (2021–23), Accenture, Cognizant GenC
- Character frequency Easy · Strings
- Reverse the words Easy · Strings · Wipro Elite NTH, Accenture, HCLTech
- First non-repeating character Easy · Strings · Wipro Elite NTH, Infosys (2021–25), Accenture
- Anagram check Easy · Strings · Infosys (2021–25), Accenture
- Balanced brackets Medium · Strings · Infosys (2021–26), HCLTech
- Longest substring without repeats Medium · Strings · Infosys (DSE / SP, 2021–26), Tech Mahindra, LTIMindtree
- Typing with backspace Easy · Strings · TCS NQT
- Pangram check Easy · Strings · TCS NQT
- Longest sentence Easy · Strings · TCS NQT
- Shift cipher for letters and digits Easy · Strings · TCS NQT
- Stars versus hashes Easy · Strings · TCS NQT (Sep 2023)
- Password checker Easy · Strings · Accenture (Aug 2022; 2025–26)
- Evaluate a binary operation string Easy · Strings · Accenture (Aug 2022)
- Move hyphens to the front Easy · Strings · Accenture (Aug 2021)
- Count non-repeated characters Easy · Strings · Tech Mahindra (2024)
- Longest balanced binary substring Medium · Strings · Capgemini (2026 batch)
- Prime string check Easy · Strings · Capgemini (2026 batch)
- Compress repeated letters Easy · Strings · Capgemini
- Reverse a string Easy · Strings · Tech Mahindra, LTIMindtree, Cognizant GenC
- Longest common subsequence Medium · Dynamic programming · LTIMindtree
- Primes in a range Easy · Maths · LTIMindtree, Tech Mahindra
- Two-wheelers and four-wheelers Easy · Maths · TCS NQT (Sep 2023)
- Armstrong number Easy · Maths · HCLTech, Accenture
- Power of two Easy · Maths · Infosys (2022–25)
- Difference of sums Easy · Maths · Accenture (Aug 2022), Deloitte
- Count the carries Easy · Maths · Accenture (Aug 2021)
- Decimal to base B Easy · Maths · Accenture (Aug 2022)
- Toggle the bits Easy · Bits · Deloitte
- Numbers with K set bits Medium · Bits · Deloitte
- Set bits and their positions Easy · Bits · Tech Mahindra (2024)
- Remove one digit to get the largest number Easy · Strings · Infosys (DSE / SP, 2023–26)
- Buzz number Easy · Maths · Cognizant GenC