This is a commonly asked interview question in automation testing, especially related to Selenium. Below, I am providing the sequence of execution for TestNG annotations in a test.
1st in execution sequence -@BeforeSuite
2nd – @BeforeTest
3rd – @BeforeClass
4th – @BeforeMethod
5th – @Test
6th – @AfterMethod
7th – @AfterClass
8th- @AfterTest
last in execution- @AfterSuite