Gain Solutions interview question

They asked me to explain the difference between getServerSideProps and getStaticProps in Next.js, including when to use each and how they improve performance and data fetching strategies.