﻿<?xml version="1.0" encoding="utf-8"?>
<InstanceReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Version>2.2.0.7</Version>
  <hasSegments>false</hasSegments>
  <ReportName>Commitments and Contingencies</ReportName>
  <ReportLongName>0210 - Disclosure - Commitments and Contingencies</ReportLongName>
  <DisplayLabelColumn>true</DisplayLabelColumn>
  <ShowElementNames>false</ShowElementNames>
  <RoundingOption />
  <HasEmbeddedReports>false</HasEmbeddedReports>
  <Columns>
    <Column>
      <LabelColumn>false</LabelColumn>
      <Id>1</Id>
      <Labels>
        <Label Id="1" Label="6 Months Ended" />
        <Label Id="2" Label="Jul. 02, 2010" />
      </Labels>
      <CurrencyCode>USD</CurrencyCode>
      <FootnoteIndexer />
      <hasSegments>false</hasSegments>
      <hasScenarios>false</hasScenarios>
      <Segments />
      <Scenarios />
      <Units>
        <Unit>
          <UnitID>USD</UnitID>
          <UnitType>Standard</UnitType>
          <StandardMeasure>
            <MeasureSchema>http://www.xbrl.org/2003/iso4217</MeasureSchema>
            <MeasureValue>USD</MeasureValue>
            <MeasureNamespace>iso4217</MeasureNamespace>
          </StandardMeasure>
          <Scale>0</Scale>
        </Unit>
        <Unit>
          <UnitID>Pure</UnitID>
          <UnitType>Standard</UnitType>
          <StandardMeasure>
            <MeasureSchema>http://www.xbrl.org/2003/instance</MeasureSchema>
            <MeasureValue>pure</MeasureValue>
            <MeasureNamespace>xbrli</MeasureNamespace>
          </StandardMeasure>
          <Scale>0</Scale>
        </Unit>
        <Unit>
          <UnitID>USDEPS</UnitID>
          <UnitType>Divide</UnitType>
          <NumeratorMeasure>
            <MeasureSchema>http://www.xbrl.org/2003/iso4217</MeasureSchema>
            <MeasureValue>USD</MeasureValue>
            <MeasureNamespace>iso4217</MeasureNamespace>
          </NumeratorMeasure>
          <DenominatorMeasure>
            <MeasureSchema>http://www.xbrl.org/2003/instance</MeasureSchema>
            <MeasureValue>shares</MeasureValue>
            <MeasureNamespace>xbrli</MeasureNamespace>
          </DenominatorMeasure>
          <Scale>0</Scale>
        </Unit>
        <Unit>
          <UnitID>Shares</UnitID>
          <UnitType>Standard</UnitType>
          <StandardMeasure>
            <MeasureSchema>http://www.xbrl.org/2003/instance</MeasureSchema>
            <MeasureValue>shares</MeasureValue>
            <MeasureNamespace>xbrli</MeasureNamespace>
          </StandardMeasure>
          <Scale>0</Scale>
        </Unit>
      </Units>
      <CurrencySymbol>$</CurrencySymbol>
    </Column>
  </Columns>
  <Rows>
    <Row>
      <Id>2</Id>
      <Label>Commitments and Contingencies [Abstract]</Label>
      <Level>0</Level>
      <ElementName>altr_CommitmentsAndContingenciesAbstract</ElementName>
      <ElementPrefix>altr</ElementPrefix>
      <IsBaseElement>false</IsBaseElement>
      <BalanceType>na</BalanceType>
      <PeriodType>duration</PeriodType>
      <ShortDefinition>Commitments and Contingencies.</ShortDefinition>
      <IsReportTitle>false</IsReportTitle>
      <IsSegmentTitle>false</IsSegmentTitle>
      <IsSubReportEnd>false</IsSubReportEnd>
      <IsCalendarTitle>false</IsCalendarTitle>
      <IsTuple>false</IsTuple>
      <IsAbstractGroupTitle>true</IsAbstractGroupTitle>
      <IsEquityPrevioslyReportedAsRow>false</IsEquityPrevioslyReportedAsRow>
      <IsEquityAdjustmentRow>false</IsEquityAdjustmentRow>
      <IsBeginningBalance>false</IsBeginningBalance>
      <IsEndingBalance>false</IsEndingBalance>
      <IsReverseSign>false</IsReverseSign>
      <PreferredLabelRole />
      <IsEPS>false</IsEPS>
      <FootnoteIndexer />
      <Cells>
        <Cell>
          <Id>1</Id>
          <ShowCurrencySymbol>false</ShowCurrencySymbol>
          <IsNumeric>false</IsNumeric>
          <IsRatio>false</IsRatio>
          <DisplayZeroAsNone>false</DisplayZeroAsNone>
          <NumericAmount>0</NumericAmount>
          <RoundedNumericAmount>0</RoundedNumericAmount>
          <NonNumbericText />
          <NonNumericTextHeader />
          <FootnoteIndexer />
          <hasSegments>false</hasSegments>
          <hasScenarios>false</hasScenarios>
          <DisplayDateInUSFormat>false</DisplayDateInUSFormat>
        </Cell>
      </Cells>
      <OriginalInstanceReportColumns />
      <ElementDataType>xbrli:stringItemType</ElementDataType>
      <SimpleDataType>string</SimpleDataType>
      <ElementDefenition>Commitments and Contingencies.</ElementDefenition>
      <IsTotalLabel>false</IsTotalLabel>
    </Row>
    <Row>
      <Id>3</Id>
      <Label>Commitments and Contingencies</Label>
      <Level>1</Level>
      <ElementName>us-gaap_CommitmentsAndContingenciesDisclosureTextBlock</ElementName>
      <ElementPrefix>us-gaap</ElementPrefix>
      <IsBaseElement>true</IsBaseElement>
      <BalanceType>na</BalanceType>
      <PeriodType>duration</PeriodType>
      <ShortDefinition>No definition available.</ShortDefinition>
      <IsReportTitle>false</IsReportTitle>
      <IsSegmentTitle>false</IsSegmentTitle>
      <IsSubReportEnd>false</IsSubReportEnd>
      <IsCalendarTitle>false</IsCalendarTitle>
      <IsTuple>false</IsTuple>
      <IsAbstractGroupTitle>false</IsAbstractGroupTitle>
      <IsEquityPrevioslyReportedAsRow>false</IsEquityPrevioslyReportedAsRow>
      <IsEquityAdjustmentRow>false</IsEquityAdjustmentRow>
      <IsBeginningBalance>false</IsBeginningBalance>
      <IsEndingBalance>false</IsEndingBalance>
      <IsReverseSign>false</IsReverseSign>
      <PreferredLabelRole>verboselabel</PreferredLabelRole>
      <IsEPS>false</IsEPS>
      <FootnoteIndexer />
      <Cells>
        <Cell>
          <Id>1</Id>
          <ShowCurrencySymbol>false</ShowCurrencySymbol>
          <IsNumeric>false</IsNumeric>
          <IsRatio>false</IsRatio>
          <DisplayZeroAsNone>false</DisplayZeroAsNone>
          <NumericAmount>0</NumericAmount>
          <RoundedNumericAmount>0</RoundedNumericAmount>
          <NonNumbericText>&lt;!--DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" --&gt;
   &lt;!-- Begin Block Tagged Note 10 - us-gaap:CommitmentsAndContingenciesDisclosureTextBlock--&gt;
   &lt;div style="font-family: 'Times New Roman',Times,serif; margin-left: 0in; "&gt;
   &lt;div align="justify" style="font-size: 10pt; margin-top: 10pt"&gt;&lt;b&gt;Note 10 &amp;#8212; Commitments and Contingencies&lt;/b&gt;
   &lt;/div&gt;
   &lt;div align="justify" style="font-size: 10pt; margin-top: 10pt"&gt;&lt;b&gt;Indemnification and Product Warranty&lt;/b&gt;
   &lt;/div&gt;
   &lt;div align="justify" style="font-size: 10pt; margin-top: 10pt; text-indent: 4%"&gt;We indemnify certain customers, distributors, suppliers, and subcontractors for attorney&amp;#8217;s
   fees and damages and costs awarded against these parties in certain circumstances in which our
   products are alleged to infringe third party intellectual property rights including patents, trade
   secrets, trademarks, or copyrights. We cannot estimate the amount of potential future payments, if
   any, that we might be required to make as a result of these agreements. To date, we have not paid
   any claim or been required to defend any action related to our indemnification obligations, and
   accordingly, we have not accrued any amounts for such indemnification obligations. However, we may
   record charges in the future as a result of these indemnification obligations.
   &lt;/div&gt;
   &lt;!-- Folio --&gt;
   &lt;!-- /Folio --&gt;
   &lt;/div&gt;
   &lt;!-- PAGEBREAK --&gt;
   &lt;div style="font-family: 'Times New Roman',Times,serif; margin-left: 0in; "&gt;
   &lt;div align="justify" style="font-size: 10pt; margin-top: 10pt; text-indent: 4%"&gt;We generally warrant our devices for one year, against defects in materials, workmanship and
   material non-conformance to our specifications. We accrue for known warranty issues if a loss is
   probable and can be reasonably estimated, and accrue for estimated but unidentified issues based on
   historical activity. If there is a material increase in customer claims compared with our
   historical experience or if the costs of servicing warranty claims are greater than expected, we
   may record a charge against cost of sales.
   &lt;/div&gt;
   &lt;div align="justify" style="font-size: 10pt; margin-top: 10pt"&gt;&lt;b&gt;Purchase Obligations&lt;/b&gt;
   &lt;/div&gt;
   &lt;div align="justify" style="font-size: 10pt; margin-top: 10pt; text-indent: 4%"&gt;We depend entirely upon subcontractors to manufacture our silicon wafers and provide assembly
   and test services. Due to lengthy subcontractor lead times, we must order these materials and
   services from these subcontractors well in advance, and we are obligated to pay for the materials
   and services once they are completed. As of July&amp;#160;2, 2010, we had approximately $235.9&amp;#160;million of
   outstanding purchase commitments to such subcontractors. We expect to receive and pay for these
   materials and services over the next six months.
   &lt;/div&gt;
   &lt;div align="justify" style="font-size: 10pt; margin-top: 10pt"&gt;&lt;b&gt;Legal Proceedings&lt;/b&gt;
   &lt;/div&gt;
   &lt;div align="justify" style="font-size: 10pt; margin-top: 10pt; text-indent: 4%"&gt;We are named as a party to a lawsuit concerning our historical stock option practices and
   related accounting and reporting.
   &lt;/div&gt;
   &lt;div align="justify" style="font-size: 10pt; margin-top: 10pt; text-indent: 4%"&gt;In May and July&amp;#160;2006, we were notified that three shareholder derivative lawsuits had been
   filed in the Superior Court of the State of California, County of Santa Clara, by persons
   identifying themselves as Altera shareholders and purporting to act on behalf of Altera, naming
   Altera Corporation as a nominal defendant and naming some of our current and former officers and
   directors as defendants. On July&amp;#160;12, 2006, one of these derivative actions was voluntarily
   dismissed by the plaintiff shareholder. The remaining two derivative lawsuits pending in Santa
   Clara Superior Court were consolidated into a single action on September&amp;#160;5, 2006. Plaintiffs filed
   a second amended consolidated complaint on December&amp;#160;15, 2006. On January&amp;#160;30, 2007, Altera and the
   defendants filed a motion to stay this action pending resolution of the federal derivative action
   (discussed below). On February&amp;#160;11, 2009, one of the remaining derivative plaintiffs voluntarily
   dismissed his derivative claims and, on March&amp;#160;20, 2009, the other remaining derivative plaintiff
   filed a third amended complaint. In June&amp;#160;2009, Altera and the defendants demurred to the third
   amended complaint. After the court issued a tentative ruling in favor of Altera, the parties agreed
   to stay the action in order to allow plaintiff to serve a demand on Altera&amp;#8217;s board of directors.
   The plaintiff served the demand on November&amp;#160;4, 2009. In the first quarter of 2010, the board of
   directors completed its review of the demand and decided to reject the plantiff&amp;#8217;s demand. On June
   1, 2010, the plaintiff filed a fourth amended complaint, alleging that the board of director&amp;#8217;s
   decision to reject plaintiff&amp;#8217;s demand was wrongful. On July&amp;#160;15, 2010, Altera
   demurred to the fourth amended complaint.
   &lt;/div&gt;
   &lt;div align="justify" style="font-size: 10pt; margin-top: 10pt; text-indent: 4%"&gt;Plaintiff asserts claims against the individual defendants for breach of fiduciary duty, waste
   of corporate assets, unjust enrichment, violations of California Corporation Code section 25402,
   breach of fiduciary duty for insider selling and misappropriation of information, and deceit.
   Plaintiff&amp;#8217;s claims concern the granting of stock options by Altera between 1994 and 2001 and the
   alleged filing of false and misleading financial statements between 1994 and 2006. All of these
   claims are asserted derivatively on behalf of Altera. Plaintiff seeks, among other relief, an
   indeterminate amount of damages from the individual defendants and a judgment directing Altera to
   reform its corporate governance practices.
   &lt;/div&gt;
   &lt;div align="justify" style="font-size: 10pt; margin-top: 10pt; text-indent: 4%"&gt;During the months of May, June, and July&amp;#160;2006, four other derivative lawsuits were filed by
   purported Altera shareholders, on behalf of Altera, in the United States District Court for the
   Northern District of California. On August&amp;#160;8, 2006, these actions were consolidated, and the
   plaintiffs filed a consolidated complaint on November&amp;#160;30, 2006. On September&amp;#160;15, 2008, the
   plaintiffs voluntarily agreed to dismiss the case. On September&amp;#160;18, 2008, the court entered an
   order dismissing the case.
   &lt;/div&gt;
   &lt;/div&gt;
</NonNumbericText>
          <NonNumericTextHeader>&lt;!--DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" --&gt;
   &lt;!-- Begin Block Tagged Note</NonNumericTextHeader>
          <FootnoteIndexer />
          <hasSegments>false</hasSegments>
          <hasScenarios>false</hasScenarios>
          <DisplayDateInUSFormat>false</DisplayDateInUSFormat>
        </Cell>
      </Cells>
      <OriginalInstanceReportColumns />
      <ElementDataType>us-types:textBlockItemType</ElementDataType>
      <SimpleDataType>textblock</SimpleDataType>
      <ElementDefenition>Includes disclosure of commitments and contingencies. This element may be used as a single block of text to encapsulate the entire disclosure including data and tables.</ElementDefenition>
      <ElementReferences>Reference 1: http://www.xbrl.org/2003/role/presentationRef
 -Publisher FASB
 -Name FASB Interpretation (FIN)
 -Number 14
 -Paragraph 3

Reference 2: http://www.xbrl.org/2003/role/presentationRef
 -Publisher FASB
 -Name Statement of Financial Accounting Standard (FAS)
 -Number 5
 -Paragraph 9, 10, 11, 12

</ElementReferences>
      <IsTotalLabel>false</IsTotalLabel>
    </Row>
  </Rows>
  <Footnotes />
  <NumberOfCols>1</NumberOfCols>
  <NumberOfRows>2</NumberOfRows>
  <HasScenarios>false</HasScenarios>
  <MonetaryRoundingLevel>UnKnown</MonetaryRoundingLevel>
  <SharesRoundingLevel>UnKnown</SharesRoundingLevel>
  <PerShareRoundingLevel>UnKnown</PerShareRoundingLevel>
  <HasPureData>false</HasPureData>
  <SharesShouldBeRounded>true</SharesShouldBeRounded>
</InstanceReport>
