Count Subarrays Whose Product Has an Odd Number of Divisors
Asked at Microsoft · Coding Questions · Difficulty: Hard · Last asked Nov 4, 2026
You are given an array of positive integers. For any contiguous subarray, multiply its elements together and count the positive divisors of the product. A subarray is called special when that count is odd. Count how many subarrays are special.
Loading the problem…
More Microsoft interview questions
- LLM conceptual questions
- Roofline Analysis and Mixed-Precision Gradients for Matmul
- Tiny Next-Token Prediction Model (PyTorch Fill-In)
- Design Search Autocomplete / Typeahead
- Design a Chatbot Personalization / Memory System
- Design a Job Scheduler / ETL Pipeline