Target 2024 Papers
Previous year papers with coding questions
Practice Target placement paper coding questions with detailed solutions. Access Target OA coding problems in Java, Python.
This page contains Target coding questions from Target OA placement papers with detailed solutions.
Target OA Coding Section:
Solution (Java):
class InventoryManager { Map<String, Integer> inventory = new HashMap<>();
public void addStock(String productId, int quantity) { inventory.put(productId, inventory.getOrDefault(productId, 0) + quantity); }
public boolean sellProduct(String productId, int quantity) { int currentStock = inventory.getOrDefault(productId, 0); if (currentStock >= quantity) { inventory.put(productId, currentStock - quantity); return true; } return false; }
public int getStock(String productId) { return inventory.getOrDefault(productId, 0); }}Time Complexity: O(1) for all operations
Target 2024 Papers
Previous year papers with coding questions
Target Main Page
Complete Target placement guide
Practice Target coding questions regularly!