Skip to content
javabypankaj
HomeLibraryPopularCommunity
17
Coding Problems: DSA
19 topics · 492 questions
1Beginner: I/O, Arithmetic, Loops0/30302Arrays0/1091093Strings0/61614Linked List0/24245Stack & Queue0/20206HashMap & HashSet Problems0/17177Two Pointers0/10108Sliding Window0/779Binary Search0/141410Sorting & Searching0/222211Recursion & Backtracking0/232312Dynamic Programming0/313113Trees & BST0/252514Graphs0/232315Greedy0/121216Math & Bit Manipulation0/617Matrix0/4418Pattern Printing0/2219Miscellaneous Coding0/5252
1Beginner: I/O, Arithmetic, Loops302Arrays1093Strings614Linked List245Stack & Queue206HashMap & HashSet Problems177Two Pointers108Sliding Window79Binary Search1410Sorting & Searching2211Recursion & Backtracking2312Dynamic Programming3113Trees & BST2514Graphs2315Greedy1216Math & Bit Manipulation617Matrix418Pattern Printing219Miscellaneous Coding52
19 topics492 Qs0%
01Core Java17002OOP3203Collections6704Exception Handling2805Concurrency & Multithreading12706Java Streams, Lambda & Functional Programming32807Spring & Spring Boot2608Transactions3209JPA & Hibernate6910Microservices19411Kafka & Messaging9112DevOps, CI/CD & Tooling13313Database & SQL14114REST API & Web4015Design Patterns & LLD5716Advanced Java7117Coding Problems: DSA49218AWS & Cloud4119Data Engineering19420QA, Testing & SDET4121System Design3522Security2023Behavioral / HR: STAR Method37
19Topics
492Questions
0%Complete
16 of 19 topics
Topics
1Beginner: I/O, Arithmetic, Loops0/30302Arrays0/1091093Strings0/61614Linked List0/24245Stack & Queue0/20206HashMap & HashSet Problems0/17177Two Pointers0/10108Sliding Window0/779Binary Search0/141410Sorting & Searching0/222211Recursion & Backtracking0/232312Dynamic Programming0/313113Trees & BST0/252514Graphs0/232315Greedy0/1212
16Math & Bit Manipulation0/66
17Matrix0/4418Pattern Printing0/2219Miscellaneous Coding0/5252

Math & Bit Manipulation

Coding Problems: DSA·Topic 16 of 19·6 questions
Q1Find the GCD of Two Numbers Using the Euclidean Algorithm

Keep replacing the pair with the smaller number and the remainder until the remainder is zero; the last non-zero number is the GCD.

Read Answer
Q2Find the Missing Number in 1..N

Expected sum minus actual sum gives the missing number, or XOR everything so present numbers cancel and only the missing one remains.

Read Answer
Q3Find the Missing Number (One Number Missing from 0..n)

Place each value v at index v, then the first index where index != value is the missing number.

Read Answer
Q4Find all Missing Numbers (Numbers Missing from 1..n)

Place v at index v-1; every slot where value != index+1 is a missing number.

Read Answer
Q5Complement of Base 10 Number (Flip Every Bit Within the Number's Width)

Make an all-ones mask as wide as the number, then XOR to flip only the bits the number uses.

Read Answer
Q6Flip and Invert an Image (Flip Each Row Horizontally Then Invert with XOR)

XOR with one inverts a bit, so reverse each row from both ends while XOR-ing each value with one in a single pass.

Read Answer
Previous · Topic 15Greedy12 questionsNext · Topic 17Matrix4 questions
javabypankaj© 2026 javabypankaj
PrivacyTerms
HomeSearchLibrary