0% found this document useful (0 votes)
38 views3 pages

Bullet Program Questions Sheet

The document outlines various data structures and algorithms, including trees, tries, segment trees, and bit manipulation, along with their respective resources and references. It also lists problem titles, their difficulty levels, types, and notes on specific algorithmic challenges related to these data structures. Additionally, it includes queries and tasks that involve manipulating and analyzing data structures in programming contexts.

Uploaded by

aditya5yoyo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views3 pages

Bullet Program Questions Sheet

The document outlines various data structures and algorithms, including trees, tries, segment trees, and bit manipulation, along with their respective resources and references. It also lists problem titles, their difficulty levels, types, and notes on specific algorithmic challenges related to these data structures. Additionally, it includes queries and tasks that involve manipulating and analyzing data structures in programming contexts.

Uploaded by

aditya5yoyo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Question No Topic Reference 1 Reference 2 Video Reference Video Reference 2

https://www.wscubetech. https://www.youtube.com/watch? https://www.youtube.com/watch?


Tree, Types of Tree - AVL, Red com/resources/dsa/tree-data- Everything you need to know about v=jDM6_TnYIqE&list=PLDN4rrl48XKpZkf03i v=aZjYr87r1b8&list=PLDN4rrl48XKpZkf03iY
2 Black, B, B+ structure tree data structures YFl-O29szjTrs_O&index=76&pp=iAQB Fl-O29szjTrs_O&index=77&pp=iAQB
https://www.interviewcake. https://www.youtube.com/watch?
2 Tries com/concept/java/trie https://brilliant.org/wiki/tries/ v=oobqoCJlHA0
https://www.hackerearth.
com/practice/data- https://cp-algorithms.
structures/advanced-data- com/data_structures/segment_tree. https://www.youtube.com/watch?
structures/segment-trees/tutorial/ html v=ciHThtTVNto
https://www.wscubetech.
2 Segment Tree com/resources/dsa/segment-tree https://visualgo.net/en/segmenttree
https://www.topcoder.
https://codeforces. com/thrive/articles/Binary% https://www.youtube.com/watch?
com/blog/entry/57292?locale=ru 20Indexed%20Trees v=uSFzHCZ4E-8
https://medium.com/carpanese/a-
visual-introduction-to-fenwick-tree-
https://brilliant.org/wiki/fenwick-tree/ 89b82cac5b3c
https://cp-algorithms.
Fenwick Tree com/data_structures/fenwick.html https://visualgo.net/en/fenwicktree
https://nan-archive.vercel.app/sliding-
Sliding Window window
https://www.hackerearth.
com/practice/basic-programming/bit-
manipulation/basics-of-bit- https://www.geeksforgeeks.
manipulation/tutorial/ org/dsa/all-about-bit-manipulation/
https://medium.
com/@hanxuyang0826/mastering-bit-
Bit Manipulation
manipulation-key-concepts-and-
https://cp-algorithms. practice-leetcode-problems-
com/algebra/bit-manipulation.html c0c328cdf164
https://dev.to/anurag629/the-power-
of-bit-manipulation-how-to-solve- https://www.codechef.
problems-efficiently-3p1h com/learn/course/bit-manipulation

https://docs.google.
com/document/d/1gWPhVxxQhRqnN
DaRFGIvbh3Q2TyIyckx76wM58BhS https://github.com/priyanshu-
RESOURCES: co/edit?usp=sharing arya/GU_Training
Batch 1 Batch 2 Problem Title Difficulty Problem Type Efficiency Notes
Given an array of integers and queries.

Type 1 Query: Update elements in range [l, r] to (i-l+1)*A[i].


Data Structures, Range Queries (Segment Tree/Fenwick
Discussed Icebox Query-Based Array Transformations Easy Type 2 Query: Calculate sum of elements in range [l, r].
Tree)
Compute the sum of answers to all Type 2 queries modulo
10^9+7

Tree + Recursion + DFS (A common HackWithInfy question Convert a binary tree to a string and then back to a tree structure.
Do it on your Own Do it on your Own 297. Serialize and Deserialize Binary TreeMedium
prompting depth-first traversal logic across rounds) Must handle edge cases like null children.
Lowest Common Ancestor (LCA) in Given two nodes in a binary tree, find their LCA without assuming
Do it on your Own Do it on your Own Medium Tree + Recursion + DFS (Frequently seen in HWI practice sets and outlined in their sample PDF)
Binary Tree BST structure.
Find the max sum of any non-empty path (which need not pass
Do it on your Own Do it on your Own Maximum Path Sum in Binary Tree Hard Tree + DFS + DP
through the root).
Tree + Euler Tour + Subtree Intersection
In a graph of two rooted trees, "beauty" of a node is the size of the
Do it on your Own Do it on your Own Beauty of Node in Dual-Rooted Trees Hard (Matches complex HackWithInfy graph/tree hybrid
intersection of its subtrees. Compute beauty for all nodes.
problems.)
Discussed Icebox Implement Trie (LeetCode #208) Medium Trie Support insert, search, startsWith operations on lowercase words.
Design Add & Search Words Data Build a word dictionary supporting wildcard character . matching
Do it on your Own Do it on your Own Medium Trie + Backtracking
Structure any single letter.
Word Break with Dictionary (Trie- Given a string and a word list, determine if it can be segmented. Use
Do it on your Own Do it on your Own Medium Trie + DP
Accelerated) a trie to optimize lookup.
Given a large document and a stop-word list, find the most frequent
Trie + HashMap
Do it on your Own Do it on your Own Most Frequent Word in Dictionary Hard non-stop word using trie for word tracking.

Find the maximum sum of a contiguous subarray where distinct


Max Sum of Good Subarray (≤ k elements ≤ k.
Do it on your Own Do it on your Own Easy Sliding Window, HashMap
distinct elements)
Empty subarray (sum = 0) is allowed.
Simulate oil transactions (buy/sell) with tank capacity C.
Discussed Discussed Oil Tank Disturbance Minimization Easy Greedy, Prefix Sum
Find the minimum initial oil X to minimize disturbances (failed
buys/sells).
Reduce N soldiers to 1 using minimal moves:

Subtract 1.
Reduce Army to One with Min
Icebox Icebox Easy Greedy / Dynamic Programming
Operations
Subtract half (floor division).

Subtract two-thirds (floor division).


Grid with A (invaded), E (enemy), * (blocked).

Icebox Icebox Invasion Spread on a Grid Easy BFS / Matrix Traversal At each second, E adjacent to A becomes A.

Find minimal time to convert all E to A (return -1 if impossible).


Partition an array into contiguous subarrays.

Divide Employees to Maximize Expert Expert value of a subarray = smallest non-negative integer not
Icebox Icebox Medium Greedy / HashSet / Sliding Window
Number present.

Maximize the sum of expert values over all subarrays.


Graph starts disconnected.

Queries:

Graph Queries - Connected Type 1: Add edge (i, j).


Icebox Icebox Medium Union-Find (DSU), Range Compression
Components + Range Count
Type 2: Find "beauty" (minimal covered ranges) of the connected
component of node u.

Sum answers to all Type 2 queries.


N chairs in a circle. From chair i, jump A[i] chairs left/right.
Icebox Discussed Minimum Jumps in Circular Array Medium Graph (BFS on circular structure)
Find minimal jumps from chair X to Y (return -1 if impossible).
Construct a chain of N balls (blue/red) with constraints:

At any step: blue_count ≤ red_count + K.

Icebox Icebox Probability of Good & Great Chains Medium Combinatorics, Probability, Modular Arithmetic Reversed chain must swap colors.

Compute probability of forming a "great" chain modulo


10^9+7

Partition an array into subarrays (length ≥ K).

Icebox Icebox Max Amazingness of Partitioned Array Medium Bit Manipulation, DP / Divide & Conquer Beauty of a subarray = max XOR of any subset.

Maximize the sum of beauties ("amazingness").


Construct a directed graph from permutation p:
Minimum k for Longest Path in
Icebox Icebox Hard Binary Search + Graph Path Analysis Edge i → j if p[i] < p[j] and |i-j| ≤ k.
Permutation Graph
Find minimal k such that the longest path length ≥ m.
For each soldier i, find the first soldier j > i where power[j] is a
multiple of power[i].
Icebox Icebox Game XP from Multiples + Range Max Hard Stack / Segment Tree / Range Query
Maximize bonus in [i, j] and sum over all soldiers.
Count pairs (i, j) (i < j) satisfying:
Counting Pairs with Frequency & frequency(1, i, A[i]) + frequency(j, N, A[j]) ≤ ⌊distinct(1, i)/2⌋ +
Icebox Icebox Hard Prefix Sums, Mo’s Algorithm (Advanced Range Queries)
Distinct Conditions ⌊distinct(j, N)/2⌋.
answers modulo 10^9+7
Given a tree, two roots A/B, and online queries (U, V).

"Beauty" of (U, V) = size of intersection of:

Subtree of U rooted at A.
Icebox Icebox Beauty of Node in Dual Rooted Trees Hard Tree Traversal, Euler Tour, Subtree Intersection
Subtree of V rooted at B.

Queries dynamically update U/V using the previous answer.


Sum answers to all queries modulo
10^9+7

Given a graph of cities with roads (weighted edges), and each city
Icebox Icebox Max Funds (Graph + Greedy) Hard Graph + Greedy + Shortest/Max Path gives a certain fund, maximize funds collected from a source to
destination while keeping the total cost ≤ budget.
Description: Given integers N, X, and D, count all pairs (A, B) where 1
≤ A, B ≤ N such that:

Icebox Icebox Count Valid XOR Pairs Hard Combinatorics + Bitwise + Modular Arithmetic A ^ B ≤ X,

(A + B) % D == 0.
Return result modulo 10⁹+7.
Guests have happiness values C[i]; serving them at minute x yields
unhappiness |C[i] – x|. Rearrange serving order to minimize total
Icebox Icebox Minimize Unhappiness of Guests Hard Greedy + Sorting + Absolute Difference Minimization
unhappiness.

You are given an array of values from 1 to M. Form maximum


number of non-overlapping triplets where:

Icebox Icebox Triplet Matching in an Array Hard Greedy + Frequency HashMap All 3 are equal (like [3, 3, 3]) or

Consecutive (like [5, 6, 7]).

Split an array into 4 contiguous, non-empty parts by choosing 3 cut-


Prefix Sum + Dynamic Programming + Two Pointers
Icebox Icebox Four-Segment Partition Minimization Hard points. You must minimize the difference between max and min
segment sums.
You have an initial energy E and N exercises with drain values A[i].
Icebox Icebox Gym Energy Exhaustion Hard Greedy + Sorting + Knapsack-like Decision You can repeat each at most twice. Determine the minimum
number of exercises to bring your energy to 0 or below.
You’re given a rooted tree with values on each node. Find a way to
Icebox Icebox Tree XOR Sum Maximization Hard DFS + Bitwise XOR + DP on Trees select a subtree (or set of disjoint subtrees) to maximize XOR of all
selected node values.
Union-Find (DSU) + Range Analysis Initially, you have a disconnected graph. You keep adding edges
and answering:
Icebox Icebox Connected Components Coverage Hard (Same type as HackWithInfy Graph-Ranges problem)
“What is the minimum number of covered ranges (intervals) needed
to represent all nodes in the connected component of node u?”
Batch 1 Batch 2 Problem Title Difficulty Problem Type Efficiency Notes
Probability + Combinatorics + Reversible Constraints
Given probability weights of picking red/blue balls and a K-
Great Chain of Balls (Reversible (Directly aligns with HWInfy 2023 round 2)
Icebox Icebox Hard constraint on their placement, compute probability of forming a
Sequence Constraints)
good+great chain.

Partition an array into multiple subarrays of size ≥ K, and compute


max possible XOR-sum over all partitions. Choose the best
Icebox Icebox Partition Array for Max XOR Sum Hard Dynamic Programming + Bitwise + Greedy
partitioning.

3. Longest Substring Without Repeating Characters

You might also like