Margaret began her elected service as a Trustee for Area 1 on the Santa Clara County Board of Education and served as Board Vice-President in 2004. She was then elected to the Mountain View City Council in 2006. She served as Vice-Mayor in 2008 and 2019, and as Mayor for the first time in 2009, making her the first Asian American female to serve in those capacities in Mountain View's history. She served a second term as Mayor in 2020 during the COVID-19 pandemic. She was re-elected in 2020 and served a total of four terms.
For her leadership, Margaret has been recognized with various awards including:
- Working Partnerships USA Champion for Change 2014
- South Bay Labor Council AFL-CIO Rookie of the Year Award 2011
- Silicon Valley Business Journal's Top 100 Women of Influence, 2010
- Mountain View Chamber of Commerce Athena Award, 2010
- Association of American University Women Los Altos Mountain View Chapter's Woman of the Year 2009
- California Assembly's Woman of the Year for Assembly District 22, selected by Assemblymember Paul Fong, 2009
- Silicon Valley Business Journal's Top 40 under 40 years of age, 2008
- Asian Americans for Community Involvement Youth Achievement Award 2004
- Santa Clara County Supervisor Liz Kniss' Asian American Hero Award, 2001