PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Amazon

Print all odd numbers from an integer list

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency with array/list manipulation, parity checking, and handling edge cases such as negative values and integers outside 32-bit ranges.

  • easy
  • Amazon
  • Coding & Algorithms
  • Software Engineer

Print all odd numbers from an integer list

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Technical Screen

## Problem Given a list/array of integers `nums`, **print (or return) every odd number** in the list, in the **same order** they appear. ### Clarifications / follow-ups 1. **Negative integers may appear.** Negative odd numbers (e.g., `-3`) should be treated as odd and included. 2. **Integers may exceed 32-bit range.** Your approach should still work even if values do not fit in a 32-bit signed integer. ### Input - `nums`: a list of integers. ### Output - Either print each odd number (one per line) or return a list of odd numbers (state your choice). ### Constraints - Assume `nums` can be large, so the solution should be linear in the length of the list.

Quick Answer: This question evaluates proficiency with array/list manipulation, parity checking, and handling edge cases such as negative values and integers outside 32-bit ranges.

Related Interview Questions

  • Implement Datacenter Router Commands - Amazon (hard)
  • Implement Event Filtering and Queue Routing - Amazon (medium)
  • Determine if all courses can be completed - Amazon (medium)
  • Replace Delimited Tokens in a String - Amazon (medium)
  • Minimize Circular Redistribution Cost - Amazon (medium)
Amazon logo
Amazon
Jan 22, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
5
0
Loading...

Problem

Given a list/array of integers nums, print (or return) every odd number in the list, in the same order they appear.

Clarifications / follow-ups

  1. Negative integers may appear. Negative odd numbers (e.g., -3 ) should be treated as odd and included.
  2. Integers may exceed 32-bit range. Your approach should still work even if values do not fit in a 32-bit signed integer.

Input

  • nums : a list of integers.

Output

  • Either print each odd number (one per line) or return a list of odd numbers (state your choice).

Constraints

  • Assume nums can be large, so the solution should be linear in the length of the list.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Amazon•More Software Engineer•Amazon Software Engineer•Amazon Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.