Skip to content

Instantly share code, notes, and snippets.

@saurabh2590
Last active June 5, 2018 07:16
Show Gist options
  • Save saurabh2590/8acf1f6a52c3b998e840f329361fed73 to your computer and use it in GitHub Desktop.
Save saurabh2590/8acf1f6a52c3b998e840f329361fed73 to your computer and use it in GitHub Desktop.
Problem statement
  • Write a ReactComponent, which displays the (x, y) values in a table.
    • Assume, the values are provided by API in redux store, implying that they are available initialState. The value for x and y are calculated as follow:
      • x : any random number between 1-10
      • y : random combination of x characters from [a-z,A-Z].
      • Example: [{x: 3, y: 'aie'}, {x: 7, y: 'Zaqopkl'}, {x: 4, y: 'ASDU'}]
    • Implement the following functionality on table:
      • When clicked on the column header, values are sorted first incrementally, and each click then toggles the sort order.
    • If have time, then write tests for the code we created. (If prefers test driven approach and can start with TDD.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment