<?xml version="1.0" encoding="utf-8"?>
<!--Generated by DFIN XBRL Instance Document - http://www.dfinsolutions.com/ - Version R3.0 - on 16-March-2021 [01:37:35] {AM}-->
<linkbase xmlns="http://www.xbrl.org/2003/linkbase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd" xmlns:xbrldt="http://xbrl.org/2005/xbrldt">
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#ConsolidatedStatementsOfComprehensiveIncome" roleURI="http://www.mastech.com/role/ConsolidatedStatementsOfComprehensiveIncome" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#ConsolidatedStatementsOfShareholdersEquity" roleURI="http://www.mastech.com/role/ConsolidatedStatementsOfShareholdersEquity" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#RevenueFromContractsWithCustomersTables" roleURI="http://www.mastech.com/role/RevenueFromContractsWithCustomersTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#SummaryOfSignificantAccountingPoliciesAdditionalInformationDetail" roleURI="http://www.mastech.com/role/SummaryOfSignificantAccountingPoliciesAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#SummaryOfSignificantAccountingPoliciesEstimatedUsefulLivesOfDepreciableAssetsDetail" roleURI="http://www.mastech.com/role/SummaryOfSignificantAccountingPoliciesEstimatedUsefulLivesOfDepreciableAssetsDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#RevenueFromContractsWithCustomersAdditionalInformationDetail" roleURI="http://www.mastech.com/role/RevenueFromContractsWithCustomersAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#RevenueFromContractsWithCustomersSummaryOfDisaggregationOfOurRevenuesByContractTypeAndOperatingSegmentDetail" roleURI="http://www.mastech.com/role/RevenueFromContractsWithCustomersSummaryOfDisaggregationOfOurRevenuesByContractTypeAndOperatingSegmentDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#RevenueFromContractsWithCustomersSummaryOfRevenueFromExternalCustomersDetail" roleURI="http://www.mastech.com/role/RevenueFromContractsWithCustomersSummaryOfRevenueFromExternalCustomersDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessCombinationsAdditionalInformationDetail" roleURI="http://www.mastech.com/role/BusinessCombinationsAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessCombinationsSummaryOfFairValueOfConsiderationForAcquiredBusinessDetail" roleURI="http://www.mastech.com/role/BusinessCombinationsSummaryOfFairValueOfConsiderationForAcquiredBusinessDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessCombinationsSummaryOfFairValueOfConsiderationForAcquiredBusinessParentheticalDetail" roleURI="http://www.mastech.com/role/BusinessCombinationsSummaryOfFairValueOfConsiderationForAcquiredBusinessParentheticalDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessCombinationsSummaryOfSourceOfFundsDetail" roleURI="http://www.mastech.com/role/BusinessCombinationsSummaryOfSourceOfFundsDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessCombinationsScheduleOfValuationOfNetAssetsAcquiredDetail" roleURI="http://www.mastech.com/role/BusinessCombinationsScheduleOfValuationOfNetAssetsAcquiredDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessCombinationsSummaryOfUnauditedProFormaResultsDetail" roleURI="http://www.mastech.com/role/BusinessCombinationsSummaryOfUnauditedProFormaResultsDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#GoodwillAndOtherIntangibleAssetsNetAdditionalInformationDetail" roleURI="http://www.mastech.com/role/GoodwillAndOtherIntangibleAssetsNetAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#GoodwillAndOtherIntangibleAssetsNetReconciliationOfGoodwillDetail" roleURI="http://www.mastech.com/role/GoodwillAndOtherIntangibleAssetsNetReconciliationOfGoodwillDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#GoodwillAndOtherIntangibleAssetsComponentsOfIdentifiableIntangibleAssetsDetail" roleURI="http://www.mastech.com/role/GoodwillAndOtherIntangibleAssetsComponentsOfIdentifiableIntangibleAssetsDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#CreditFacilityAdditionalInformationDetail" roleURI="http://www.mastech.com/role/CreditFacilityAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#LeasesAdditionalInformationDetail" roleURI="http://www.mastech.com/role/LeasesAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#LeasesSummaryOfBalanceSheetClassificationOfLeaseAssetAndRelatedLeaseLiabilityDetail" roleURI="http://www.mastech.com/role/LeasesSummaryOfBalanceSheetClassificationOfLeaseAssetAndRelatedLeaseLiabilityDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#LeasesScheduleOfFutureMinimumRentalPaymentsForOperatingLeasesDetail" roleURI="http://www.mastech.com/role/LeasesScheduleOfFutureMinimumRentalPaymentsForOperatingLeasesDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#LongTermPayrollTaxLiabilityAdditionalInformationDetail" roleURI="http://www.mastech.com/role/LongTermPayrollTaxLiabilityAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#EmployeeBenefitPlanAdditionalInformationDetail" roleURI="http://www.mastech.com/role/EmployeeBenefitPlanAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#StockBasedCompensationAdditionalInformationDetail" roleURI="http://www.mastech.com/role/StockBasedCompensationAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#StockBasedCompensationSummaryOfInformationRegardingTheCompanysOutstandingAndExercisableStockOptionsDetail" roleURI="http://www.mastech.com/role/StockBasedCompensationSummaryOfInformationRegardingTheCompanysOutstandingAndExercisableStockOptionsDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#StockBasedCompensationSummaryOfMastechsRestrictedStockUnitActivityDetail" roleURI="http://www.mastech.com/role/StockBasedCompensationSummaryOfMastechsRestrictedStockUnitActivityDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#IncomeTaxesAdditionalInformationDetail" roleURI="http://www.mastech.com/role/IncomeTaxesAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#DerivativeInstrumentsAndHedgingActivitiesAdditionalInformationDetail" roleURI="http://www.mastech.com/role/DerivativeInstrumentsAndHedgingActivitiesAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#DerivativeInstrumentsAndHedgingActivitiesEffectOfDerivativeInstrumentsOnConsolidatedStatementsOfOperationsAndComprehensiveIncomeDetail" roleURI="http://www.mastech.com/role/DerivativeInstrumentsAndHedgingActivitiesEffectOfDerivativeInstrumentsOnConsolidatedStatementsOfOperationsAndComprehensiveIncomeDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#DerivativeInstrumentsAndHedgingActivitiesInformationOnLocationAndAmountsOfDerivativeFairValuesInConsolidatedBalanceSheetsDetail" roleURI="http://www.mastech.com/role/DerivativeInstrumentsAndHedgingActivitiesInformationOnLocationAndAmountsOfDerivativeFairValuesInConsolidatedBalanceSheetsDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#ShareholdersEquityAdditionalInformationDetail" roleURI="http://www.mastech.com/role/ShareholdersEquityAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#OtherComprehensiveIncomeLossSummaryOfAccumulatedOtherComprehensiveIncomeLossDetail" roleURI="http://www.mastech.com/role/OtherComprehensiveIncomeLossSummaryOfAccumulatedOtherComprehensiveIncomeLossDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#FairValueMeasurementsAdditionalInformationDetail" roleURI="http://www.mastech.com/role/FairValueMeasurementsAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#FairValueMeasurementsSummaryOfFinancialAssetsLiabilitiesAtFairValueMeasuredOnRecurringBasisDetail" roleURI="http://www.mastech.com/role/FairValueMeasurementsSummaryOfFinancialAssetsLiabilitiesAtFairValueMeasuredOnRecurringBasisDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessSegmentsAndGeographicInformationAdditionalInformationDetail" roleURI="http://www.mastech.com/role/BusinessSegmentsAndGeographicInformationAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessSegmentsAndGeographicInformationSummaryOfOperatingSegmentsDetail" roleURI="http://www.mastech.com/role/BusinessSegmentsAndGeographicInformationSummaryOfOperatingSegmentsDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessSegmentsAndGeographicInformationSummaryOfAssetsBySegmentDetail" roleURI="http://www.mastech.com/role/BusinessSegmentsAndGeographicInformationSummaryOfAssetsBySegmentDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessSegmentsAndGeographicInformationSummaryOfRevenueFromExternalCustomersDetail" roleURI="http://www.mastech.com/role/BusinessSegmentsAndGeographicInformationSummaryOfRevenueFromExternalCustomersDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#ScheduleIiValuationAndQualifyingAccountsDetail" roleURI="http://www.mastech.com/role/ScheduleIiValuationAndQualifyingAccountsDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#ConsolidatedBalanceSheetsParenthetical" roleURI="http://www.mastech.com/role/ConsolidatedBalanceSheetsParenthetical" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#ConsolidatedStatementsOfCashFlows" roleURI="http://www.mastech.com/role/ConsolidatedStatementsOfCashFlows" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#GoodwillAndOtherIntangibleAssetsNetScheduleOfEstimatedAmortizationExpenseDetail" roleURI="http://www.mastech.com/role/GoodwillAndOtherIntangibleAssetsNetScheduleOfEstimatedAmortizationExpenseDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#CashAndCashEquivalentsAdditionalInformationDetail" roleURI="http://www.mastech.com/role/CashAndCashEquivalentsAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#StockBasedCompensationSummaryOfCompanysStockOptionActivityDetail" roleURI="http://www.mastech.com/role/StockBasedCompensationSummaryOfCompanysStockOptionActivityDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#StockBasedCompensationSummaryOfAssumptionsWithRespectToTheBlackScholesOptionPricingModelDetail" roleURI="http://www.mastech.com/role/StockBasedCompensationSummaryOfAssumptionsWithRespectToTheBlackScholesOptionPricingModelDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#IncomeTaxesProvisionForIncomeTaxesDetail" roleURI="http://www.mastech.com/role/IncomeTaxesProvisionForIncomeTaxesDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#IncomeTaxesReconciliationOfIncomeTaxesDetail" roleURI="http://www.mastech.com/role/IncomeTaxesReconciliationOfIncomeTaxesDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#IncomeTaxesComponentsOfDeferredTaxAssetsAndLiabilitiesDetail" roleURI="http://www.mastech.com/role/IncomeTaxesComponentsOfDeferredTaxAssetsAndLiabilitiesDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#CreditFacilityScheduleOfAnnualAggregateOutstandingDebtDetail" roleURI="http://www.mastech.com/role/CreditFacilityScheduleOfAnnualAggregateOutstandingDebtDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#IncomeTaxesUnrecognizedTaxBenefitsRelatedToUncertainTaxPositionsDetail" roleURI="http://www.mastech.com/role/IncomeTaxesUnrecognizedTaxBenefitsRelatedToUncertainTaxPositionsDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#QuarterlyFinancialInformationFromContinuingOperationsSummaryOfQuarterlyFinancialInformationFromContinuingOperationsDetail" roleURI="http://www.mastech.com/role/QuarterlyFinancialInformationFromContinuingOperationsSummaryOfQuarterlyFinancialInformationFromContinuingOperationsDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#EarningsPerShareAdditionalInformationDetail" roleURI="http://www.mastech.com/role/EarningsPerShareAdditionalInformationDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#EarningsPerShareComputationOfBasicEpsDetail" roleURI="http://www.mastech.com/role/EarningsPerShareComputationOfBasicEpsDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#EarningsPerShareComputationOfDilutedEpsDetail" roleURI="http://www.mastech.com/role/EarningsPerShareComputationOfDilutedEpsDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#SummaryOfSignificantAccountingPolicies" roleURI="http://www.mastech.com/role/SummaryOfSignificantAccountingPolicies" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#SummaryOfSignificantAccountingPoliciesPolicies" roleURI="http://www.mastech.com/role/SummaryOfSignificantAccountingPoliciesPolicies" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#SummaryOfSignificantAccountingPoliciesTables" roleURI="http://www.mastech.com/role/SummaryOfSignificantAccountingPoliciesTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#RevenueFromContractsWithCustomers" roleURI="http://www.mastech.com/role/RevenueFromContractsWithCustomers" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessCombinations" roleURI="http://www.mastech.com/role/BusinessCombinations" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessCombinationsTables" roleURI="http://www.mastech.com/role/BusinessCombinationsTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#CashAndCashEquivalents" roleURI="http://www.mastech.com/role/CashAndCashEquivalents" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#CreditFacility" roleURI="http://www.mastech.com/role/CreditFacility" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#CreditFacilityTables" roleURI="http://www.mastech.com/role/CreditFacilityTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#CommitmentsAndContingencies" roleURI="http://www.mastech.com/role/CommitmentsAndContingencies" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#EmployeeBenefitPlan" roleURI="http://www.mastech.com/role/EmployeeBenefitPlan" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#StockBasedCompensation" roleURI="http://www.mastech.com/role/StockBasedCompensation" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#StockBasedCompensationTables" roleURI="http://www.mastech.com/role/StockBasedCompensationTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#GoodwillAndOtherIntangibleAssetsNet" roleURI="http://www.mastech.com/role/GoodwillAndOtherIntangibleAssetsNet" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#GoodwillAndOtherIntangibleAssetsNetTables" roleURI="http://www.mastech.com/role/GoodwillAndOtherIntangibleAssetsNetTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#IncomeTaxes" roleURI="http://www.mastech.com/role/IncomeTaxes" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#IncomeTaxesTables" roleURI="http://www.mastech.com/role/IncomeTaxesTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#DerivativeInstrumentsAndHedgingActivities" roleURI="http://www.mastech.com/role/DerivativeInstrumentsAndHedgingActivities" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#DerivativeInstrumentsAndHedgingActivitiesTables" roleURI="http://www.mastech.com/role/DerivativeInstrumentsAndHedgingActivitiesTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#ShareholdersEquity" roleURI="http://www.mastech.com/role/ShareholdersEquity" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#EarningsPerShare" roleURI="http://www.mastech.com/role/EarningsPerShare" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#EarningsPerShareTables" roleURI="http://www.mastech.com/role/EarningsPerShareTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#QuarterlyFinancialInformation" roleURI="http://www.mastech.com/role/QuarterlyFinancialInformation" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#QuarterlyFinancialInformationTables" roleURI="http://www.mastech.com/role/QuarterlyFinancialInformationTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessSegmentsAndGeographicInformation" roleURI="http://www.mastech.com/role/BusinessSegmentsAndGeographicInformation" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#BusinessSegmentsAndGeographicInformationTables" roleURI="http://www.mastech.com/role/BusinessSegmentsAndGeographicInformationTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#FairValueMeasurements" roleURI="http://www.mastech.com/role/FairValueMeasurements" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#FairValueMeasurementsTables" roleURI="http://www.mastech.com/role/FairValueMeasurementsTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#ScheduleIiValuationAndQualifyingAccounts" roleURI="http://www.mastech.com/role/ScheduleIiValuationAndQualifyingAccounts" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#EarningsPerShareScheduleOfDenominatorsOfBasicAndDilutedEpsComputationsDetail" roleURI="http://www.mastech.com/role/EarningsPerShareScheduleOfDenominatorsOfBasicAndDilutedEpsComputationsDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#IncomeTaxesComponentsOfIncomeBeforeIncomeTaxesDetail" roleURI="http://www.mastech.com/role/IncomeTaxesComponentsOfIncomeBeforeIncomeTaxesDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#ConsolidatedBalanceSheets" roleURI="http://www.mastech.com/role/ConsolidatedBalanceSheets" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#ConsolidatedStatementsOfOperations" roleURI="http://www.mastech.com/role/ConsolidatedStatementsOfOperations" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#Leases" roleURI="http://www.mastech.com/role/Leases" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#LeasesTables" roleURI="http://www.mastech.com/role/LeasesTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#FairValueMeasurementsScheduleOfChangesInContingentConsiderationLiabilityDetail" roleURI="http://www.mastech.com/role/FairValueMeasurementsScheduleOfChangesInContingentConsiderationLiabilityDetail" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#CoverPage" roleURI="http://www.mastech.com/role/CoverPage" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#OtherComprehensiveIncomeLoss" roleURI="http://www.mastech.com/role/OtherComprehensiveIncomeLoss" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#OtherComprehensiveIncomeLossTables" roleURI="http://www.mastech.com/role/OtherComprehensiveIncomeLossTables" />
<roleRef xlink:type="simple" xlink:href="mhh-20201231.xsd#LongTermPayrollTaxLiability" roleURI="http://www.mastech.com/role/LongTermPayrollTaxLiability" />
<arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/all" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#all" />
<arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-default" />
<arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-domain" />
<arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/domain-member" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#domain-member" />
<arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#hypercube-dimension" />
<arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/notAll" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#notAll" />
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/ConsolidatedStatementsOfComprehensiveIncome">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementLineItems" xlink:label="loc_us-gaap_StatementLineItems_102" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ComprehensiveIncomeNetOfTax" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax_111" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_102" xlink:to="loc_us-gaap_ComprehensiveIncomeNetOfTax_111" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NetIncomeLoss" xlink:label="loc_us-gaap_NetIncomeLoss_110" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_102" xlink:to="loc_us-gaap_NetIncomeLoss_110" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossTaxPortionAttributableToParentAbstract" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossTaxPortionAttributableToParentAbstract_101" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_102" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossTaxPortionAttributableToParentAbstract_101" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossBeforeTaxPortionAttributableToParent" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossBeforeTaxPortionAttributableToParent_107" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossTaxPortionAttributableToParentAbstract_101" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossBeforeTaxPortionAttributableToParent_107" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentBeforeTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentBeforeTax_106" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossTaxPortionAttributableToParentAbstract_101" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentBeforeTax_106" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_109" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossTaxPortionAttributableToParentAbstract_101" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_109" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedGainLossOnDerivativesArisingDuringPeriodBeforeTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedGainLossOnDerivativesArisingDuringPeriodBeforeTax_105" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossTaxPortionAttributableToParentAbstract_101" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedGainLossOnDerivativesArisingDuringPeriodBeforeTax_105" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedGainLossOnDerivativesArisingDuringPeriodTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedGainLossOnDerivativesArisingDuringPeriodTax_108" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossTaxPortionAttributableToParentAbstract_101" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedGainLossOnDerivativesArisingDuringPeriodTax_108" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementTable" xlink:label="loc_us-gaap_StatementTable_103" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_102" xlink:to="loc_us-gaap_StatementTable_103" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeInstrumentRiskAxis" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_100" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_103" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_100" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeContractTypeDomain" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_99" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_100" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_99" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeContractTypeDomain" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_99_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_100" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_99_default" use="optional" order="12" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/ConsolidatedStatementsOfShareholdersEquity">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementLineItems" xlink:label="loc_us-gaap_StatementLineItems_116" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue" xlink:label="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_128" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_116" xlink:to="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_128" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NetIncomeLoss" xlink:label="loc_us-gaap_NetIncomeLoss_124" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_116" xlink:to="loc_us-gaap_NetIncomeLoss_124" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_126" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_116" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_126" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementTable" xlink:label="loc_us-gaap_StatementTable_117" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_116" xlink:to="loc_us-gaap_StatementTable_117" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementEquityComponentsAxis" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_115" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_117" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_115" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EquityComponentDomain" xlink:label="loc_us-gaap_EquityComponentDomain_114" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_115" xlink:to="loc_us-gaap_EquityComponentDomain_114" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EquityComponentDomain" xlink:label="loc_us-gaap_EquityComponentDomain_114_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_115" xlink:to="loc_us-gaap_EquityComponentDomain_114_default" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccumulatedDistributionsInExcessOfNetIncomeMember" xlink:label="loc_us-gaap_AccumulatedDistributionsInExcessOfNetIncomeMember_120" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_114" xlink:to="loc_us-gaap_AccumulatedDistributionsInExcessOfNetIncomeMember_120" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeMember" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_122" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_114" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_122" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AdditionalPaidInCapitalMember" xlink:label="loc_us-gaap_AdditionalPaidInCapitalMember_119" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_114" xlink:to="loc_us-gaap_AdditionalPaidInCapitalMember_119" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CommonStockMember" xlink:label="loc_us-gaap_CommonStockMember_118" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_114" xlink:to="loc_us-gaap_CommonStockMember_118" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TreasuryStockMember" xlink:label="loc_us-gaap_TreasuryStockMember_121" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_114" xlink:to="loc_us-gaap_TreasuryStockMember_121" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StockholdersEquity" xlink:label="loc_us-gaap_StockholdersEquity_123" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_116" xlink:to="loc_us-gaap_StockholdersEquity_123" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised_129" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_116" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised_129" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TreasuryStockValueAcquiredCostMethod" xlink:label="loc_us-gaap_TreasuryStockValueAcquiredCostMethod_466494" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_116" xlink:to="loc_us-gaap_TreasuryStockValueAcquiredCostMethod_466494" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StockIssuedDuringPeriodValueEmployeeStockPurchasePlan" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueEmployeeStockPurchasePlan_466495" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_116" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueEmployeeStockPurchasePlan_466495" use="optional" order="16" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/RevenueFromContractsWithCustomersTables">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementLineItems" xlink:label="loc_us-gaap_StatementLineItems_938" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DisaggregationOfRevenueTableTextBlock" xlink:label="loc_us-gaap_DisaggregationOfRevenueTableTextBlock_941" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_938" xlink:to="loc_us-gaap_DisaggregationOfRevenueTableTextBlock_941" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RevenueFromExternalCustomersByGeographicAreasTableTextBlock" xlink:label="loc_us-gaap_RevenueFromExternalCustomersByGeographicAreasTableTextBlock_942" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_938" xlink:to="loc_us-gaap_RevenueFromExternalCustomersByGeographicAreasTableTextBlock_942" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementTable" xlink:label="loc_us-gaap_StatementTable_939" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_938" xlink:to="loc_us-gaap_StatementTable_939" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:label="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_937" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_939" xlink:to="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_937" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_940" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_937" xlink:to="loc_us-gaap_TypeOfAdoptionMember_940" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_940_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_937" xlink:to="loc_us-gaap_TypeOfAdoptionMember_940_default" use="optional" order="6" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/SummaryOfSignificantAccountingPoliciesAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_SignificantAccountingPoliciesLineItems" xlink:label="loc_mhh_SignificantAccountingPoliciesLineItems_187" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CapitalizedComputerSoftwareNet" xlink:label="loc_us-gaap_CapitalizedComputerSoftwareNet_202" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_CapitalizedComputerSoftwareNet_202" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpense" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpense_211" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpense_211" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DeferredTaxAssetsValuationAllowance" xlink:label="loc_us-gaap_DeferredTaxAssetsValuationAllowance_207" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_DeferredTaxAssetsValuationAllowance_207" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DepreciationDepletionAndAmortization" xlink:label="loc_us-gaap_DepreciationDepletionAndAmortization_203" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_DepreciationDepletionAndAmortization_203" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_204" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_204" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_GoodwillAndIntangibleAssetImpairment" xlink:label="loc_us-gaap_GoodwillAndIntangibleAssetImpairment_205" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_GoodwillAndIntangibleAssetImpairment_205" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_MaximumPercentageOfBillableExpensesOnRevenueFromCustomer" xlink:label="loc_mhh_MaximumPercentageOfBillableExpensesOnRevenueFromCustomer_215" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_mhh_MaximumPercentageOfBillableExpensesOnRevenueFromCustomer_215" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NumberOfReportableSegments" xlink:label="loc_us-gaap_NumberOfReportableSegments_214" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_NumberOfReportableSegments_214" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeaseLiability" xlink:label="loc_us-gaap_OperatingLeaseLiability_225" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_OperatingLeaseLiability_225" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeaseRightOfUseAsset" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_224" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_224" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ProvisionForDoubtfulAccounts" xlink:label="loc_us-gaap_ProvisionForDoubtfulAccounts_201" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_ProvisionForDoubtfulAccounts_201" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized_216" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized_216" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_SignificantAccountingPoliciesTable" xlink:label="loc_mhh_SignificantAccountingPoliciesTable_188" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_mhh_SignificantAccountingPoliciesTable_188" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:label="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_180" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_mhh_SignificantAccountingPoliciesTable_188" xlink:to="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_180" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_191" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_180" xlink:to="loc_us-gaap_TypeOfAdoptionMember_191" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_191_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_180" xlink:to="loc_us-gaap_TypeOfAdoptionMember_191_default" use="optional" order="16" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccountingStandardsUpdate201409Member" xlink:label="loc_us-gaap_AccountingStandardsUpdate201409Member_228" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfAdoptionMember_191" xlink:to="loc_us-gaap_AccountingStandardsUpdate201409Member_228" use="optional" order="17" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAxis" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_182" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_mhh_SignificantAccountingPoliciesTable_188" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_182" use="optional" order="18" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_181" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_182" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_181" use="optional" order="19" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_181_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_182" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_181_default" use="optional" order="20" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_InfoTrellisIncMember" xlink:label="loc_mhh_InfoTrellisIncMember_192" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_181" xlink:to="loc_mhh_InfoTrellisIncMember_192" use="optional" order="21" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_AmberLeafMember" xlink:label="loc_mhh_AmberLeafMember_856486" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_181" xlink:to="loc_mhh_AmberLeafMember_856486" use="optional" order="22" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_183" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_mhh_SignificantAccountingPoliciesTable_188" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_183" use="optional" order="23" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_184" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_183" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_184" use="optional" order="24" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_184_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_183" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_184_default" use="optional" order="25" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SoftwareAndSoftwareDevelopmentCostsMember" xlink:label="loc_us-gaap_SoftwareAndSoftwareDevelopmentCostsMember_193" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_184" xlink:to="loc_us-gaap_SoftwareAndSoftwareDevelopmentCostsMember_193" use="optional" order="26" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeAxis" xlink:label="loc_srt_RangeAxis_185" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_mhh_SignificantAccountingPoliciesTable_188" xlink:to="loc_srt_RangeAxis_185" use="optional" order="27" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_186" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_185" xlink:to="loc_srt_RangeMember_186" use="optional" order="28" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_186_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_185" xlink:to="loc_srt_RangeMember_186_default" use="optional" order="29" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_MaximumMember" xlink:label="loc_srt_MaximumMember_195" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_186" xlink:to="loc_srt_MaximumMember_195" use="optional" order="30" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_MinimumMember" xlink:label="loc_srt_MinimumMember_194" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_186" xlink:to="loc_srt_MinimumMember_194" use="optional" order="31" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SubsequentEventTypeAxis" xlink:label="loc_us-gaap_SubsequentEventTypeAxis_189" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_mhh_SignificantAccountingPoliciesTable_188" xlink:to="loc_us-gaap_SubsequentEventTypeAxis_189" use="optional" order="32" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SubsequentEventTypeDomain" xlink:label="loc_us-gaap_SubsequentEventTypeDomain_190" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_SubsequentEventTypeAxis_189" xlink:to="loc_us-gaap_SubsequentEventTypeDomain_190" use="optional" order="33" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SubsequentEventTypeDomain" xlink:label="loc_us-gaap_SubsequentEventTypeDomain_190_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_SubsequentEventTypeAxis_189" xlink:to="loc_us-gaap_SubsequentEventTypeDomain_190_default" use="optional" order="34" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AwardTypeAxis" xlink:label="loc_us-gaap_AwardTypeAxis_655717" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_mhh_SignificantAccountingPoliciesTable_188" xlink:to="loc_us-gaap_AwardTypeAxis_655717" use="optional" order="35" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_655718" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_655717" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_655718" use="optional" order="36" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_655718_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_655717" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_655718_default" use="optional" order="37" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_EmployeeStockPurchasePlanMember" xlink:label="loc_mhh_EmployeeStockPurchasePlanMember_655719" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_655718" xlink:to="loc_mhh_EmployeeStockPurchasePlanMember_655719" use="optional" order="38" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StockholdersEquityNoteStockSplit" xlink:label="loc_us-gaap_StockholdersEquityNoteStockSplit_196" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_StockholdersEquityNoteStockSplit_196" use="optional" order="39" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StockRepurchaseProgramExpirationDate" xlink:label="loc_us-gaap_StockRepurchaseProgramExpirationDate_220" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_StockRepurchaseProgramExpirationDate_220" use="optional" order="40" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TaxCutsAndJobsActOf2017ChangeInTaxRateOnetimeNoncashCharge" xlink:label="loc_mhh_TaxCutsAndJobsActOf2017ChangeInTaxRateOnetimeNoncashCharge_208" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_mhh_TaxCutsAndJobsActOf2017ChangeInTaxRateOnetimeNoncashCharge_208" use="optional" order="41" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TreasuryStockShares" xlink:label="loc_us-gaap_TreasuryStockShares_218" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_TreasuryStockShares_218" use="optional" order="42" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TreasuryStockValue" xlink:label="loc_us-gaap_TreasuryStockValue_219" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_TreasuryStockValue_219" use="optional" order="43" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestAccrued" xlink:label="loc_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestAccrued_212" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestAccrued_212" use="optional" order="44" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AllowanceForDoubtfulAccountsReceivableCurrent" xlink:label="loc_us-gaap_AllowanceForDoubtfulAccountsReceivableCurrent_655654" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_AllowanceForDoubtfulAccountsReceivableCurrent_655654" use="optional" order="45" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_GoodwillImpairmentLoss" xlink:label="loc_us-gaap_GoodwillImpairmentLoss_655673" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_GoodwillImpairmentLoss_655673" use="optional" order="46" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1_655675" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1_655675" use="optional" order="47" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_655702" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_655702" use="optional" order="48" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant_655716" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant_655716" use="optional" order="49" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TaxCutsAndJobsActOf2017ChangeInTaxRateIncomeTaxExpenseBenefit" xlink:label="loc_us-gaap_TaxCutsAndJobsActOf2017ChangeInTaxRateIncomeTaxExpenseBenefit_209" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_TaxCutsAndJobsActOf2017ChangeInTaxRateIncomeTaxExpenseBenefit_209" use="optional" order="50" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationLiability" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_856490" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_856490" use="optional" order="51" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TaxCutsAndJobsActOf2017IncompleteAccountingTransitionTaxForAccumulatedForeignEarningsProvisionalIncomeTaxExpenses" xlink:label="loc_mhh_TaxCutsAndJobsActOf2017IncompleteAccountingTransitionTaxForAccumulatedForeignEarningsProvisionalIncomeTaxExpenses_858467" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_mhh_TaxCutsAndJobsActOf2017IncompleteAccountingTransitionTaxForAccumulatedForeignEarningsProvisionalIncomeTaxExpenses_858467" use="optional" order="52" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TaxCutsAndJobsActOf2017IncompleteAccountingChangeInTaxRateDeferredTaxAssetProvisionalIncomeTaxExpenses" xlink:label="loc_mhh_TaxCutsAndJobsActOf2017IncompleteAccountingChangeInTaxRateDeferredTaxAssetProvisionalIncomeTaxExpenses_858480" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_SignificantAccountingPoliciesLineItems_187" xlink:to="loc_mhh_TaxCutsAndJobsActOf2017IncompleteAccountingChangeInTaxRateDeferredTaxAssetProvisionalIncomeTaxExpenses_858480" use="optional" order="53" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/SummaryOfSignificantAccountingPoliciesEstimatedUsefulLivesOfDepreciableAssetsDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PropertyPlantAndEquipmentLineItems" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentLineItems_232" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PropertyPlantAndEquipmentUsefulLife" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentUsefulLife_237" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_232" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentUsefulLife_237" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:label="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_236" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_232" xlink:to="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_236" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_231" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_236" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_231" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_233" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_231" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_233" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_233_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_231" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_233_default" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ComputerEquipmentMember" xlink:label="loc_us-gaap_ComputerEquipmentMember_238" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_233" xlink:to="loc_us-gaap_ComputerEquipmentMember_238" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_MachineryAndEquipmentMember" xlink:label="loc_us-gaap_MachineryAndEquipmentMember_239" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_233" xlink:to="loc_us-gaap_MachineryAndEquipmentMember_239" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SoftwareAndSoftwareDevelopmentCostsMember" xlink:label="loc_us-gaap_SoftwareAndSoftwareDevelopmentCostsMember_240" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_233" xlink:to="loc_us-gaap_SoftwareAndSoftwareDevelopmentCostsMember_240" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeAxis" xlink:label="loc_srt_RangeAxis_234" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_236" xlink:to="loc_srt_RangeAxis_234" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_235" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_234" xlink:to="loc_srt_RangeMember_235" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_235_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_234" xlink:to="loc_srt_RangeMember_235_default" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_MaximumMember" xlink:label="loc_srt_MaximumMember_242" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_235" xlink:to="loc_srt_MaximumMember_242" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_MinimumMember" xlink:label="loc_srt_MinimumMember_241" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_235" xlink:to="loc_srt_MinimumMember_241" use="optional" order="13" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/RevenueFromContractsWithCustomersAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DisaggregationOfRevenueLineItems" xlink:label="loc_us-gaap_DisaggregationOfRevenueLineItems_250" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ConcentrationRiskPercentage1" xlink:label="loc_us-gaap_ConcentrationRiskPercentage1_263" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DisaggregationOfRevenueLineItems_250" xlink:to="loc_us-gaap_ConcentrationRiskPercentage1_263" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_CustomerPercentageOfRevenue" xlink:label="loc_mhh_CustomerPercentageOfRevenue_262" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DisaggregationOfRevenueLineItems_250" xlink:to="loc_mhh_CustomerPercentageOfRevenue_262" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DisaggregationOfRevenueTable" xlink:label="loc_us-gaap_DisaggregationOfRevenueTable_251" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DisaggregationOfRevenueLineItems_250" xlink:to="loc_us-gaap_DisaggregationOfRevenueTable_251" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:label="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_245" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DisaggregationOfRevenueTable_251" xlink:to="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_245" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_256" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_245" xlink:to="loc_us-gaap_TypeOfAdoptionMember_256" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_256_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_245" xlink:to="loc_us-gaap_TypeOfAdoptionMember_256_default" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:label="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_247" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DisaggregationOfRevenueTable_251" xlink:to="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_247" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ConcentrationRiskBenchmarkDomain" xlink:label="loc_us-gaap_ConcentrationRiskBenchmarkDomain_246" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_247" xlink:to="loc_us-gaap_ConcentrationRiskBenchmarkDomain_246" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ConcentrationRiskBenchmarkDomain" xlink:label="loc_us-gaap_ConcentrationRiskBenchmarkDomain_246_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_247" xlink:to="loc_us-gaap_ConcentrationRiskBenchmarkDomain_246_default" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccountsReceivableMember" xlink:label="loc_us-gaap_AccountsReceivableMember_258" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskBenchmarkDomain_246" xlink:to="loc_us-gaap_AccountsReceivableMember_258" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SalesRevenueNetMember" xlink:label="loc_us-gaap_SalesRevenueNetMember_257" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskBenchmarkDomain_246" xlink:to="loc_us-gaap_SalesRevenueNetMember_257" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TopTenCustomersMember" xlink:label="loc_mhh_TopTenCustomersMember_259" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskBenchmarkDomain_246" xlink:to="loc_mhh_TopTenCustomersMember_259" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ConcentrationRiskByTypeAxis" xlink:label="loc_us-gaap_ConcentrationRiskByTypeAxis_248" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DisaggregationOfRevenueTable_251" xlink:to="loc_us-gaap_ConcentrationRiskByTypeAxis_248" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ConcentrationRiskTypeDomain" xlink:label="loc_us-gaap_ConcentrationRiskTypeDomain_249" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ConcentrationRiskByTypeAxis_248" xlink:to="loc_us-gaap_ConcentrationRiskTypeDomain_249" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ConcentrationRiskTypeDomain" xlink:label="loc_us-gaap_ConcentrationRiskTypeDomain_249_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ConcentrationRiskByTypeAxis_248" xlink:to="loc_us-gaap_ConcentrationRiskTypeDomain_249_default" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RevenueFromRightsConcentrationRiskMember" xlink:label="loc_us-gaap_RevenueFromRightsConcentrationRiskMember_260" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskTypeDomain_249" xlink:to="loc_us-gaap_RevenueFromRightsConcentrationRiskMember_260" use="optional" order="16" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_MajorCustomersAxis" xlink:label="loc_srt_MajorCustomersAxis_252" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DisaggregationOfRevenueTable_251" xlink:to="loc_srt_MajorCustomersAxis_252" use="optional" order="17" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_NameOfMajorCustomerDomain" xlink:label="loc_srt_NameOfMajorCustomerDomain_253" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_MajorCustomersAxis_252" xlink:to="loc_srt_NameOfMajorCustomerDomain_253" use="optional" order="18" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_NameOfMajorCustomerDomain" xlink:label="loc_srt_NameOfMajorCustomerDomain_253_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_MajorCustomersAxis_252" xlink:to="loc_srt_NameOfMajorCustomerDomain_253_default" use="optional" order="19" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_CgiMember" xlink:label="loc_mhh_CgiMember_266" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_NameOfMajorCustomerDomain_253" xlink:to="loc_mhh_CgiMember_266" use="optional" order="20" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementBusinessSegmentsAxis" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_255" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DisaggregationOfRevenueTable_251" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_255" use="optional" order="21" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_254" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_255" xlink:to="loc_us-gaap_SegmentDomain_254" use="optional" order="22" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_254_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_255" xlink:to="loc_us-gaap_SegmentDomain_254_default" use="optional" order="23" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_DataAndAnalyticsServicesMember" xlink:label="loc_mhh_DataAndAnalyticsServicesMember_268" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_254" xlink:to="loc_mhh_DataAndAnalyticsServicesMember_268" use="optional" order="24" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_MaximumPercentageOfBillableExpensesOnRevenueFromCustomer" xlink:label="loc_mhh_MaximumPercentageOfBillableExpensesOnRevenueFromCustomer_261" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DisaggregationOfRevenueLineItems_250" xlink:to="loc_mhh_MaximumPercentageOfBillableExpensesOnRevenueFromCustomer_261" use="optional" order="25" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_NumberOfCustomersAccountedForRevenues" xlink:label="loc_mhh_NumberOfCustomersAccountedForRevenues_264" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DisaggregationOfRevenueLineItems_250" xlink:to="loc_mhh_NumberOfCustomersAccountedForRevenues_264" use="optional" order="26" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_RevenuePercentageToAggregateRevenue" xlink:label="loc_mhh_RevenuePercentageToAggregateRevenue_265" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DisaggregationOfRevenueLineItems_250" xlink:to="loc_mhh_RevenuePercentageToAggregateRevenue_265" use="optional" order="27" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/RevenueFromContractsWithCustomersSummaryOfDisaggregationOfOurRevenuesByContractTypeAndOperatingSegmentDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DisaggregationOfRevenueLineItems" xlink:label="loc_us-gaap_DisaggregationOfRevenueLineItems_275" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DisaggregationOfRevenueTable" xlink:label="loc_us-gaap_DisaggregationOfRevenueTable_276" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DisaggregationOfRevenueLineItems_275" xlink:to="loc_us-gaap_DisaggregationOfRevenueTable_276" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:label="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_272" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DisaggregationOfRevenueTable_276" xlink:to="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_272" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_279" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_272" xlink:to="loc_us-gaap_TypeOfAdoptionMember_279" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_279_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_272" xlink:to="loc_us-gaap_TypeOfAdoptionMember_279_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ContractWithCustomerBasisOfPricingAxis" xlink:label="loc_us-gaap_ContractWithCustomerBasisOfPricingAxis_273" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DisaggregationOfRevenueTable_276" xlink:to="loc_us-gaap_ContractWithCustomerBasisOfPricingAxis_273" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ContractWithCustomerBasisOfPricingDomain" xlink:label="loc_us-gaap_ContractWithCustomerBasisOfPricingDomain_274" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ContractWithCustomerBasisOfPricingAxis_273" xlink:to="loc_us-gaap_ContractWithCustomerBasisOfPricingDomain_274" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ContractWithCustomerBasisOfPricingDomain" xlink:label="loc_us-gaap_ContractWithCustomerBasisOfPricingDomain_274_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ContractWithCustomerBasisOfPricingAxis_273" xlink:to="loc_us-gaap_ContractWithCustomerBasisOfPricingDomain_274_default" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FixedPriceContractMember" xlink:label="loc_us-gaap_FixedPriceContractMember_281" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ContractWithCustomerBasisOfPricingDomain_274" xlink:to="loc_us-gaap_FixedPriceContractMember_281" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TimeAndMaterialsContractMember" xlink:label="loc_us-gaap_TimeAndMaterialsContractMember_280" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ContractWithCustomerBasisOfPricingDomain_274" xlink:to="loc_us-gaap_TimeAndMaterialsContractMember_280" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementBusinessSegmentsAxis" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_278" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DisaggregationOfRevenueTable_276" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_278" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_277" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_278" xlink:to="loc_us-gaap_SegmentDomain_277" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_277_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_278" xlink:to="loc_us-gaap_SegmentDomain_277_default" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_DataAndAnalyticsServicesMember" xlink:label="loc_mhh_DataAndAnalyticsServicesMember_283" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_277" xlink:to="loc_mhh_DataAndAnalyticsServicesMember_283" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ITStaffingServicesMember" xlink:label="loc_mhh_ITStaffingServicesMember_284" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_277" xlink:to="loc_mhh_ITStaffingServicesMember_284" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_282" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DisaggregationOfRevenueLineItems_275" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_282" use="optional" order="15" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/RevenueFromContractsWithCustomersSummaryOfRevenueFromExternalCustomersDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EntityWideInformationRevenueFromExternalCustomerLineItems" xlink:label="loc_us-gaap_EntityWideInformationRevenueFromExternalCustomerLineItems_289" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_294" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideInformationRevenueFromExternalCustomerLineItems_289" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_294" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfEntityWideInformationRevenueFromExternalCustomersByProductsAndServicesTable" xlink:label="loc_us-gaap_ScheduleOfEntityWideInformationRevenueFromExternalCustomersByProductsAndServicesTable_290" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EntityWideInformationRevenueFromExternalCustomerLineItems_289" xlink:to="loc_us-gaap_ScheduleOfEntityWideInformationRevenueFromExternalCustomersByProductsAndServicesTable_290" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:label="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_288" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideInformationRevenueFromExternalCustomersByProductsAndServicesTable_290" xlink:to="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_288" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_293" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_288" xlink:to="loc_us-gaap_TypeOfAdoptionMember_293" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_293_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_288" xlink:to="loc_us-gaap_TypeOfAdoptionMember_293_default" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_StatementGeographicalAxis" xlink:label="loc_srt_StatementGeographicalAxis_292" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideInformationRevenueFromExternalCustomersByProductsAndServicesTable_290" xlink:to="loc_srt_StatementGeographicalAxis_292" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_SegmentGeographicalDomain" xlink:label="loc_srt_SegmentGeographicalDomain_291" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementGeographicalAxis_292" xlink:to="loc_srt_SegmentGeographicalDomain_291" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_SegmentGeographicalDomain" xlink:label="loc_srt_SegmentGeographicalDomain_291_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementGeographicalAxis_292" xlink:to="loc_srt_SegmentGeographicalDomain_291_default" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/country/2020/country-2020-01-31.xsd#country_CA" xlink:label="loc_country_CA_296" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_291" xlink:to="loc_country_CA_296" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_IndiaAndOtherMember" xlink:label="loc_mhh_IndiaAndOtherMember_297" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_291" xlink:to="loc_mhh_IndiaAndOtherMember_297" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/country/2020/country-2020-01-31.xsd#country_US" xlink:label="loc_country_US_295" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_291" xlink:to="loc_country_US_295" use="optional" order="11" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/BusinessCombinationsAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionLineItems" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_304" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_BusinessAcquisitionContingentConsiderationPotentiallyPayableInAchievingMilestones" xlink:label="loc_mhh_BusinessAcquisitionContingentConsiderationPotentiallyPayableInAchievingMilestones_327" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_304" xlink:to="loc_mhh_BusinessAcquisitionContingentConsiderationPotentiallyPayableInAchievingMilestones_327" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_BusinessAcquisitionCostOfAcquiredEntityTransactionCost" xlink:label="loc_mhh_BusinessAcquisitionCostOfAcquiredEntityTransactionCost_338" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_304" xlink:to="loc_mhh_BusinessAcquisitionCostOfAcquiredEntityTransactionCost_338" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionDescriptionOfAcquiredEntity" xlink:label="loc_us-gaap_BusinessAcquisitionDescriptionOfAcquiredEntity_324" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_304" xlink:to="loc_us-gaap_BusinessAcquisitionDescriptionOfAcquiredEntity_324" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity" xlink:label="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_331" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_304" xlink:to="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_331" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NetIncomeLoss" xlink:label="loc_us-gaap_NetIncomeLoss_341" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_304" xlink:to="loc_us-gaap_NetIncomeLoss_341" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PaymentsToAcquireBusinessesGross" xlink:label="loc_us-gaap_PaymentsToAcquireBusinessesGross_325" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_304" xlink:to="loc_us-gaap_PaymentsToAcquireBusinessesGross_325" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Revenues" xlink:label="loc_us-gaap_Revenues_340" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_304" xlink:to="loc_us-gaap_Revenues_340" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_315" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_304" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_315" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_CounterpartyNameAxis" xlink:label="loc_srt_CounterpartyNameAxis_305" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_315" xlink:to="loc_srt_CounterpartyNameAxis_305" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RepurchaseAgreementCounterpartyNameDomain" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_314" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_CounterpartyNameAxis_305" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_314" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RepurchaseAgreementCounterpartyNameDomain" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_314_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_CounterpartyNameAxis_305" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_314_default" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CreditFacilityAxis" xlink:label="loc_us-gaap_CreditFacilityAxis_306" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_315" xlink:to="loc_us-gaap_CreditFacilityAxis_306" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CreditFacilityDomain" xlink:label="loc_us-gaap_CreditFacilityDomain_307" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditFacilityAxis_306" xlink:to="loc_us-gaap_CreditFacilityDomain_307" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CreditFacilityDomain" xlink:label="loc_us-gaap_CreditFacilityDomain_307_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditFacilityAxis_306" xlink:to="loc_us-gaap_CreditFacilityDomain_307_default" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RevolvingCreditFacilityMember" xlink:label="loc_us-gaap_RevolvingCreditFacilityMember_342" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_307" xlink:to="loc_us-gaap_RevolvingCreditFacilityMember_342" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TermLoanMember" xlink:label="loc_mhh_TermLoanMember_343" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_307" xlink:to="loc_mhh_TermLoanMember_343" use="optional" order="16" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtInstrumentAxis" xlink:label="loc_us-gaap_DebtInstrumentAxis_308" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_315" xlink:to="loc_us-gaap_DebtInstrumentAxis_308" use="optional" order="17" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtInstrumentNameDomain" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_309" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_308" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_309" use="optional" order="18" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtInstrumentNameDomain" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_309_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_308" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_309_default" use="optional" order="19" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditFacilityAxis" xlink:label="loc_us-gaap_LineOfCreditFacilityAxis_310" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_315" xlink:to="loc_us-gaap_LineOfCreditFacilityAxis_310" use="optional" order="20" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditFacilityLenderDomain" xlink:label="loc_us-gaap_LineOfCreditFacilityLenderDomain_311" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LineOfCreditFacilityAxis_310" xlink:to="loc_us-gaap_LineOfCreditFacilityLenderDomain_311" use="optional" order="21" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditFacilityLenderDomain" xlink:label="loc_us-gaap_LineOfCreditFacilityLenderDomain_311_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LineOfCreditFacilityAxis_310" xlink:to="loc_us-gaap_LineOfCreditFacilityLenderDomain_311_default" use="optional" order="22" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeAxis" xlink:label="loc_srt_RangeAxis_312" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_315" xlink:to="loc_srt_RangeAxis_312" use="optional" order="23" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_313" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_312" xlink:to="loc_srt_RangeMember_313" use="optional" order="24" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_313_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_312" xlink:to="loc_srt_RangeMember_313_default" use="optional" order="25" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_MaximumMember" xlink:label="loc_srt_MaximumMember_347" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_313" xlink:to="loc_srt_MaximumMember_347" use="optional" order="26" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAxis" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_303" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_315" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_303" use="optional" order="27" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_302" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_303" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_302" use="optional" order="28" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_302_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_303" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_302_default" use="optional" order="29" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_AmberLeafPartnersIncMember" xlink:label="loc_mhh_AmberLeafPartnersIncMember_856583" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_302" xlink:to="loc_mhh_AmberLeafPartnersIncMember_856583" use="optional" order="30" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TypeOfArrangementAxis" xlink:label="loc_us-gaap_TypeOfArrangementAxis_316" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_315" xlink:to="loc_us-gaap_TypeOfArrangementAxis_316" use="optional" order="31" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ArrangementsAndNonarrangementTransactionsMember" xlink:label="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_301" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_TypeOfArrangementAxis_316" xlink:to="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_301" use="optional" order="32" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ArrangementsAndNonarrangementTransactionsMember" xlink:label="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_301_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_TypeOfArrangementAxis_316" xlink:to="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_301_default" use="optional" order="33" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditFacilityIncreaseDecreaseForPeriodNet" xlink:label="loc_us-gaap_LineOfCreditFacilityIncreaseDecreaseForPeriodNet_856591" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_304" xlink:to="loc_us-gaap_LineOfCreditFacilityIncreaseDecreaseForPeriodNet_856591" use="optional" order="34" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_WriteOffOfDeferredDebtIssuanceCost" xlink:label="loc_us-gaap_WriteOffOfDeferredDebtIssuanceCost_856602" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_304" xlink:to="loc_us-gaap_WriteOffOfDeferredDebtIssuanceCost_856602" use="optional" order="35" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/BusinessCombinationsSummaryOfFairValueOfConsiderationForAcquiredBusinessDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionLineItems" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_353" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationConsiderationTransferredIncludingEquityInterestInAcquireeHeldPriorToCombination1" xlink:label="loc_us-gaap_BusinessCombinationConsiderationTransferredIncludingEquityInterestInAcquireeHeldPriorToCombination1_359" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_353" xlink:to="loc_us-gaap_BusinessCombinationConsiderationTransferredIncludingEquityInterestInAcquireeHeldPriorToCombination1_359" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationLiability" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_358" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_353" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_358" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred" xlink:label="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred_357" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_353" xlink:to="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred_357" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PaymentsToAcquireBusinessesGross" xlink:label="loc_us-gaap_PaymentsToAcquireBusinessesGross_356" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_353" xlink:to="loc_us-gaap_PaymentsToAcquireBusinessesGross_356" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_354" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_353" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_354" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAxis" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_352" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_354" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_352" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_351" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_352" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_351" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_351_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_352" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_351_default" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_AmberLeafPartnersIncMember" xlink:label="loc_mhh_AmberLeafPartnersIncMember_857743" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_351" xlink:to="loc_mhh_AmberLeafPartnersIncMember_857743" use="optional" order="9" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/BusinessCombinationsSummaryOfFairValueOfConsiderationForAcquiredBusinessParentheticalDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionLineItems" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_364" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationLiability" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_367" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_364" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_367" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_365" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_364" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_365" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAxis" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_363" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_365" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_363" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_362" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_363" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_362" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_362_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_363" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_362_default" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_AmberLeafPartnersIncMember" xlink:label="loc_mhh_AmberLeafPartnersIncMember_857746" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_362" xlink:to="loc_mhh_AmberLeafPartnersIncMember_857746" use="optional" order="6" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/BusinessCombinationsSummaryOfSourceOfFundsDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionLineItems" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_372" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Cash" xlink:label="loc_us-gaap_Cash_377" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_372" xlink:to="loc_us-gaap_Cash_377" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCredit" xlink:label="loc_us-gaap_LineOfCredit_379" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_372" xlink:to="loc_us-gaap_LineOfCredit_379" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PaymentsToAcquireBusinessesGross" xlink:label="loc_us-gaap_PaymentsToAcquireBusinessesGross_381" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_372" xlink:to="loc_us-gaap_PaymentsToAcquireBusinessesGross_381" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_375" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_372" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_375" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAxis" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_371" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_375" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_371" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_370" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_371" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_370" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_370_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_371" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_370_default" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_AmberLeafPartnersIncMember" xlink:label="loc_mhh_AmberLeafPartnersIncMember_856571" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_370" xlink:to="loc_mhh_AmberLeafPartnersIncMember_856571" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CreditFacilityAxis" xlink:label="loc_us-gaap_CreditFacilityAxis_373" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_375" xlink:to="loc_us-gaap_CreditFacilityAxis_373" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CreditFacilityDomain" xlink:label="loc_us-gaap_CreditFacilityDomain_374" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditFacilityAxis_373" xlink:to="loc_us-gaap_CreditFacilityDomain_374" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CreditFacilityDomain" xlink:label="loc_us-gaap_CreditFacilityDomain_374_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditFacilityAxis_373" xlink:to="loc_us-gaap_CreditFacilityDomain_374_default" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RevolvingCreditFacilityMember" xlink:label="loc_us-gaap_RevolvingCreditFacilityMember_383" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_374" xlink:to="loc_us-gaap_RevolvingCreditFacilityMember_383" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TermLoanDebtFacilityMember" xlink:label="loc_mhh_TermLoanDebtFacilityMember_382" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_374" xlink:to="loc_mhh_TermLoanDebtFacilityMember_382" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditFacilityIncreaseDecreaseForPeriodNet" xlink:label="loc_us-gaap_LineOfCreditFacilityIncreaseDecreaseForPeriodNet_856567" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_372" xlink:to="loc_us-gaap_LineOfCreditFacilityIncreaseDecreaseForPeriodNet_856567" use="optional" order="14" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/BusinessCombinationsScheduleOfValuationOfNetAssetsAcquiredDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionLineItems" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_388" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwillAbstract" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwillAbstract_389" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_388" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwillAbstract_389" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_396" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwillAbstract_389" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_396" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_399" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwillAbstract_389" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_399" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Goodwill" xlink:label="loc_us-gaap_Goodwill_397" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwillAbstract_389" xlink:to="loc_us-gaap_Goodwill_397" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_392" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_388" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_392" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAxis" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_387" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_392" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_387" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_386" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_387" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_386" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_386_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_387" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_386_default" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_AmberLeafPartnersIncMember" xlink:label="loc_mhh_AmberLeafPartnersIncMember_856573" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_386" xlink:to="loc_mhh_AmberLeafPartnersIncMember_856573" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_390" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_392" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_390" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_391" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_390" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_391" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_391_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_390" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_391_default" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_CovenantNotToCompeteMember" xlink:label="loc_mhh_CovenantNotToCompeteMember_401" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_391" xlink:to="loc_mhh_CovenantNotToCompeteMember_401" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CustomerRelationshipsMember" xlink:label="loc_us-gaap_CustomerRelationshipsMember_400" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_391" xlink:to="loc_us-gaap_CustomerRelationshipsMember_400" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TechnologyBasedIntangibleAssetsMember" xlink:label="loc_us-gaap_TechnologyBasedIntangibleAssetsMember_403" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_391" xlink:to="loc_us-gaap_TechnologyBasedIntangibleAssetsMember_403" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TradeNamesMember" xlink:label="loc_us-gaap_TradeNamesMember_402" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_391" xlink:to="loc_us-gaap_TradeNamesMember_402" use="optional" order="16" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCashAndEquivalents" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCashAndEquivalents_856576" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_388" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCashAndEquivalents_856576" use="optional" order="17" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_856578" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_388" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_856578" use="optional" order="18" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/BusinessCombinationsSummaryOfUnauditedProFormaResultsDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionLineItems" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_408" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionProFormaEarningsPerShareDiluted" xlink:label="loc_us-gaap_BusinessAcquisitionProFormaEarningsPerShareDiluted_413" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_408" xlink:to="loc_us-gaap_BusinessAcquisitionProFormaEarningsPerShareDiluted_413" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionsProFormaNetIncomeLoss" xlink:label="loc_us-gaap_BusinessAcquisitionsProFormaNetIncomeLoss_412" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_408" xlink:to="loc_us-gaap_BusinessAcquisitionsProFormaNetIncomeLoss_412" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionsProFormaRevenue" xlink:label="loc_us-gaap_BusinessAcquisitionsProFormaRevenue_411" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_408" xlink:to="loc_us-gaap_BusinessAcquisitionsProFormaRevenue_411" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_409" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_408" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_409" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAxis" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_407" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_409" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_407" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_406" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_407" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_406" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_406_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_407" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_406_default" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_AmberLeafPartnersIncMember" xlink:label="loc_mhh_AmberLeafPartnersIncMember_856580" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_406" xlink:to="loc_mhh_AmberLeafPartnersIncMember_856580" use="optional" order="8" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/GoodwillAndOtherIntangibleAssetsNetAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_GoodwillAndIntangibleAssetsLineItems" xlink:label="loc_mhh_GoodwillAndIntangibleAssetsLineItems_418" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AmortizationOfIntangibleAssets" xlink:label="loc_us-gaap_AmortizationOfIntangibleAssets_424" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_GoodwillAndIntangibleAssetsLineItems_418" xlink:to="loc_us-gaap_AmortizationOfIntangibleAssets_424" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Goodwill" xlink:label="loc_us-gaap_Goodwill_422" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_GoodwillAndIntangibleAssetsLineItems_418" xlink:to="loc_us-gaap_Goodwill_422" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_GoodwillImpairmentLoss" xlink:label="loc_us-gaap_GoodwillImpairmentLoss_423" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_GoodwillAndIntangibleAssetsLineItems_418" xlink:to="loc_us-gaap_GoodwillImpairmentLoss_423" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ScheduleOfIntangibleAssetsAndGoodwillTable" xlink:label="loc_mhh_ScheduleOfIntangibleAssetsAndGoodwillTable_419" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_mhh_GoodwillAndIntangibleAssetsLineItems_418" xlink:to="loc_mhh_ScheduleOfIntangibleAssetsAndGoodwillTable_419" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAxis" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_417" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_mhh_ScheduleOfIntangibleAssetsAndGoodwillTable_419" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_417" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_416" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_417" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_416" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_416_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_417" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_416_default" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_HudsonItMember" xlink:label="loc_mhh_HudsonItMember_420" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_416" xlink:to="loc_mhh_HudsonItMember_420" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_InfoTrellisIncMember" xlink:label="loc_mhh_InfoTrellisIncMember_421" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_416" xlink:to="loc_mhh_InfoTrellisIncMember_421" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_AmberLeafPartnersIncMember" xlink:label="loc_mhh_AmberLeafPartnersIncMember_856645" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_416" xlink:to="loc_mhh_AmberLeafPartnersIncMember_856645" use="optional" order="10" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/GoodwillAndOtherIntangibleAssetsNetReconciliationOfGoodwillDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementLineItems" xlink:label="loc_us-gaap_StatementLineItems_426393" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_GoodwillAcquiredDuringPeriod" xlink:label="loc_us-gaap_GoodwillAcquiredDuringPeriod_428" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_426393" xlink:to="loc_us-gaap_GoodwillAcquiredDuringPeriod_428" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_GoodwillImpairmentLoss" xlink:label="loc_us-gaap_GoodwillImpairmentLoss_426388" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_426393" xlink:to="loc_us-gaap_GoodwillImpairmentLoss_426388" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementTable" xlink:label="loc_us-gaap_StatementTable_426390" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_426393" xlink:to="loc_us-gaap_StatementTable_426390" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementBusinessSegmentsAxis" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_426416" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_426390" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_426416" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_426417" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_426416" xlink:to="loc_us-gaap_SegmentDomain_426417" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_426417_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_426416" xlink:to="loc_us-gaap_SegmentDomain_426417_default" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ITStaffingServicesMember" xlink:label="loc_mhh_ITStaffingServicesMember_426419" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_426417" xlink:to="loc_mhh_ITStaffingServicesMember_426419" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_DataAndAnalyticsServicesMember" xlink:label="loc_mhh_DataAndAnalyticsServicesMember_426418" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_426417" xlink:to="loc_mhh_DataAndAnalyticsServicesMember_426418" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Goodwill" xlink:label="loc_us-gaap_Goodwill_657602" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_426393" xlink:to="loc_us-gaap_Goodwill_657602" use="optional" order="9" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/GoodwillAndOtherIntangibleAssetsComponentsOfIdentifiableIntangibleAssetsDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementLineItems" xlink:label="loc_us-gaap_StatementLineItems_429583" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementTable" xlink:label="loc_us-gaap_StatementTable_429580" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_429583" xlink:to="loc_us-gaap_StatementTable_429580" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementClassOfStockAxis" xlink:label="loc_us-gaap_StatementClassOfStockAxis_429581" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_429580" xlink:to="loc_us-gaap_StatementClassOfStockAxis_429581" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ClassOfStockDomain" xlink:label="loc_us-gaap_ClassOfStockDomain_429582" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_429581" xlink:to="loc_us-gaap_ClassOfStockDomain_429582" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ClassOfStockDomain" xlink:label="loc_us-gaap_ClassOfStockDomain_429582_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_429581" xlink:to="loc_us-gaap_ClassOfStockDomain_429582_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementBusinessSegmentsAxis" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_429593" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_429580" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_429593" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_429594" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_429593" xlink:to="loc_us-gaap_SegmentDomain_429594" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_429594_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_429593" xlink:to="loc_us-gaap_SegmentDomain_429594_default" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ITStaffingServicesMember" xlink:label="loc_mhh_ITStaffingServicesMember_429595" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_429594" xlink:to="loc_mhh_ITStaffingServicesMember_429595" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_DataAndAnalyticsServicesMember" xlink:label="loc_mhh_DataAndAnalyticsServicesMember_429596" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_429594" xlink:to="loc_mhh_DataAndAnalyticsServicesMember_429596" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_429597" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_429580" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_429597" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_429598" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_429597" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_429598" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_429598_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_429597" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_429598_default" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CustomerRelationshipsMember" xlink:label="loc_us-gaap_CustomerRelationshipsMember_429599" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_429598" xlink:to="loc_us-gaap_CustomerRelationshipsMember_429599" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_CovenantNotToCompeteMember" xlink:label="loc_mhh_CovenantNotToCompeteMember_429600" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_429598" xlink:to="loc_mhh_CovenantNotToCompeteMember_429600" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TradeNamesMember" xlink:label="loc_us-gaap_TradeNamesMember_429601" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_429598" xlink:to="loc_us-gaap_TradeNamesMember_429601" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TechnologyBasedIntangibleAssetsMember" xlink:label="loc_us-gaap_TechnologyBasedIntangibleAssetsMember_429603" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_429598" xlink:to="loc_us-gaap_TechnologyBasedIntangibleAssetsMember_429603" use="optional" order="16" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_429584" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_429583" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_429584" use="optional" order="17" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsGross" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsGross_429585" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_429583" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsGross_429585" use="optional" order="18" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_429586" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_429583" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_429586" use="optional" order="19" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsNet" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsNet_429587" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_429583" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsNet_429587" use="optional" order="20" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IntangibleAssetsGrossExcludingGoodwill" xlink:label="loc_us-gaap_IntangibleAssetsGrossExcludingGoodwill_429588" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_429583" xlink:to="loc_us-gaap_IntangibleAssetsGrossExcludingGoodwill_429588" use="optional" order="21" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IntangibleAssetsNetExcludingGoodwill" xlink:label="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_429591" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_429583" xlink:to="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_429591" use="optional" order="22" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/CreditFacilityAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditFacilityLineItems" xlink:label="loc_us-gaap_LineOfCreditFacilityLineItems_470" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtInstrumentBasisSpreadOnVariableRate1" xlink:label="loc_us-gaap_DebtInstrumentBasisSpreadOnVariableRate1_496" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_us-gaap_DebtInstrumentBasisSpreadOnVariableRate1_496" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DeferredFinanceCostsNoncurrentNet" xlink:label="loc_us-gaap_DeferredFinanceCostsNoncurrentNet_503" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_us-gaap_DeferredFinanceCostsNoncurrentNet_503" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCredit" xlink:label="loc_us-gaap_LineOfCredit_505" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_us-gaap_LineOfCredit_505" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_LineOfCreditFacilityAdditionalBorrowingCapacityUponCertainConditions" xlink:label="loc_mhh_LineOfCreditFacilityAdditionalBorrowingCapacityUponCertainConditions_487" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_mhh_LineOfCreditFacilityAdditionalBorrowingCapacityUponCertainConditions_487" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtInstrumentUnusedBorrowingCapacityAmount" xlink:label="loc_us-gaap_DebtInstrumentUnusedBorrowingCapacityAmount_491" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_us-gaap_DebtInstrumentUnusedBorrowingCapacityAmount_491" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity" xlink:label="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_486" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_486" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditFacilityTable" xlink:label="loc_us-gaap_LineOfCreditFacilityTable_471" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_us-gaap_LineOfCreditFacilityTable_471" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CreditFacilityAxis" xlink:label="loc_us-gaap_CreditFacilityAxis_464" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_471" xlink:to="loc_us-gaap_CreditFacilityAxis_464" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CreditFacilityDomain" xlink:label="loc_us-gaap_CreditFacilityDomain_465" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditFacilityAxis_464" xlink:to="loc_us-gaap_CreditFacilityDomain_465" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CreditFacilityDomain" xlink:label="loc_us-gaap_CreditFacilityDomain_465_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditFacilityAxis_464" xlink:to="loc_us-gaap_CreditFacilityDomain_465_default" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RevolvingCreditFacilityMember" xlink:label="loc_us-gaap_RevolvingCreditFacilityMember_482" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_465" xlink:to="loc_us-gaap_RevolvingCreditFacilityMember_482" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TermLoanMember" xlink:label="loc_mhh_TermLoanMember_480" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_465" xlink:to="loc_mhh_TermLoanMember_480" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtInstrumentAxis" xlink:label="loc_us-gaap_DebtInstrumentAxis_466" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_471" xlink:to="loc_us-gaap_DebtInstrumentAxis_466" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtInstrumentNameDomain" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_467" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_466" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_467" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtInstrumentNameDomain" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_467_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_466" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_467_default" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditMember" xlink:label="loc_us-gaap_LineOfCreditMember_483" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_467" xlink:to="loc_us-gaap_LineOfCreditMember_483" use="optional" order="16" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_SwingLoansMember" xlink:label="loc_mhh_SwingLoansMember_484" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_467" xlink:to="loc_mhh_SwingLoansMember_484" use="optional" order="17" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditFacilityAxis" xlink:label="loc_us-gaap_LineOfCreditFacilityAxis_468" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_471" xlink:to="loc_us-gaap_LineOfCreditFacilityAxis_468" use="optional" order="18" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditFacilityLenderDomain" xlink:label="loc_us-gaap_LineOfCreditFacilityLenderDomain_469" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LineOfCreditFacilityAxis_468" xlink:to="loc_us-gaap_LineOfCreditFacilityLenderDomain_469" use="optional" order="19" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditFacilityLenderDomain" xlink:label="loc_us-gaap_LineOfCreditFacilityLenderDomain_469_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LineOfCreditFacilityAxis_468" xlink:to="loc_us-gaap_LineOfCreditFacilityLenderDomain_469_default" use="optional" order="20" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_PncBankNaMember" xlink:label="loc_mhh_PncBankNaMember_485" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLenderDomain_469" xlink:to="loc_mhh_PncBankNaMember_485" use="optional" order="21" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LongtermDebtTypeAxis" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_472" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_471" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_472" use="optional" order="22" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LongtermDebtTypeDomain" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_473" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_472" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_473" use="optional" order="23" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LongtermDebtTypeDomain" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_473_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_472" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_473_default" use="optional" order="24" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeAxis" xlink:label="loc_srt_RangeAxis_474" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_471" xlink:to="loc_srt_RangeAxis_474" use="optional" order="25" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_475" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_474" xlink:to="loc_srt_RangeMember_475" use="optional" order="26" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_475_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_474" xlink:to="loc_srt_RangeMember_475_default" use="optional" order="27" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_MaximumMember" xlink:label="loc_srt_MaximumMember_511" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_475" xlink:to="loc_srt_MaximumMember_511" use="optional" order="28" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_MinimumMember" xlink:label="loc_srt_MinimumMember_512" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_475" xlink:to="loc_srt_MinimumMember_512" use="optional" order="29" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_StatementGeographicalAxis" xlink:label="loc_srt_StatementGeographicalAxis_477" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_471" xlink:to="loc_srt_StatementGeographicalAxis_477" use="optional" order="30" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_SegmentGeographicalDomain" xlink:label="loc_srt_SegmentGeographicalDomain_476" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementGeographicalAxis_477" xlink:to="loc_srt_SegmentGeographicalDomain_476" use="optional" order="31" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_SegmentGeographicalDomain" xlink:label="loc_srt_SegmentGeographicalDomain_476_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementGeographicalAxis_477" xlink:to="loc_srt_SegmentGeographicalDomain_476_default" use="optional" order="32" />
<loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/country/2020/country-2020-01-31.xsd#country_CA" xlink:label="loc_country_CA_514" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_476" xlink:to="loc_country_CA_514" use="optional" order="33" />
<loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/country/2020/country-2020-01-31.xsd#country_US" xlink:label="loc_country_US_513" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_476" xlink:to="loc_country_US_513" use="optional" order="34" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_VariableRateAxis" xlink:label="loc_us-gaap_VariableRateAxis_478" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_471" xlink:to="loc_us-gaap_VariableRateAxis_478" use="optional" order="35" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_VariableRateDomain" xlink:label="loc_us-gaap_VariableRateDomain_479" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_VariableRateAxis_478" xlink:to="loc_us-gaap_VariableRateDomain_479" use="optional" order="36" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_VariableRateDomain" xlink:label="loc_us-gaap_VariableRateDomain_479_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_VariableRateAxis_478" xlink:to="loc_us-gaap_VariableRateDomain_479_default" use="optional" order="37" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_FederalFundsRateMember" xlink:label="loc_mhh_FederalFundsRateMember_515" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_VariableRateDomain_479" xlink:to="loc_mhh_FederalFundsRateMember_515" use="optional" order="38" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_LIBORFloorRateMember" xlink:label="loc_mhh_LIBORFloorRateMember_856728" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_VariableRateDomain_479" xlink:to="loc_mhh_LIBORFloorRateMember_856728" use="optional" order="39" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SubsequentEventTypeAxis" xlink:label="loc_us-gaap_SubsequentEventTypeAxis_656142" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_471" xlink:to="loc_us-gaap_SubsequentEventTypeAxis_656142" use="optional" order="40" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SubsequentEventTypeDomain" xlink:label="loc_us-gaap_SubsequentEventTypeDomain_656143" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_SubsequentEventTypeAxis_656142" xlink:to="loc_us-gaap_SubsequentEventTypeDomain_656143" use="optional" order="41" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SubsequentEventTypeDomain" xlink:label="loc_us-gaap_SubsequentEventTypeDomain_656143_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_SubsequentEventTypeAxis_656142" xlink:to="loc_us-gaap_SubsequentEventTypeDomain_656143_default" use="optional" order="42" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PaymentsOfFinancingCosts" xlink:label="loc_us-gaap_PaymentsOfFinancingCosts_502" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_us-gaap_PaymentsOfFinancingCosts_502" use="optional" order="43" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_PercentageOfEligibleAccountsReceivableUsedToDetermineBorrowingsAvailableUnderCreditFacility" xlink:label="loc_mhh_PercentageOfEligibleAccountsReceivableUsedToDetermineBorrowingsAvailableUnderCreditFacility_489" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_mhh_PercentageOfEligibleAccountsReceivableUsedToDetermineBorrowingsAvailableUnderCreditFacility_489" use="optional" order="44" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_PercentageOfEligibleUnbilledAccountsUsedToDetermineBorrowingsAvailableUnderCreditFacility" xlink:label="loc_mhh_PercentageOfEligibleUnbilledAccountsUsedToDetermineBorrowingsAvailableUnderCreditFacility_490" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_mhh_PercentageOfEligibleUnbilledAccountsUsedToDetermineBorrowingsAvailableUnderCreditFacility_490" use="optional" order="45" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_RevolvingCreditFacilityPercentageMarginAdjustedLiborRate" xlink:label="loc_mhh_RevolvingCreditFacilityPercentageMarginAdjustedLiborRate_499" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_mhh_RevolvingCreditFacilityPercentageMarginAdjustedLiborRate_499" use="optional" order="46" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_RevolvingCreditFacilityPercentageMarginOverBaseRate" xlink:label="loc_mhh_RevolvingCreditFacilityPercentageMarginOverBaseRate_497" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_mhh_RevolvingCreditFacilityPercentageMarginOverBaseRate_497" use="optional" order="47" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TermLoanPercentageMarginAdjustedLiborRate" xlink:label="loc_mhh_TermLoanPercentageMarginAdjustedLiborRate_500" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_mhh_TermLoanPercentageMarginAdjustedLiborRate_500" use="optional" order="48" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TermLoanPercentageMarginOverBaseRate" xlink:label="loc_mhh_TermLoanPercentageMarginOverBaseRate_498" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_mhh_TermLoanPercentageMarginOverBaseRate_498" use="optional" order="49" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TermLoanEarlyPaid" xlink:label="loc_mhh_TermLoanEarlyPaid_656154" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_mhh_TermLoanEarlyPaid_656154" use="optional" order="50" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_DebtInstrumentPercentageAdjustedLiborFloorRate" xlink:label="loc_mhh_DebtInstrumentPercentageAdjustedLiborFloorRate_856734" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_mhh_DebtInstrumentPercentageAdjustedLiborFloorRate_856734" use="optional" order="51" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LineOfCreditFacilityPeriodicPayment" xlink:label="loc_us-gaap_LineOfCreditFacilityPeriodicPayment_858358" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_470" xlink:to="loc_us-gaap_LineOfCreditFacilityPeriodicPayment_858358" use="optional" order="52" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/LeasesAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementLineItems" xlink:label="loc_us-gaap_StatementLineItems_427927" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementTable" xlink:label="loc_us-gaap_StatementTable_427924" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_427927" xlink:to="loc_us-gaap_StatementTable_427924" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementClassOfStockAxis" xlink:label="loc_us-gaap_StatementClassOfStockAxis_427925" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_427924" xlink:to="loc_us-gaap_StatementClassOfStockAxis_427925" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ClassOfStockDomain" xlink:label="loc_us-gaap_ClassOfStockDomain_427926" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_427925" xlink:to="loc_us-gaap_ClassOfStockDomain_427926" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ClassOfStockDomain" xlink:label="loc_us-gaap_ClassOfStockDomain_427926_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_427925" xlink:to="loc_us-gaap_ClassOfStockDomain_427926_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeAxis" xlink:label="loc_srt_RangeAxis_428072" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_427924" xlink:to="loc_srt_RangeAxis_428072" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_428073" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_428072" xlink:to="loc_srt_RangeMember_428073" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_428073_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_428072" xlink:to="loc_srt_RangeMember_428073_default" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_MinimumMember" xlink:label="loc_srt_MinimumMember_428074" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_428073" xlink:to="loc_srt_MinimumMember_428074" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_MaximumMember" xlink:label="loc_srt_MaximumMember_428075" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_428073" xlink:to="loc_srt_MaximumMember_428075" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_WeightedAverageMember" xlink:label="loc_srt_WeightedAverageMember_428076" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_428073" xlink:to="loc_srt_WeightedAverageMember_428076" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LesseeOperatingLeaseDiscountRate" xlink:label="loc_us-gaap_LesseeOperatingLeaseDiscountRate_427928" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427927" xlink:to="loc_us-gaap_LesseeOperatingLeaseDiscountRate_427928" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeasesRentExpenseNet" xlink:label="loc_us-gaap_OperatingLeasesRentExpenseNet_427929" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427927" xlink:to="loc_us-gaap_OperatingLeasesRentExpenseNet_427929" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeaseLiability" xlink:label="loc_us-gaap_OperatingLeaseLiability_427933" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427927" xlink:to="loc_us-gaap_OperatingLeaseLiability_427933" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AreaOfLand" xlink:label="loc_us-gaap_AreaOfLand_428069" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427927" xlink:to="loc_us-gaap_AreaOfLand_428069" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LesseeOperatingLeaseTermOfContract" xlink:label="loc_us-gaap_LesseeOperatingLeaseTermOfContract_428070" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427927" xlink:to="loc_us-gaap_LesseeOperatingLeaseTermOfContract_428070" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_LesseeOperatingLeasesRenewalTerm" xlink:label="loc_mhh_LesseeOperatingLeasesRenewalTerm_428077" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427927" xlink:to="loc_mhh_LesseeOperatingLeasesRenewalTerm_428077" use="optional" order="16" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeasePayments" xlink:label="loc_us-gaap_OperatingLeasePayments_855582" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427927" xlink:to="loc_us-gaap_OperatingLeasePayments_855582" use="optional" order="17" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CapitalLeaseObligationsIncurred" xlink:label="loc_us-gaap_CapitalLeaseObligationsIncurred_855583" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427927" xlink:to="loc_us-gaap_CapitalLeaseObligationsIncurred_855583" use="optional" order="18" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/LeasesSummaryOfBalanceSheetClassificationOfLeaseAssetAndRelatedLeaseLiabilityDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementLineItems" xlink:label="loc_us-gaap_StatementLineItems_427867" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementTable" xlink:label="loc_us-gaap_StatementTable_427864" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_427867" xlink:to="loc_us-gaap_StatementTable_427864" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementClassOfStockAxis" xlink:label="loc_us-gaap_StatementClassOfStockAxis_427865" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_427864" xlink:to="loc_us-gaap_StatementClassOfStockAxis_427865" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ClassOfStockDomain" xlink:label="loc_us-gaap_ClassOfStockDomain_427866" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_427865" xlink:to="loc_us-gaap_ClassOfStockDomain_427866" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ClassOfStockDomain" xlink:label="loc_us-gaap_ClassOfStockDomain_427866_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_427865" xlink:to="loc_us-gaap_ClassOfStockDomain_427866_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BalanceSheetLocationAxis" xlink:label="loc_us-gaap_BalanceSheetLocationAxis_427869" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_427864" xlink:to="loc_us-gaap_BalanceSheetLocationAxis_427869" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BalanceSheetLocationDomain" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_427870" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_427869" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_427870" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BalanceSheetLocationDomain" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_427870_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_427869" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_427870_default" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AssetsAbstract" xlink:label="loc_us-gaap_AssetsAbstract_427881" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427867" xlink:to="loc_us-gaap_AssetsAbstract_427881" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeaseRightOfUseAsset" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_427884" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_427881" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_427884" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LiabilitiesAbstract" xlink:label="loc_us-gaap_LiabilitiesAbstract_427886" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427867" xlink:to="loc_us-gaap_LiabilitiesAbstract_427886" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeaseLiabilityCurrent" xlink:label="loc_us-gaap_OperatingLeaseLiabilityCurrent_427887" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAbstract_427886" xlink:to="loc_us-gaap_OperatingLeaseLiabilityCurrent_427887" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:label="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_427889" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAbstract_427886" xlink:to="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_427889" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeaseLiability" xlink:label="loc_us-gaap_OperatingLeaseLiability_427890" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAbstract_427886" xlink:to="loc_us-gaap_OperatingLeaseLiability_427890" use="optional" order="13" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/LeasesScheduleOfFutureMinimumRentalPaymentsForOperatingLeasesDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementLineItems" xlink:label="loc_us-gaap_StatementLineItems_427909" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementTable" xlink:label="loc_us-gaap_StatementTable_427906" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_427909" xlink:to="loc_us-gaap_StatementTable_427906" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementClassOfStockAxis" xlink:label="loc_us-gaap_StatementClassOfStockAxis_427907" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_427906" xlink:to="loc_us-gaap_StatementClassOfStockAxis_427907" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ClassOfStockDomain" xlink:label="loc_us-gaap_ClassOfStockDomain_427908" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_427907" xlink:to="loc_us-gaap_ClassOfStockDomain_427908" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ClassOfStockDomain" xlink:label="loc_us-gaap_ClassOfStockDomain_427908_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_427907" xlink:to="loc_us-gaap_ClassOfStockDomain_427908_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableInTwoYears" xlink:label="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableInTwoYears_427911" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427909" xlink:to="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableInTwoYears_427911" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableInThreeYears" xlink:label="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableInThreeYears_427912" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427909" xlink:to="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableInThreeYears_427912" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableInFourYears" xlink:label="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableInFourYears_427913" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427909" xlink:to="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableInFourYears_427913" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableInFiveYears" xlink:label="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableInFiveYears_427914" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427909" xlink:to="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableInFiveYears_427914" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableThereafter" xlink:label="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableThereafter_427915" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427909" xlink:to="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableThereafter_427915" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ImputedInterestInRespectOfOperatingLeasesFutureMinimumRentalsPayable" xlink:label="loc_mhh_ImputedInterestInRespectOfOperatingLeasesFutureMinimumRentalsPayable_427918" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427909" xlink:to="loc_mhh_ImputedInterestInRespectOfOperatingLeasesFutureMinimumRentalsPayable_427918" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeaseLiability" xlink:label="loc_us-gaap_OperatingLeaseLiability_427920" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427909" xlink:to="loc_us-gaap_OperatingLeaseLiability_427920" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableCurrent" xlink:label="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableCurrent_656179" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427909" xlink:to="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivableCurrent_656179" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeasesFutureMinimumPaymentsReceivable" xlink:label="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivable_657499" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_427909" xlink:to="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsReceivable_657499" use="optional" order="13" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/LongTermPayrollTaxLiabilityAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementLineItems" xlink:label="loc_us-gaap_StatementLineItems_856889" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementTable" xlink:label="loc_us-gaap_StatementTable_856886" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_856889" xlink:to="loc_us-gaap_StatementTable_856886" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TaxSupportToEntityReliefActAxis" xlink:label="loc_mhh_TaxSupportToEntityReliefActAxis_856892" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_856886" xlink:to="loc_mhh_TaxSupportToEntityReliefActAxis_856892" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TaxSupportToEntityReliefActDomain" xlink:label="loc_mhh_TaxSupportToEntityReliefActDomain_856906" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_mhh_TaxSupportToEntityReliefActAxis_856892" xlink:to="loc_mhh_TaxSupportToEntityReliefActDomain_856906" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TaxSupportToEntityReliefActDomain" xlink:label="loc_mhh_TaxSupportToEntityReliefActDomain_856906_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_mhh_TaxSupportToEntityReliefActAxis_856892" xlink:to="loc_mhh_TaxSupportToEntityReliefActDomain_856906_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_CoronavirusAidReliefAndEconomicSecurityActMember" xlink:label="loc_mhh_CoronavirusAidReliefAndEconomicSecurityActMember_857944" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_TaxSupportToEntityReliefActDomain_856906" xlink:to="loc_mhh_CoronavirusAidReliefAndEconomicSecurityActMember_857944" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TypeOfSecurityTaxAxis" xlink:label="loc_mhh_TypeOfSecurityTaxAxis_856896" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_856886" xlink:to="loc_mhh_TypeOfSecurityTaxAxis_856896" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TypeOfSecurityTaxDomain" xlink:label="loc_mhh_TypeOfSecurityTaxDomain_856909" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_mhh_TypeOfSecurityTaxAxis_856896" xlink:to="loc_mhh_TypeOfSecurityTaxDomain_856909" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_TypeOfSecurityTaxDomain" xlink:label="loc_mhh_TypeOfSecurityTaxDomain_856909_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_mhh_TypeOfSecurityTaxAxis_856896" xlink:to="loc_mhh_TypeOfSecurityTaxDomain_856909_default" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_SocialSecurityTaxMember" xlink:label="loc_mhh_SocialSecurityTaxMember_856912" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_TypeOfSecurityTaxDomain_856909" xlink:to="loc_mhh_SocialSecurityTaxMember_856912" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_BalancesheetlocationaxisAxis" xlink:label="loc_mhh_BalancesheetlocationaxisAxis_856914" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_856886" xlink:to="loc_mhh_BalancesheetlocationaxisAxis_856914" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_BalancesheetlocationaxisDomain" xlink:label="loc_mhh_BalancesheetlocationaxisDomain_856916" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_mhh_BalancesheetlocationaxisAxis_856914" xlink:to="loc_mhh_BalancesheetlocationaxisDomain_856916" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_BalancesheetlocationaxisDomain" xlink:label="loc_mhh_BalancesheetlocationaxisDomain_856916_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_mhh_BalancesheetlocationaxisAxis_856914" xlink:to="loc_mhh_BalancesheetlocationaxisDomain_856916_default" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_AccruedPayrollAndRelatedCostMember" xlink:label="loc_mhh_AccruedPayrollAndRelatedCostMember_856917" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_BalancesheetlocationaxisDomain_856916" xlink:to="loc_mhh_AccruedPayrollAndRelatedCostMember_856917" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_LongTermPayrollTaxLiabiitiesMember" xlink:label="loc_mhh_LongTermPayrollTaxLiabiitiesMember_856918" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_BalancesheetlocationaxisDomain_856916" xlink:to="loc_mhh_LongTermPayrollTaxLiabiitiesMember_856918" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DeferredTaxLiabilities" xlink:label="loc_us-gaap_DeferredTaxLiabilities_856920" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_856889" xlink:to="loc_us-gaap_DeferredTaxLiabilities_856920" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_RepaymentOfDefferedTaxLiabilities" xlink:label="loc_mhh_RepaymentOfDefferedTaxLiabilities_856923" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_856889" xlink:to="loc_mhh_RepaymentOfDefferedTaxLiabilities_856923" use="optional" order="16" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DeferredLongTermLiabilityCharges" xlink:label="loc_us-gaap_DeferredLongTermLiabilityCharges_856925" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_856889" xlink:to="loc_us-gaap_DeferredLongTermLiabilityCharges_856925" use="optional" order="17" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/EmployeeBenefitPlanAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DefinedBenefitPlanDisclosureLineItems" xlink:label="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_538" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DefinedBenefitPlanContributionsByEmployer" xlink:label="loc_us-gaap_DefinedBenefitPlanContributionsByEmployer_545" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_538" xlink:to="loc_us-gaap_DefinedBenefitPlanContributionsByEmployer_545" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DefinedContributionPlanEmployerDiscretionaryContributionAmount" xlink:label="loc_us-gaap_DefinedContributionPlanEmployerDiscretionaryContributionAmount_542" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_538" xlink:to="loc_us-gaap_DefinedContributionPlanEmployerDiscretionaryContributionAmount_542" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch" xlink:label="loc_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch_543" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_538" xlink:to="loc_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch_543" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_DefinedContributionPlanPercentageOfEmployeesEligibleEarningsFirstSlabForCompanyMatchingContribution" xlink:label="loc_mhh_DefinedContributionPlanPercentageOfEmployeesEligibleEarningsFirstSlabForCompanyMatchingContribution_544" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_538" xlink:to="loc_mhh_DefinedContributionPlanPercentageOfEmployeesEligibleEarningsFirstSlabForCompanyMatchingContribution_544" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable" xlink:label="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_541" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_538" xlink:to="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_541" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RetirementPlanNameAxis" xlink:label="loc_us-gaap_RetirementPlanNameAxis_539" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_541" xlink:to="loc_us-gaap_RetirementPlanNameAxis_539" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RetirementPlanNameDomain" xlink:label="loc_us-gaap_RetirementPlanNameDomain_540" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RetirementPlanNameAxis_539" xlink:to="loc_us-gaap_RetirementPlanNameDomain_540" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RetirementPlanNameDomain" xlink:label="loc_us-gaap_RetirementPlanNameDomain_540_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RetirementPlanNameAxis_539" xlink:to="loc_us-gaap_RetirementPlanNameDomain_540_default" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_HudsonEmployeeRetirementSavingsPlanMember" xlink:label="loc_mhh_HudsonEmployeeRetirementSavingsPlanMember_546" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanNameDomain_540" xlink:to="loc_mhh_HudsonEmployeeRetirementSavingsPlanMember_546" use="optional" order="9" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/StockBasedCompensationAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_552" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_552" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AwardTypeAxis" xlink:label="loc_us-gaap_AwardTypeAxis_549" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_552" xlink:to="loc_us-gaap_AwardTypeAxis_549" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_554" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_549" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_554" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_554_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_549" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_554_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RestrictedStockMember" xlink:label="loc_us-gaap_RestrictedStockMember_583" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_554" xlink:to="loc_us-gaap_RestrictedStockMember_583" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RestrictedStockUnitsRSUMember" xlink:label="loc_us-gaap_RestrictedStockUnitsRSUMember_584" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_554" xlink:to="loc_us-gaap_RestrictedStockUnitsRSUMember_584" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_EmployeeStockPurchasePlanMember" xlink:label="loc_mhh_EmployeeStockPurchasePlanMember_428292" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_554" xlink:to="loc_mhh_EmployeeStockPurchasePlanMember_428292" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PerformanceSharesMember" xlink:label="loc_us-gaap_PerformanceSharesMember_656201" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_554" xlink:to="loc_us-gaap_PerformanceSharesMember_656201" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EmployeeStockOptionMember" xlink:label="loc_us-gaap_EmployeeStockOptionMember_656202" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_554" xlink:to="loc_us-gaap_EmployeeStockOptionMember_656202" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeAxis" xlink:label="loc_srt_RangeAxis_550" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_552" xlink:to="loc_srt_RangeAxis_550" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_551" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_550" xlink:to="loc_srt_RangeMember_551" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_551_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_550" xlink:to="loc_srt_RangeMember_551_default" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_MaximumMember" xlink:label="loc_srt_MaximumMember_556" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_551" xlink:to="loc_srt_MaximumMember_556" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_MinimumMember" xlink:label="loc_srt_MinimumMember_555" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_551" xlink:to="loc_srt_MinimumMember_555" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_TitleOfIndividualAxis" xlink:label="loc_srt_TitleOfIndividualAxis_428249" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_552" xlink:to="loc_srt_TitleOfIndividualAxis_428249" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_TitleOfIndividualWithRelationshipToEntityDomain" xlink:label="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_428250" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_TitleOfIndividualAxis_428249" xlink:to="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_428250" use="optional" order="16" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_TitleOfIndividualWithRelationshipToEntityDomain" xlink:label="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_428250_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_TitleOfIndividualAxis_428249" xlink:to="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_428250_default" use="optional" order="17" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensation" xlink:label="loc_us-gaap_ShareBasedCompensation_576" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ShareBasedCompensation_576" use="optional" order="18" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsIssuedInPeriodIntrinsicValue" xlink:label="loc_mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsIssuedInPeriodIntrinsicValue_575" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsIssuedInPeriodIntrinsicValue_575" use="optional" order="19" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_561" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_561" use="optional" order="20" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod_565" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod_565" use="optional" order="21" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_572" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_572" use="optional" order="22" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized_557" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized_557" use="optional" order="23" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant_563" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant_563" use="optional" order="24" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue_569" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue_569" use="optional" order="25" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodGross" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodGross_571" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodGross_571" use="optional" order="26" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingIntrinsicValue" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingIntrinsicValue_567" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingIntrinsicValue_567" use="optional" order="27" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingOrExercisedNumber" xlink:label="loc_mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingOrExercisedNumber_560" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingOrExercisedNumber_560" use="optional" order="28" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingAggregateIntrinsicValue" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingAggregateIntrinsicValue_568" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingAggregateIntrinsicValue_568" use="optional" order="29" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedInPeriodFairValue1" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedInPeriodFairValue1_570" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedInPeriodFairValue1_570" use="optional" order="30" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SharePrice" xlink:label="loc_us-gaap_SharePrice_566" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_SharePrice_566" use="optional" order="31" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation_426457" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation_426457" use="optional" order="32" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardSharesIssuedInPeriod" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardSharesIssuedInPeriod_656200" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardSharesIssuedInPeriod_656200" use="optional" order="33" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_656203" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_656203" use="optional" order="34" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_656204" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_656204" use="optional" order="35" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding_656216" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding_656216" use="optional" order="36" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate_656232" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate_656232" use="optional" order="37" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ShareBasedCompensationMaximumLimitOfContributionsTowardsPlanPerPerson" xlink:label="loc_mhh_ShareBasedCompensationMaximumLimitOfContributionsTowardsPlanPerPerson_656233" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_mhh_ShareBasedCompensationMaximumLimitOfContributionsTowardsPlanPerPerson_656233" use="optional" order="38" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ShareBasedCompensationPercentageOfDiscountToPurchaseOfCommonStock" xlink:label="loc_mhh_ShareBasedCompensationPercentageOfDiscountToPurchaseOfCommonStock_656235" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_mhh_ShareBasedCompensationPercentageOfDiscountToPurchaseOfCommonStock_656235" use="optional" order="39" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsMethodUsed" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsMethodUsed_656236" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsMethodUsed_656236" use="optional" order="40" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense_656242" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense_656242" use="optional" order="41" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions_656243" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions_656243" use="optional" order="42" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_656244" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_656244" use="optional" order="43" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions_656245" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_553" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions_656245" use="optional" order="44" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/StockBasedCompensationSummaryOfInformationRegardingTheCompanysOutstandingAndExercisableStockOptionsDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_599" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_599" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeAxis" xlink:label="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeAxis_601" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_599" xlink:to="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeAxis_601" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain" xlink:label="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_602" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeAxis_601" xlink:to="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_602" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain" xlink:label="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_602_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeAxis_601" xlink:to="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_602_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_RangeFourMember" xlink:label="loc_mhh_RangeFourMember_616" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_602" xlink:to="loc_mhh_RangeFourMember_616" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_RangeOneMember" xlink:label="loc_mhh_RangeOneMember_613" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_602" xlink:to="loc_mhh_RangeOneMember_613" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_RangeThreeMember" xlink:label="loc_mhh_RangeThreeMember_615" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_602" xlink:to="loc_mhh_RangeThreeMember_615" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_RangeTwoMember" xlink:label="loc_mhh_RangeTwoMember_614" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_602" xlink:to="loc_mhh_RangeTwoMember_614" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableExercisePricePerShareMaximum" xlink:label="loc_mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableExercisePricePerShareMaximum_610" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600" xlink:to="loc_mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableExercisePricePerShareMaximum_610" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableExercisePricePerShareMinimum" xlink:label="loc_mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableExercisePricePerShareMinimum_609" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600" xlink:to="loc_mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableExercisePricePerShareMinimum_609" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber_608" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber_608" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice_612" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice_612" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsExercisableWeightedAverageRemainingContractualTerm1" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsExercisableWeightedAverageRemainingContractualTerm1_611" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsExercisableWeightedAverageRemainingContractualTerm1_611" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber_603" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber_603" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice_607" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice_607" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2_606" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2_606" use="optional" order="16" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLowerRangeLimit" xlink:label="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLowerRangeLimit_604" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600" xlink:to="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLowerRangeLimit_604" use="optional" order="17" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeUpperRangeLimit" xlink:label="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeUpperRangeLimit_605" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600" xlink:to="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeUpperRangeLimit_605" use="optional" order="18" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/StockBasedCompensationSummaryOfMastechsRestrictedStockUnitActivityDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_628" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_627" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_628" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_627" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AwardTypeAxis" xlink:label="loc_us-gaap_AwardTypeAxis_626" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_627" xlink:to="loc_us-gaap_AwardTypeAxis_626" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_629" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_626" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_629" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_629_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_626" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_629_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RestrictedStockUnitsRSUMember" xlink:label="loc_us-gaap_RestrictedStockUnitsRSUMember_635" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_629" xlink:to="loc_us-gaap_RestrictedStockUnitsRSUMember_635" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_633" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_628" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_633" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_631" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_628" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_631" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_630" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_628" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_630" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsStockIssuedInPeriod" xlink:label="loc_mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsStockIssuedInPeriod_632" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_628" xlink:to="loc_mhh_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsStockIssuedInPeriod_632" use="optional" order="9" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/IncomeTaxesAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementLineItems" xlink:label="loc_us-gaap_StatementLineItems_857035" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementTable" xlink:label="loc_us-gaap_StatementTable_857032" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_857035" xlink:to="loc_us-gaap_StatementTable_857032" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_StatementGeographicalAxis" xlink:label="loc_srt_StatementGeographicalAxis_857040" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_857032" xlink:to="loc_srt_StatementGeographicalAxis_857040" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_SegmentGeographicalDomain" xlink:label="loc_srt_SegmentGeographicalDomain_857041" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementGeographicalAxis_857040" xlink:to="loc_srt_SegmentGeographicalDomain_857041" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_SegmentGeographicalDomain" xlink:label="loc_srt_SegmentGeographicalDomain_857041_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementGeographicalAxis_857040" xlink:to="loc_srt_SegmentGeographicalDomain_857041_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_DeferredTaxLiabilitiesValuationAllowance" xlink:label="loc_mhh_DeferredTaxLiabilitiesValuationAllowance_857046" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_857035" xlink:to="loc_mhh_DeferredTaxLiabilitiesValuationAllowance_857046" use="optional" order="5" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/DerivativeInstrumentsAndHedgingActivitiesAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeLineItems" xlink:label="loc_us-gaap_DerivativeLineItems_710" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeFixedInterestRate" xlink:label="loc_us-gaap_DerivativeFixedInterestRate_720" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_710" xlink:to="loc_us-gaap_DerivativeFixedInterestRate_720" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeInstrumentsGainLossReclassificationFromAccumulatedOCIToIncomeEstimatedNetAmountToBeTransferred" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossReclassificationFromAccumulatedOCIToIncomeEstimatedNetAmountToBeTransferred_722" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_710" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossReclassificationFromAccumulatedOCIToIncomeEstimatedNetAmountToBeTransferred_722" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeTable" xlink:label="loc_us-gaap_DerivativeTable_711" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativeLineItems_710" xlink:to="loc_us-gaap_DerivativeTable_711" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BalanceSheetLocationAxis" xlink:label="loc_us-gaap_BalanceSheetLocationAxis_706" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_711" xlink:to="loc_us-gaap_BalanceSheetLocationAxis_706" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BalanceSheetLocationDomain" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_707" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_706" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_707" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BalanceSheetLocationDomain" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_707_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_706" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_707_default" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherCurrentLiabilitiesMember" xlink:label="loc_us-gaap_OtherCurrentLiabilitiesMember_515657" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_707" xlink:to="loc_us-gaap_OtherCurrentLiabilitiesMember_515657" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeInstrumentRiskAxis" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_709" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_711" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_709" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeContractTypeDomain" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_708" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_709" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_708" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeContractTypeDomain" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_708_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_709" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_708_default" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ForeignExchangeForwardAndInterestRateSwapMember" xlink:label="loc_mhh_ForeignExchangeForwardAndInterestRateSwapMember_717" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_708" xlink:to="loc_mhh_ForeignExchangeForwardAndInterestRateSwapMember_717" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_InterestRateSwapMember" xlink:label="loc_us-gaap_InterestRateSwapMember_718" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_708" xlink:to="loc_us-gaap_InterestRateSwapMember_718" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FinancialInstrumentAxis" xlink:label="loc_us-gaap_FinancialInstrumentAxis_712" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_711" xlink:to="loc_us-gaap_FinancialInstrumentAxis_712" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_715" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_712" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_715" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_715_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_712" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_715_default" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_InterestRateRiskManagementMember" xlink:label="loc_mhh_InterestRateRiskManagementMember_724" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_715" xlink:to="loc_mhh_InterestRateRiskManagementMember_724" use="optional" order="16" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_HedgingDesignationAxis" xlink:label="loc_us-gaap_HedgingDesignationAxis_713" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_711" xlink:to="loc_us-gaap_HedgingDesignationAxis_713" use="optional" order="17" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_HedgingDesignationDomain" xlink:label="loc_us-gaap_HedgingDesignationDomain_714" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_713" xlink:to="loc_us-gaap_HedgingDesignationDomain_714" use="optional" order="18" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_HedgingDesignationDomain" xlink:label="loc_us-gaap_HedgingDesignationDomain_714_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_713" xlink:to="loc_us-gaap_HedgingDesignationDomain_714_default" use="optional" order="19" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DesignatedAsHedgingInstrumentMember" xlink:label="loc_us-gaap_DesignatedAsHedgingInstrumentMember_723" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_714" xlink:to="loc_us-gaap_DesignatedAsHedgingInstrumentMember_723" use="optional" order="20" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeNotionalAmount" xlink:label="loc_us-gaap_DerivativeNotionalAmount_719" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_710" xlink:to="loc_us-gaap_DerivativeNotionalAmount_719" use="optional" order="21" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure" xlink:label="loc_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure_515658" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_710" xlink:to="loc_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure_515658" use="optional" order="22" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/DerivativeInstrumentsAndHedgingActivitiesEffectOfDerivativeInstrumentsOnConsolidatedStatementsOfOperationsAndComprehensiveIncomeDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeInstrumentsGainLossLineItems" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossLineItems_731" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable_730" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossLineItems_731" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable_730" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeInstrumentRiskAxis" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_728" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable_730" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_728" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeContractTypeDomain" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_727" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_728" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_727" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeContractTypeDomain" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_727_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_728" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_727_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_InterestRateSwapMember" xlink:label="loc_us-gaap_InterestRateSwapMember_735" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_727" xlink:to="loc_us-gaap_InterestRateSwapMember_735" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_729" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable_730" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_729" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_HedgingRelationshipDomain" xlink:label="loc_us-gaap_HedgingRelationshipDomain_732" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_729" xlink:to="loc_us-gaap_HedgingRelationshipDomain_732" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_HedgingRelationshipDomain" xlink:label="loc_us-gaap_HedgingRelationshipDomain_732_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_729" xlink:to="loc_us-gaap_HedgingRelationshipDomain_732_default" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CashFlowHedgingMember" xlink:label="loc_us-gaap_CashFlowHedgingMember_739" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingRelationshipDomain_732" xlink:to="loc_us-gaap_CashFlowHedgingMember_739" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncomeStatementLocationAxis" xlink:label="loc_us-gaap_IncomeStatementLocationAxis_733" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable_730" xlink:to="loc_us-gaap_IncomeStatementLocationAxis_733" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncomeStatementLocationDomain" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_734" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_733" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_734" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncomeStatementLocationDomain" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_734_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_733" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_734_default" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_InterestExpenseMember" xlink:label="loc_us-gaap_InterestExpenseMember_740" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_734" xlink:to="loc_us-gaap_InterestExpenseMember_740" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeInstrumentsGainLossReclassifiedFromAccumulatedOCIIntoIncomeEffectivePortionNet" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossReclassifiedFromAccumulatedOCIIntoIncomeEffectivePortionNet_737" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossLineItems_731" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossReclassifiedFromAccumulatedOCIIntoIncomeEffectivePortionNet_737" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeInstrumentsGainLossRecognizedInIncomeIneffectivePortionAndAmountExcludedFromEffectivenessTestingNet" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossRecognizedInIncomeIneffectivePortionAndAmountExcludedFromEffectivenessTestingNet_738" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossLineItems_731" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossRecognizedInIncomeIneffectivePortionAndAmountExcludedFromEffectivenessTestingNet_738" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedGainLossOnDerivativesArisingDuringPeriodBeforeTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedGainLossOnDerivativesArisingDuringPeriodBeforeTax_736" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossLineItems_731" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedGainLossOnDerivativesArisingDuringPeriodBeforeTax_736" use="optional" order="16" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/DerivativeInstrumentsAndHedgingActivitiesInformationOnLocationAndAmountsOfDerivativeFairValuesInConsolidatedBalanceSheetsDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativesFairValueLineItems" xlink:label="loc_us-gaap_DerivativesFairValueLineItems_747" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable" xlink:label="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_748" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_747" xlink:to="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_748" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BalanceSheetLocationAxis" xlink:label="loc_us-gaap_BalanceSheetLocationAxis_743" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_748" xlink:to="loc_us-gaap_BalanceSheetLocationAxis_743" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BalanceSheetLocationDomain" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_744" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_743" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_744" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BalanceSheetLocationDomain" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_744_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_743" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_744_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherCurrentLiabilitiesMember" xlink:label="loc_us-gaap_OtherCurrentLiabilitiesMember_474695" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_744" xlink:to="loc_us-gaap_OtherCurrentLiabilitiesMember_474695" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeInstrumentRiskAxis" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_746" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_748" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_746" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeContractTypeDomain" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_745" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_746" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_745" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeContractTypeDomain" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_745_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_746" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_745_default" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_InterestRateSwapMember" xlink:label="loc_us-gaap_InterestRateSwapMember_750" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_745" xlink:to="loc_us-gaap_InterestRateSwapMember_750" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure" xlink:label="loc_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure_474691" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_747" xlink:to="loc_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure_474691" use="optional" order="10" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/ShareholdersEquityAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EquityClassOfTreasuryStockLineItems" xlink:label="loc_us-gaap_EquityClassOfTreasuryStockLineItems_756" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ClassOfTreasuryStockTable" xlink:label="loc_us-gaap_ClassOfTreasuryStockTable_754" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_756" xlink:to="loc_us-gaap_ClassOfTreasuryStockTable_754" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_CounterpartyNameAxis" xlink:label="loc_srt_CounterpartyNameAxis_755" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ClassOfTreasuryStockTable_754" xlink:to="loc_srt_CounterpartyNameAxis_755" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RepurchaseAgreementCounterpartyNameDomain" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_757" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_CounterpartyNameAxis_755" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_757" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_RepurchaseAgreementCounterpartyNameDomain" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_757_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_CounterpartyNameAxis_755" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_757_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SubsidiarySaleOfStockAxis" xlink:label="loc_us-gaap_SubsidiarySaleOfStockAxis_759" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ClassOfTreasuryStockTable_754" xlink:to="loc_us-gaap_SubsidiarySaleOfStockAxis_759" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SaleOfStockNameOfTransactionDomain" xlink:label="loc_us-gaap_SaleOfStockNameOfTransactionDomain_758" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_SubsidiarySaleOfStockAxis_759" xlink:to="loc_us-gaap_SaleOfStockNameOfTransactionDomain_758" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SaleOfStockNameOfTransactionDomain" xlink:label="loc_us-gaap_SaleOfStockNameOfTransactionDomain_758_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_SubsidiarySaleOfStockAxis_759" xlink:to="loc_us-gaap_SaleOfStockNameOfTransactionDomain_758_default" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EmployeeStockOwnershipPlanESOPWeightedAveragePurchasePriceOfSharesPurchased" xlink:label="loc_us-gaap_EmployeeStockOwnershipPlanESOPWeightedAveragePurchasePriceOfSharesPurchased_765" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_756" xlink:to="loc_us-gaap_EmployeeStockOwnershipPlanESOPWeightedAveragePurchasePriceOfSharesPurchased_765" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardSharesPurchasedForAward" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardSharesPurchasedForAward_764" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_756" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardSharesPurchasedForAward_764" use="optional" order="9" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/OtherComprehensiveIncomeLossSummaryOfAccumulatedOtherComprehensiveIncomeLossDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossTable" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossTable_656297" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossTable_656297" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementEquityComponentsAxis" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_656300" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossTable_656297" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_656300" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EquityComponentDomain" xlink:label="loc_us-gaap_EquityComponentDomain_656301" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_656300" xlink:to="loc_us-gaap_EquityComponentDomain_656301" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EquityComponentDomain" xlink:label="loc_us-gaap_EquityComponentDomain_656301_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_656300" xlink:to="loc_us-gaap_EquityComponentDomain_656301_default" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentNetOfTax" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentNetOfTax_656302" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentNetOfTax_656302" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationGainLossBeforeReclassificationAndTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationGainLossBeforeReclassificationAndTax_656303" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationGainLossBeforeReclassificationAndTax_656303" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationReclassificationAdjustmentFromAOCIRealizedUponSaleOrLiquidationBeforeTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationReclassificationAdjustmentFromAOCIRealizedUponSaleOrLiquidationBeforeTax_656304" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationReclassificationAdjustmentFromAOCIRealizedUponSaleOrLiquidationBeforeTax_656304" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentTax_656305" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentTax_656305" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AociLossCashFlowHedgeCumulativeGainLossAfterTax" xlink:label="loc_us-gaap_AociLossCashFlowHedgeCumulativeGainLossAfterTax_656311" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_AociLossCashFlowHedgeCumulativeGainLossAfterTax_656311" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAndTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAndTax_656313" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAndTax_656313" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossReclassificationBeforeTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossReclassificationBeforeTax_656314" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossReclassificationBeforeTax_656314" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationTax_656320" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationTax_656320" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_656325" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_656325" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_OtherComprehensiveIncomeGainLossArisingDuringThePeriodBeforeReclassificationAndTax" xlink:label="loc_mhh_OtherComprehensiveIncomeGainLossArisingDuringThePeriodBeforeReclassificationAndTax_656335" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_mhh_OtherComprehensiveIncomeGainLossArisingDuringThePeriodBeforeReclassificationAndTax_656335" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ReclassificationFromAociCurrentPeriodBeforeTaxAttributableToParent" xlink:label="loc_us-gaap_ReclassificationFromAociCurrentPeriodBeforeTaxAttributableToParent_656338" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_ReclassificationFromAociCurrentPeriodBeforeTaxAttributableToParent_656338" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossTax_656340" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossTax_656340" use="optional" order="16" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentBeforeTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentBeforeTax_656932" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentBeforeTax_656932" use="optional" order="17" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationAndTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationAndTax_656933" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationAndTax_656933" use="optional" order="18" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_656935" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_656299" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_656935" use="optional" order="19" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/FairValueMeasurementsAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_FairValueDisclosuresLineItems" xlink:label="loc_mhh_FairValueDisclosuresLineItems_808" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1_811" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_FairValueDisclosuresLineItems_808" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1_811" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_FairValueDisclosuresTable" xlink:label="loc_mhh_FairValueDisclosuresTable_809" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_mhh_FairValueDisclosuresLineItems_808" xlink:to="loc_mhh_FairValueDisclosuresTable_809" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAxis" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_807" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_mhh_FairValueDisclosuresTable_809" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_807" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_806" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_807" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_806" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_806_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_807" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_806_default" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_InfoTrellisIncMember" xlink:label="loc_mhh_InfoTrellisIncMember_810" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_806" xlink:to="loc_mhh_InfoTrellisIncMember_810" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_AmberLeafMember" xlink:label="loc_mhh_AmberLeafMember_858188" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_806" xlink:to="loc_mhh_AmberLeafMember_858188" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationLiability" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_858187" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_mhh_FairValueDisclosuresLineItems_808" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_858187" use="optional" order="8" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/FairValueMeasurementsSummaryOfFinancialAssetsLiabilitiesAtFairValueMeasuredOnRecurringBasisDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_792" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationLiability" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_800" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_792" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_800" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_793" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_792" xlink:to="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_793" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeInstrumentRiskAxis" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_791" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_793" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_791" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeContractTypeDomain" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_790" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_791" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_790" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeContractTypeDomain" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_790_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_791" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_790_default" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_InterestRateSwapMember" xlink:label="loc_us-gaap_InterestRateSwapMember_798" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_790" xlink:to="loc_us-gaap_InterestRateSwapMember_798" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_794" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_793" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_794" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_797" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_794" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_797" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_797_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_794" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_797_default" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FairValueInputsLevel2Member" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_802" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_797" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_802" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FairValueInputsLevel3Member" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_803" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_797" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_803" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FairValueByMeasurementFrequencyAxis" xlink:label="loc_us-gaap_FairValueByMeasurementFrequencyAxis_795" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_793" xlink:to="loc_us-gaap_FairValueByMeasurementFrequencyAxis_795" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FairValueMeasurementFrequencyDomain" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_796" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_795" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_796" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FairValueMeasurementFrequencyDomain" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_796_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_795" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_796_default" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure" xlink:label="loc_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure_474692" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_792" xlink:to="loc_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure_474692" use="optional" order="15" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/BusinessSegmentsAndGeographicInformationAdditionalInformationDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentReportingInformationLineItems" xlink:label="loc_us-gaap_SegmentReportingInformationLineItems_842" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessAcquisitionEffectiveDateOfAcquisition1" xlink:label="loc_us-gaap_BusinessAcquisitionEffectiveDateOfAcquisition1_846" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_842" xlink:to="loc_us-gaap_BusinessAcquisitionEffectiveDateOfAcquisition1_846" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NumberOfReportableSegments" xlink:label="loc_us-gaap_NumberOfReportableSegments_845" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_842" xlink:to="loc_us-gaap_NumberOfReportableSegments_845" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:label="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_840" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_842" xlink:to="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_840" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementBusinessSegmentsAxis" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_843" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_840" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_843" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_841" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_843" xlink:to="loc_us-gaap_SegmentDomain_841" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_841_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_843" xlink:to="loc_us-gaap_SegmentDomain_841_default" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_DataAndAnalyticsServicesMember" xlink:label="loc_mhh_DataAndAnalyticsServicesMember_844" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_841" xlink:to="loc_mhh_DataAndAnalyticsServicesMember_844" use="optional" order="7" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/BusinessSegmentsAndGeographicInformationSummaryOfOperatingSegmentsDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentReportingInformationLineItems" xlink:label="loc_us-gaap_SegmentReportingInformationLineItems_853" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AmortizationOfIntangibleAssets" xlink:label="loc_us-gaap_AmortizationOfIntangibleAssets_861" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_853" xlink:to="loc_us-gaap_AmortizationOfIntangibleAssets_861" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_GrossMarginPercentage" xlink:label="loc_mhh_GrossMarginPercentage_859" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_853" xlink:to="loc_mhh_GrossMarginPercentage_859" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_866" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_853" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_866" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_InterestExpensesAndOtherNet" xlink:label="loc_mhh_InterestExpensesAndOtherNet_865" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_853" xlink:to="loc_mhh_InterestExpensesAndOtherNet_865" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingIncomeLoss" xlink:label="loc_us-gaap_OperatingIncomeLoss_860" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_853" xlink:to="loc_us-gaap_OperatingIncomeLoss_860" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Revenues" xlink:label="loc_us-gaap_Revenues_858" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_853" xlink:to="loc_us-gaap_Revenues_858" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:label="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_851" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_853" xlink:to="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_851" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_ConsolidationItemsAxis" xlink:label="loc_srt_ConsolidationItemsAxis_849" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_851" xlink:to="loc_srt_ConsolidationItemsAxis_849" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_ConsolidationItemsDomain" xlink:label="loc_srt_ConsolidationItemsDomain_850" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_849" xlink:to="loc_srt_ConsolidationItemsDomain_850" use="optional" order="9" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_ConsolidationItemsDomain" xlink:label="loc_srt_ConsolidationItemsDomain_850_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_849" xlink:to="loc_srt_ConsolidationItemsDomain_850_default" use="optional" order="10" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingSegmentsMember" xlink:label="loc_us-gaap_OperatingSegmentsMember_855" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_850" xlink:to="loc_us-gaap_OperatingSegmentsMember_855" use="optional" order="11" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementBusinessSegmentsAxis" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_854" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_851" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_854" use="optional" order="12" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_852" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_854" xlink:to="loc_us-gaap_SegmentDomain_852" use="optional" order="13" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_852_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_854" xlink:to="loc_us-gaap_SegmentDomain_852_default" use="optional" order="14" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_DataAndAnalyticsServicesMember" xlink:label="loc_mhh_DataAndAnalyticsServicesMember_856" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_852" xlink:to="loc_mhh_DataAndAnalyticsServicesMember_856" use="optional" order="15" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ITStaffingServicesMember" xlink:label="loc_mhh_ITStaffingServicesMember_857" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_852" xlink:to="loc_mhh_ITStaffingServicesMember_857" use="optional" order="16" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1_466575" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_853" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1_466575" use="optional" order="17" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_GoodwillImpairmentLoss" xlink:label="loc_us-gaap_GoodwillImpairmentLoss_466576" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_853" xlink:to="loc_us-gaap_GoodwillImpairmentLoss_466576" use="optional" order="18" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_BusinessCombinationAcquisitionRelatedCosts" xlink:label="loc_us-gaap_BusinessCombinationAcquisitionRelatedCosts_466577" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_853" xlink:to="loc_us-gaap_BusinessCombinationAcquisitionRelatedCosts_466577" use="optional" order="19" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/BusinessSegmentsAndGeographicInformationSummaryOfAssetsBySegmentDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentReportingAssetReconcilingItemLineItems" xlink:label="loc_us-gaap_SegmentReportingAssetReconcilingItemLineItems_871" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Assets" xlink:label="loc_us-gaap_Assets_875" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingAssetReconcilingItemLineItems_871" xlink:to="loc_us-gaap_Assets_875" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_PaymentsAndCapitalExpendituresIncurredButNotYetPaidToAcquirePropertyPlantAndEquipment" xlink:label="loc_mhh_PaymentsAndCapitalExpendituresIncurredButNotYetPaidToAcquirePropertyPlantAndEquipment_877" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingAssetReconcilingItemLineItems_871" xlink:to="loc_mhh_PaymentsAndCapitalExpendituresIncurredButNotYetPaidToAcquirePropertyPlantAndEquipment_877" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ReconciliationOfAssetsFromSegmentToConsolidatedTable" xlink:label="loc_us-gaap_ReconciliationOfAssetsFromSegmentToConsolidatedTable_869" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SegmentReportingAssetReconcilingItemLineItems_871" xlink:to="loc_us-gaap_ReconciliationOfAssetsFromSegmentToConsolidatedTable_869" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StatementBusinessSegmentsAxis" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_872" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ReconciliationOfAssetsFromSegmentToConsolidatedTable_869" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_872" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_870" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_872" xlink:to="loc_us-gaap_SegmentDomain_870" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentDomain" xlink:label="loc_us-gaap_SegmentDomain_870_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_872" xlink:to="loc_us-gaap_SegmentDomain_870_default" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_DataAndAnalyticsServicesMember" xlink:label="loc_mhh_DataAndAnalyticsServicesMember_873" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_870" xlink:to="loc_mhh_DataAndAnalyticsServicesMember_873" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_ITStaffingServicesMember" xlink:label="loc_mhh_ITStaffingServicesMember_874" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_870" xlink:to="loc_mhh_ITStaffingServicesMember_874" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DepreciationAmortizationAndAccretionNet" xlink:label="loc_us-gaap_DepreciationAmortizationAndAccretionNet_655497" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingAssetReconcilingItemLineItems_871" xlink:to="loc_us-gaap_DepreciationAmortizationAndAccretionNet_655497" use="optional" order="9" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/BusinessSegmentsAndGeographicInformationSummaryOfRevenueFromExternalCustomersDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SegmentReportingInformationLineItems" xlink:label="loc_us-gaap_SegmentReportingInformationLineItems_882" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_888" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_882" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_888" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Revenues" xlink:label="loc_us-gaap_Revenues_887" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_882" xlink:to="loc_us-gaap_Revenues_887" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:label="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_880" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_882" xlink:to="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_880" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_StatementGeographicalAxis" xlink:label="loc_srt_StatementGeographicalAxis_883" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_880" xlink:to="loc_srt_StatementGeographicalAxis_883" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_SegmentGeographicalDomain" xlink:label="loc_srt_SegmentGeographicalDomain_881" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementGeographicalAxis_883" xlink:to="loc_srt_SegmentGeographicalDomain_881" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_SegmentGeographicalDomain" xlink:label="loc_srt_SegmentGeographicalDomain_881_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementGeographicalAxis_883" xlink:to="loc_srt_SegmentGeographicalDomain_881_default" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/country/2020/country-2020-01-31.xsd#country_CA" xlink:label="loc_country_CA_885" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_881" xlink:to="loc_country_CA_885" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="mhh-20201231.xsd#mhh_IndiaAndOtherMember" xlink:label="loc_mhh_IndiaAndOtherMember_886" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_881" xlink:to="loc_mhh_IndiaAndOtherMember_886" use="optional" order="8" />
<loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/country/2020/country-2020-01-31.xsd#country_US" xlink:label="loc_country_US_884" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_881" xlink:to="loc_country_US_884" use="optional" order="9" />
</definitionLink>
<definitionLink xlink:type="extended" xlink:role="http://www.mastech.com/role/ScheduleIiValuationAndQualifyingAccountsDetail">
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:label="loc_srt_ValuationAndQualifyingAccountsDisclosureLineItems_893" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ValuationAllowancesAndReservesBalance" xlink:label="loc_us-gaap_ValuationAllowancesAndReservesBalance_896" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ValuationAndQualifyingAccountsDisclosureLineItems_893" xlink:to="loc_us-gaap_ValuationAllowancesAndReservesBalance_896" use="optional" order="1" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense" xlink:label="loc_us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense_897" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ValuationAndQualifyingAccountsDisclosureLineItems_893" xlink:to="loc_us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense_897" use="optional" order="2" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ValuationAllowancesAndReservesAdjustments" xlink:label="loc_us-gaap_ValuationAllowancesAndReservesAdjustments_898" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ValuationAndQualifyingAccountsDisclosureLineItems_893" xlink:to="loc_us-gaap_ValuationAllowancesAndReservesAdjustments_898" use="optional" order="3" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/srt/2020/elts/srt-2020-01-31.xsd#srt_ValuationAndQualifyingAccountsDisclosureTable" xlink:label="loc_srt_ValuationAndQualifyingAccountsDisclosureTable_894" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_srt_ValuationAndQualifyingAccountsDisclosureLineItems_893" xlink:to="loc_srt_ValuationAndQualifyingAccountsDisclosureTable_894" xbrldt:contextElement="segment" xbrldt:closed="true" use="optional" order="4" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:label="loc_us-gaap_ValuationAllowancesAndReservesTypeAxis_892" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_srt_ValuationAndQualifyingAccountsDisclosureTable_894" xlink:to="loc_us-gaap_ValuationAllowancesAndReservesTypeAxis_892" use="optional" order="5" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ValuationAllowancesAndReservesDomain" xlink:label="loc_us-gaap_ValuationAllowancesAndReservesDomain_891" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ValuationAllowancesAndReservesTypeAxis_892" xlink:to="loc_us-gaap_ValuationAllowancesAndReservesDomain_891" use="optional" order="6" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ValuationAllowancesAndReservesDomain" xlink:label="loc_us-gaap_ValuationAllowancesAndReservesDomain_891_default" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ValuationAllowancesAndReservesTypeAxis_892" xlink:to="loc_us-gaap_ValuationAllowancesAndReservesDomain_891_default" use="optional" order="7" />
<loc xlink:type="locator" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AllowanceForCreditLossMember" xlink:label="loc_us-gaap_AllowanceForCreditLossMember_895" />
<definitionArc xlink:type="arc" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ValuationAllowancesAndReservesDomain_891" xlink:to="loc_us-gaap_AllowanceForCreditLossMember_895" use="optional" order="8" />
</definitionLink>
</linkbase>
