JobsJob TrackerJob alerts

Veritas ยท 109 questions

All 109Coding 69System Design 2Low-Level Design 4Behavioral 4
  • Josephus problem in circular linked listsCoding
  • Date format conversion and disjoint subgraph weightsCoding
  • Pointers, linked list operations, tree traversals, and Java OOPCoding
  • Compiler design flow for method overloading and OOP polymorphismLow-Level Design
  • Delete nodes greater than K from linked listCoding
  • Implement Insertion SortCoding
  • Reverse words in a sentence without extra spaceCoding
  • Count set bits and return positions in arrayCoding
  • DSA, strings, and arrays questionsCoding
โ† Veritas questions
  1. Interview questions
  2. Veritas
  3. Count set bits and return positions in array
CodingReported in a candidate post, Aug 2017

Count set bits and return positions in array

Filed under Veritas

The question

Given a decimal number, count the number of set bits (1s) in its binary representation and return an array where the first element is the count and the remaining elements are the positions of the set bits from MSB to LSB.

No write-up yet. Related questions below have one.

Related Veritas questions

  • Middle of Linked List
  • Reverse an array without extra space
  • Rolling string
  • Doubly Linked List and Singly Linked List Operations
  • Delete a node given only a pointer to that node
โ† Reverse words in a sentence without extra spaceDSA, strings, and arrays questions โ†’

Collected from public candidate posts and coding forums. Updated Nov 2026.