Amazon may have a run for its money with big-box retail chains Walmart and Target, investor and author Kevin O'Leary told CNBC.

"If you look at behemoth big boxes that are going to survive the next decade against Amazon, I would put Walmart in that basket, along with Target," O'Leary said Tuesday on "Closing Bell." "Because if you look at what they’re doing and the kind of people they’re hiring on their teams and the efforts and the logistics they’re putting in place, they look like survivors to me."

His comments come on the heels of Walmart's announcement Tuesday that its subsidiary Jet.com will open a fulfillment center in the Bronx, as Walmart tests same-day grocery delivery in New York.

Walmart is investing heavily in its grocery business, something O'Leary said "everybody expects them to do" in order to compete with e-commerce giant Amazon.

In March, Walmart said it would expand its online grocery delivery service to around 800 stores by the end of the year.

"Making moves like this with distribution centers that can provide hourly delivery and large metropolitan areas, that’s part of the game plan," O'Leary said on Tuesday.