<?xml version="1.0" encoding="utf-8"?>
<!--Generated by DFIN XBRL Instance Document - http://www.dfinsolutions.com/ - Version R3.0 - on 27-April-2019 [01:03:11] {AM}-->
<schema targetNamespace="http://www.trex.com/20190331" elementFormDefault="qualified" xmlns:trex="http://www.trex.com/20190331" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" xmlns:xl="http://www.xbrl.org/2003/XLink" xmlns:us-gaap="http://fasb.org/us-gaap/2018-01-31" xmlns:country="http://xbrl.sec.gov/country/2017-01-31" xmlns:currency="http://xbrl.sec.gov/currency/2017-01-31" xmlns:dei="http://xbrl.sec.gov/dei/2018-01-31" xmlns:exch="http://xbrl.sec.gov/exch/2018-01-31" xmlns:invest="http://xbrl.sec.gov/invest/2013-01-31" xmlns:naics="http://xbrl.sec.gov/naics/2017-01-31" xmlns:sic="http://xbrl.sec.gov/sic/2011-01-31" xmlns:us-types="http://fasb.org/us-types/2018-01-31" xmlns:stpr="http://xbrl.sec.gov/stpr/2018-01-31" xmlns:deprecated="http://www.xbrl.org/2009/arcrole/fact-explanatoryFact" xmlns:nonnum="http://www.xbrl.org/dtr/type/non-numeric" xmlns:num="http://www.xbrl.org/dtr/type/numeric" xmlns:srt="http://fasb.org/srt/2018-01-31">
<annotation>
<appinfo>
<link:roleType roleURI="http://www.trex.com/role/DocumentAndEntityInformation" id="DocumentAndEntityInformation">
<link:definition>1001 - Document - Document and Entity Information</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/ConsolidatedStatementsOfComprehensiveIncome" id="ConsolidatedStatementsOfComprehensiveIncome">
<link:definition>1002 - Statement - Consolidated Statements of Comprehensive Income</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/ConsolidatedBalanceSheets" id="ConsolidatedBalanceSheets">
<link:definition>1003 - Statement - Consolidated Balance Sheets</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/ConsolidatedBalanceSheetsParenthetical" id="ConsolidatedBalanceSheetsParenthetical">
<link:definition>1004 - Statement - Consolidated Balance Sheets (Parenthetical)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StatementsOfChangesInStockholdersEquity" id="StatementsOfChangesInStockholdersEquity">
<link:definition>1005 - Statement - Statements of Changes in Stockholders' Equity</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/ConsolidatedStatementsOfCashFlows" id="ConsolidatedStatementsOfCashFlows">
<link:definition>1006 - Statement - Consolidated Statements of Cash Flows</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/BusinessAndOrganization" id="BusinessAndOrganization">
<link:definition>1007 - Disclosure - Business and Organization</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/BasisOfPresentation" id="BasisOfPresentation">
<link:definition>1008 - Disclosure - Basis of Presentation</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/RecentlyAdoptedAccountingStandards" id="RecentlyAdoptedAccountingStandards">
<link:definition>1009 - Disclosure - Recently Adopted Accounting Standards</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/NewAccountingStandardsNotYetAdopted" id="NewAccountingStandardsNotYetAdopted">
<link:definition>1010 - Disclosure - New Accounting Standards Not Yet Adopted</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/Inventories" id="Inventories">
<link:definition>1011 - Disclosure - Inventories</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/PrepaidExpensesAndOtherAssets" id="PrepaidExpensesAndOtherAssets">
<link:definition>1012 - Disclosure - Prepaid Expenses and Other Assets</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/GoodwillAndOtherIntangibleAssets" id="GoodwillAndOtherIntangibleAssets">
<link:definition>1013 - Disclosure - Goodwill and Other Intangible Assets</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/AccruedExpensesAndOtherLiabilities" id="AccruedExpensesAndOtherLiabilities">
<link:definition>1014 - Disclosure - Accrued Expenses and Other Liabilities</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/Debt" id="Debt">
<link:definition>1015 - Disclosure - Debt</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/Leases" id="Leases">
<link:definition>1016 - Disclosure - Leases</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/FinancialInstruments" id="FinancialInstruments">
<link:definition>1017 - Disclosure - Financial Instruments</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StockholdersEquity" id="StockholdersEquity">
<link:definition>1018 - Disclosure - Stockholders' Equity</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/RevenueFromContractsWithCustomers" id="RevenueFromContractsWithCustomers">
<link:definition>1019 - Disclosure - Revenue From Contracts With Customers</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StockBasedCompensation" id="StockBasedCompensation">
<link:definition>1020 - Disclosure - Stock-Based Compensation</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/IncomeTaxes" id="IncomeTaxes">
<link:definition>1021 - Disclosure - Income Taxes</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/SegmentInformation" id="SegmentInformation">
<link:definition>1022 - Disclosure - Segment Information</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/Seasonality" id="Seasonality">
<link:definition>1023 - Disclosure - Seasonality</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/CommitmentsAndContingencies" id="CommitmentsAndContingencies">
<link:definition>1024 - Disclosure - Commitments and Contingencies</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StockBasedCompensationPolicies" id="StockBasedCompensationPolicies">
<link:definition>1025 - Disclosure - Stock-Based Compensation (Policies)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/InventoriesTables" id="InventoriesTables">
<link:definition>1026 - Disclosure - Inventories (Tables)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/PrepaidExpensesAndOtherAssetsTables" id="PrepaidExpensesAndOtherAssetsTables">
<link:definition>1027 - Disclosure - Prepaid Expenses and Other Assets (Tables)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/GoodwillAndOtherIntangibleAssetsTables" id="GoodwillAndOtherIntangibleAssetsTables">
<link:definition>1028 - Disclosure - Goodwill and Other Intangible Assets (Tables)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/AccruedExpensesAndOtherLiabilitiesTables" id="AccruedExpensesAndOtherLiabilitiesTables">
<link:definition>1029 - Disclosure - Accrued Expenses and Other Liabilities (Tables)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/LeasesTables" id="LeasesTables">
<link:definition>1030 - Disclosure - Leases (Tables)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StockholdersEquityTables" id="StockholdersEquityTables">
<link:definition>1031 - Disclosure - Stockholders' Equity (Tables)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/RevenueFromContractsWithCustomersTables" id="RevenueFromContractsWithCustomersTables">
<link:definition>1032 - Disclosure - Revenue From Contracts With Customers (Tables)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StockBasedCompensationTables" id="StockBasedCompensationTables">
<link:definition>1033 - Disclosure - Stock-Based Compensation (Tables)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/SegmentInformationTables" id="SegmentInformationTables">
<link:definition>1034 - Disclosure - Segment Information (Tables)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/CommitmentsAndContingenciesTables" id="CommitmentsAndContingenciesTables">
<link:definition>1035 - Disclosure - Commitments and Contingencies (Tables)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/BusinessAndOrganizationAdditionalInformationDetail" id="BusinessAndOrganizationAdditionalInformationDetail">
<link:definition>1036 - Disclosure - Business and Organization - Additional Information (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/RecentlyAdoptedAccountingStandardsAdditionalInformationDetail" id="RecentlyAdoptedAccountingStandardsAdditionalInformationDetail">
<link:definition>1037 - Disclosure - Recently Adopted Accounting Standards - Additional Information (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/InventoriesSummaryOfInventoriesDetail" id="InventoriesSummaryOfInventoriesDetail">
<link:definition>1038 - Disclosure - Inventories - Summary of Inventories (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/InventoriesAdditionalInformationDetail" id="InventoriesAdditionalInformationDetail">
<link:definition>1039 - Disclosure - Inventories - Additional Information (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/PrepaidExpensesAndOtherAssetsSummaryOfPrepaidExpensesAndOtherAssetsDetail" id="PrepaidExpensesAndOtherAssetsSummaryOfPrepaidExpensesAndOtherAssetsDetail">
<link:definition>1040 - Disclosure - Prepaid Expenses and Other Assets - Summary of Prepaid Expenses and Other Assets (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/GoodwillAndOtherIntangibleAssetsAdditionalInformationDetail" id="GoodwillAndOtherIntangibleAssetsAdditionalInformationDetail">
<link:definition>1041 - Disclosure - Goodwill and Other Intangible Assets - Additional Information (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/GoodwillAndOtherIntangibleAssetsDetailsOfIntangibleAssetsDetail" id="GoodwillAndOtherIntangibleAssetsDetailsOfIntangibleAssetsDetail">
<link:definition>1042 - Disclosure - Goodwill and Other Intangible Assets - Details of Intangible Assets (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/AccruedExpensesAndOtherLiabilitiesSummaryOfAccruedExpensesAndOtherLiabilitiesDetail" id="AccruedExpensesAndOtherLiabilitiesSummaryOfAccruedExpensesAndOtherLiabilitiesDetail">
<link:definition>1043 - Disclosure - Accrued Expenses and Other Liabilities - Summary of Accrued Expenses and Other Liabilities (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/DebtAdditionalInformationDetail" id="DebtAdditionalInformationDetail">
<link:definition>1044 - Disclosure - Debt - Additional Information (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/LeasesSupplementalCashFlowInformationToOperatingLeasesDetails" id="LeasesSupplementalCashFlowInformationToOperatingLeasesDetails">
<link:definition>1045 - Disclosure - Leases - Supplemental Cash flow Information to operating leases (Details)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/LeasesMaturitiesOfOperatingLeaseLiabilitiesDetails" id="LeasesMaturitiesOfOperatingLeaseLiabilitiesDetails">
<link:definition>1046 - Disclosure - Leases - Maturities of Operating Lease Liabilities (Details)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/LeasesAdditionalInformationDetail" id="LeasesAdditionalInformationDetail">
<link:definition>1047 - Disclosure - Leases - Additional Information (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StockholdersEquityAdditionalInformationDetail" id="StockholdersEquityAdditionalInformationDetail">
<link:definition>1048 - Disclosure - Stockholders' Equity - Additional Information (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StockholdersEquityComputationOfBasicAndDilutedEarningsPerShareDetail" id="StockholdersEquityComputationOfBasicAndDilutedEarningsPerShareDetail">
<link:definition>1049 - Disclosure - Stockholders' Equity - Computation of Basic and Diluted Earnings Per Share (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StockholdersEquityAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareDetail" id="StockholdersEquityAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareDetail">
<link:definition>1050 - Disclosure - Stockholders' Equity - Antidilutive Securities Excluded from Computation of Earnings Per Share (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/RevenueFromContractsWithCustomersAdditionalInformationDetail" id="RevenueFromContractsWithCustomersAdditionalInformationDetail">
<link:definition>1051 - Disclosure - Revenue From Contracts With Customers - Additional Information (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/RevenueFromContractsWithCustomersSummaryOfDisaggregatedNetSalesDetail" id="RevenueFromContractsWithCustomersSummaryOfDisaggregatedNetSalesDetail">
<link:definition>1052 - Disclosure - Revenue From Contracts With Customers - Summary of Disaggregated Net Sales (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StockBasedCompensationAdditionalInformationDetail" id="StockBasedCompensationAdditionalInformationDetail">
<link:definition>1053 - Disclosure - Stock-Based Compensation - Additional Information (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StockBasedCompensationSummaryOfStockBasedCompensationGrantsDetail" id="StockBasedCompensationSummaryOfStockBasedCompensationGrantsDetail">
<link:definition>1054 - Disclosure - Stock-Based Compensation - Summary of Stock-Based Compensation Grants (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StockBasedCompensationSummaryOfStockBasedCompensationGrantsParentheticalDetail" id="StockBasedCompensationSummaryOfStockBasedCompensationGrantsParentheticalDetail">
<link:definition>1055 - Disclosure - Stock-Based Compensation - Summary of Stock-Based Compensation Grants (Parenthetical) (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StockBasedCompensationSummaryOfAssumptionsUsedToEstimateFairValueOfEachSarDetail" id="StockBasedCompensationSummaryOfAssumptionsUsedToEstimateFairValueOfEachSarDetail">
<link:definition>1056 - Disclosure - Stock-Based Compensation - Summary of Assumptions Used to Estimate Fair Value of Each SAR (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/StockBasedCompensationSummaryOfStockBasedCompensationExpensesDetail" id="StockBasedCompensationSummaryOfStockBasedCompensationExpensesDetail">
<link:definition>1057 - Disclosure - Stock-Based Compensation - Summary of Stock-Based Compensation Expenses (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/IncomeTaxesAdditionalInformationDetail" id="IncomeTaxesAdditionalInformationDetail">
<link:definition>1058 - Disclosure - Income Taxes - Additional Information (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/SegmentInformationAdditionalInformationDetail" id="SegmentInformationAdditionalInformationDetail">
<link:definition>1059 - Disclosure - Segment Information - Additional Information (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/SegmentInformationDetailsOfSegmentInformationDetail" id="SegmentInformationDetailsOfSegmentInformationDetail">
<link:definition>1060 - Disclosure - Segment Information - Details of Segment Information (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/SegmentInformationScheduleOfReconciliationOfNetIncomeToEbitdaDetail" id="SegmentInformationScheduleOfReconciliationOfNetIncomeToEbitdaDetail">
<link:definition>1061 - Disclosure - Segment Information - Schedule of Reconciliation of Net Income to EBITDA (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/CommitmentsAndContingenciesAdditionalInformationDetail" id="CommitmentsAndContingenciesAdditionalInformationDetail">
<link:definition>1062 - Disclosure - Commitments and Contingencies - Additional Information (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:roleType roleURI="http://www.trex.com/role/CommitmentsAndContingenciesSummaryOfReconciliationOfCompanysResidentialProductWarrantyReserveDetail" id="CommitmentsAndContingenciesSummaryOfReconciliationOfCompanysResidentialProductWarrantyReserveDetail">
<link:definition>1063 - Disclosure - Commitments and Contingencies - Summary of Reconciliation of Company's Residential Product Warranty Reserve (Detail)</link:definition>
<link:usedOn>link:presentationLink</link:usedOn>
<link:usedOn>link:definitionLink</link:usedOn>
<link:usedOn>link:calculationLink</link:usedOn>
</link:roleType>
<link:linkbaseRef xlink:type="simple" xlink:href="trex-20190331_pre.xml" xlink:role="http://www.xbrl.org/2003/role/presentationLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" />
<link:linkbaseRef xlink:type="simple" xlink:href="trex-20190331_def.xml" xlink:role="http://www.xbrl.org/2003/role/definitionLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" />
<link:linkbaseRef xlink:type="simple" xlink:href="trex-20190331_lab.xml" xlink:role="http://www.xbrl.org/2003/role/labelLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" />
<link:linkbaseRef xlink:type="simple" xlink:href="trex-20190331_cal.xml" xlink:role="http://www.xbrl.org/2003/role/calculationLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" />
</appinfo>
</annotation>
<import namespace="http://www.xbrl.org/2003/instance" schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd" />
<import namespace="http://www.xbrl.org/2003/linkbase" schemaLocation="http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd" />
<import namespace="http://xbrl.org/2005/xbrldt" schemaLocation="http://www.xbrl.org/2005/xbrldt-2005.xsd" />
<import namespace="http://fasb.org/us-gaap/2018-01-31" schemaLocation="http://xbrl.fasb.org/us-gaap/2018/elts/us-gaap-2018-01-31.xsd" />
<import namespace="http://xbrl.sec.gov/invest/2013-01-31" schemaLocation="http://xbrl.sec.gov/invest/2013/invest-2013-01-31.xsd" />
<import namespace="http://xbrl.sec.gov/country/2017-01-31" schemaLocation="http://xbrl.sec.gov/country/2017/country-2017-01-31.xsd" />
<import namespace="http://xbrl.sec.gov/currency/2017-01-31" schemaLocation="http://xbrl.sec.gov/currency/2017/currency-2017-01-31.xsd" />
<import namespace="http://xbrl.sec.gov/exch/2018-01-31" schemaLocation="https://xbrl.sec.gov/exch/2018/exch-2018-01-31.xsd" />
<import namespace="http://xbrl.sec.gov/naics/2017-01-31" schemaLocation="http://xbrl.sec.gov/naics/2017/naics-2017-01-31.xsd" />
<import namespace="http://xbrl.sec.gov/sic/2011-01-31" schemaLocation="http://xbrl.sec.gov/sic/2011/sic-2011-01-31.xsd" />
<import namespace="http://xbrl.sec.gov/stpr/2018-01-31" schemaLocation="https://xbrl.sec.gov/stpr/2018/stpr-2018-01-31.xsd" />
<import namespace="http://www.xbrl.org/2009/role/negated" schemaLocation="http://www.xbrl.org/lrr/role/negated-2009-12-16.xsd" />
<import namespace="http://www.xbrl.org/2009/role/net" schemaLocation="http://www.xbrl.org/lrr/role/net-2009-12-16.xsd" />
<import namespace="http://www.xbrl.org/2009/arcrole/fact-explanatoryFact" schemaLocation="http://www.xbrl.org/lrr/arcrole/factExplanatory-2009-12-16.xsd" />
<import namespace="http://xbrl.sec.gov/dei/2018-01-31" schemaLocation="https://xbrl.sec.gov/dei/2018/dei-2018-01-31.xsd" />
<import namespace="http://www.xbrl.org/dtr/type/numeric" schemaLocation="http://www.xbrl.org/dtr/type/numeric-2009-12-16.xsd" />
<import namespace="http://www.xbrl.org/dtr/type/non-numeric" schemaLocation="http://www.xbrl.org/dtr/type/nonNumeric-2009-12-16.xsd" />
<import namespace="http://fasb.org/us-types/2018-01-31" schemaLocation="http://xbrl.fasb.org/us-gaap/2018/elts/us-types-2018-01-31.xsd" />
<import namespace="http://fasb.org/srt/2018-01-31" schemaLocation="http://xbrl.fasb.org/srt/2018/elts/srt-2018-01-31.xsd" />
<element name="DocumentAndEntityInformationAbstract" type="xbrli:stringItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_DocumentAndEntityInformationAbstract" substitutionGroup="xbrli:item" />
<element name="AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" type="xbrli:monetaryItemType" abstract="false" xbrli:periodType="instant" nillable="true" id="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" substitutionGroup="xbrli:item" xbrli:balance="credit" />
<element name="PrepaidAndOtherCurrentAssetsDisclosureTextBlock" type="nonnum:textBlockItemType" abstract="false" xbrli:periodType="duration" nillable="true" id="trex_PrepaidAndOtherCurrentAssetsDisclosureTextBlock" substitutionGroup="xbrli:item" />
<element name="SeasonalityDisclosureTextBlock" type="nonnum:textBlockItemType" abstract="false" xbrli:periodType="duration" nillable="true" id="trex_SeasonalityDisclosureTextBlock" substitutionGroup="xbrli:item" />
<element name="PrepaidExpenseAndOtherAssetsCurrentTableTextBlock" type="nonnum:textBlockItemType" abstract="false" xbrli:periodType="duration" nillable="true" id="trex_PrepaidExpenseAndOtherAssetsCurrentTableTextBlock" substitutionGroup="xbrli:item" />
<element name="ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock" type="nonnum:textBlockItemType" abstract="false" xbrli:periodType="duration" nillable="true" id="trex_ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock" substitutionGroup="xbrli:item" />
<element name="SupplementalFinancialInformationOfOperatingLeasesTableTextBlock" type="nonnum:textBlockItemType" abstract="false" xbrli:periodType="duration" nillable="true" id="trex_SupplementalFinancialInformationOfOperatingLeasesTableTextBlock" substitutionGroup="xbrli:item" />
<element name="ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock" type="nonnum:textBlockItemType" abstract="false" xbrli:periodType="duration" nillable="true" id="trex_ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock" substitutionGroup="xbrli:item" />
<element name="CustomerBacklogMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_CustomerBacklogMember" substitutionGroup="xbrli:item" />
<element name="IntangibleLiabilityDisclosureAbstract" type="xbrli:stringItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_IntangibleLiabilityDisclosureAbstract" substitutionGroup="xbrli:item" />
<element name="AccruedManufacturingExpensesCurrent" type="xbrli:monetaryItemType" abstract="false" xbrli:periodType="instant" nillable="true" id="trex_AccruedManufacturingExpensesCurrent" substitutionGroup="xbrli:item" xbrli:balance="credit" />
<element name="BillingsInExcessOfRevenuesCurrent" type="xbrli:monetaryItemType" abstract="false" xbrli:periodType="instant" nillable="true" id="trex_BillingsInExcessOfRevenuesCurrent" substitutionGroup="xbrli:item" xbrli:balance="credit" />
<element name="RevolverLoansPortionEffectiveOneJanuaryThroughThirtyJuneMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_RevolverLoansPortionEffectiveOneJanuaryThroughThirtyJuneMember" substitutionGroup="xbrli:item" />
<element name="RevolverLoansPortionEffectiveOneJulyThroughThirtyFirstDecemberMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_RevolverLoansPortionEffectiveOneJulyThroughThirtyFirstDecemberMember" substitutionGroup="xbrli:item" />
<element name="ThirdAmendedAndRestatedCreditAgreementMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_ThirdAmendedAndRestatedCreditAgreementMember" substitutionGroup="xbrli:item" />
<element name="LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities" type="xbrli:monetaryItemType" abstract="false" xbrli:periodType="instant" nillable="true" id="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities" substitutionGroup="xbrli:item" xbrli:balance="credit" />
<element name="SupplementalBalanceSheetInformationAbstract" type="xbrli:stringItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_SupplementalBalanceSheetInformationAbstract" substitutionGroup="xbrli:item" />
<element name="DescriptionOfOperatingLeasesWithInitialTerm" type="xbrli:stringItemType" abstract="false" xbrli:periodType="duration" nillable="true" id="trex_DescriptionOfOperatingLeasesWithInitialTerm" substitutionGroup="xbrli:item" />
<element name="StockRepurchaseProgramMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_StockRepurchaseProgramMember" substitutionGroup="xbrli:item" />
<element name="ComponentsOfBasicAndDilutedEarningPerShareTable" type="xbrli:stringItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_ComponentsOfBasicAndDilutedEarningPerShareTable" substitutionGroup="xbrldt:hypercubeItem" />
<element name="StockAppreciationRightsAndOptionsMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_StockAppreciationRightsAndOptionsMember" substitutionGroup="xbrli:item" />
<element name="ComponentsOfBasicAndDilutedEarningPerShareLineItems" type="xbrli:stringItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" substitutionGroup="xbrli:item" />
<element name="TwoThousandFourteenStockIncentivePlanMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_TwoThousandFourteenStockIncentivePlanMember" substitutionGroup="xbrli:item" />
<element name="ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice" type="num:perShareItemType" abstract="false" xbrli:periodType="duration" nillable="true" id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice" substitutionGroup="xbrli:item" />
<element name="TimeBasedRestrictedStockUnitsMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_TimeBasedRestrictedStockUnitsMember" substitutionGroup="xbrli:item" />
<element name="PerformanceBasedRestrictedStockUnitsMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_PerformanceBasedRestrictedStockUnitsMember" substitutionGroup="xbrli:item" />
<element name="PerformanceBasedRestrictedStockAdjustmentMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_PerformanceBasedRestrictedStockAdjustmentMember" substitutionGroup="xbrli:item" />
<element name="PerformanceBasedRestrictedStockTargetMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_PerformanceBasedRestrictedStockTargetMember" substitutionGroup="xbrli:item" />
<element name="ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable" type="xbrli:stringItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable" substitutionGroup="xbrldt:hypercubeItem" />
<element name="ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" type="xbrli:stringItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" substitutionGroup="xbrli:item" />
<element name="EmployeeStockPurchasePlanMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_EmployeeStockPurchasePlanMember" substitutionGroup="xbrli:item" />
<element name="PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember" substitutionGroup="xbrli:item" />
<element name="TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember" substitutionGroup="xbrli:item" />
<element name="CapitalExpenditure" type="xbrli:monetaryItemType" abstract="false" xbrli:periodType="duration" nillable="true" id="trex_CapitalExpenditure" substitutionGroup="xbrli:item" xbrli:balance="credit" />
<element name="EBITDA" type="xbrli:monetaryItemType" abstract="false" xbrli:periodType="duration" nillable="true" id="trex_EBITDA" substitutionGroup="xbrli:item" xbrli:balance="credit" />
<element name="ScheduleOfCommitmentsAndContingenciesTable" type="xbrli:stringItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_ScheduleOfCommitmentsAndContingenciesTable" substitutionGroup="xbrldt:hypercubeItem" />
<element name="ScheduleOfCommitmentsAndContingenciesLineItems" type="xbrli:stringItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_ScheduleOfCommitmentsAndContingenciesLineItems" substitutionGroup="xbrli:item" />
<element name="PercentSensitivityChangeInExpectedSurfaceFlakingClaims" type="num:percentItemType" abstract="false" xbrli:periodType="duration" nillable="true" id="trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims" substitutionGroup="xbrli:item" />
<element name="SensitivityChangeInSurfaceFlakingWarrantyReserve" type="xbrli:monetaryItemType" abstract="false" xbrli:periodType="instant" nillable="true" id="trex_SensitivityChangeInSurfaceFlakingWarrantyReserve" substitutionGroup="xbrli:item" xbrli:balance="credit" />
<element name="WarrantyPeriod" type="xbrli:durationItemType" abstract="false" xbrli:periodType="duration" nillable="true" id="trex_WarrantyPeriod" substitutionGroup="xbrli:item" />
<element name="SurfaceFlakingWarrantyReserveMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_SurfaceFlakingWarrantyReserveMember" substitutionGroup="xbrli:item" />
<element name="OtherResidentialMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_OtherResidentialMember" substitutionGroup="xbrli:item" />
<element name="SurfaceFlakingMember" type="nonnum:domainItemType" abstract="true" xbrli:periodType="duration" nillable="true" id="trex_SurfaceFlakingMember" substitutionGroup="xbrli:item" />
</schema>
