Forum Moderators: open
In general, the first style, using a subdomain for "cat", creates independent websites from the search engine perspective. The second, using a directory, is seen as all one big site.
If there is significant cross-linking between the sections I would prefer using the second. If the sections are relatively separate and also each contain significant content, I would consider the subdomain approach if there aren't already a lot of indexed pages with a directory/subdirectory.
In this specific case, because you end each url with "id", I'm assuming you are configuring a url rewrite engine of some kind. If so, I would suggest taking care not to create a large number of subdomains (approach #1) that have but a few pages each -- or that are created with a keyword "wild card" approach. At one time this was a frequently used tactic to flood the search results, and search engines pretty much zapped it.