Skip to content

Instantly share code, notes, and snippets.

@magicdude4eva
Last active November 27, 2021 11:45
Show Gist options
  • Save magicdude4eva/c85c753a6aa13bde8f7d41b8133e774c to your computer and use it in GitHub Desktop.
Save magicdude4eva/c85c753a6aa13bde8f7d41b8133e774c to your computer and use it in GitHub Desktop.
Bidorbuy Java test

Programming example - Write an app:

  • For Java tests create a Tomcat/Webapp project using Eclipse and then write a simple search/display results app using JSPs.
  • For Android / iOS native apps use the respective development IDEs (Android Studio or XCode)
  • Email back the completed project (it should be importable into the IDE and just run)
  • There is no limit to creativity/what you use. The code should however follow a MVC pattern and have abstraction/separation of concerns (i.e. network logic should not be part of presentation logic)

The service to call for this exercise is the Paginated Trade Search service. It is a RESTful GET service you will call with HTTP parameters to retrieve the results you want. For authentication to the service you will add HTTP headers to your request.

First things first, each call you make to our demo service requires the following HTTP headers:

  • Name: X-BOB-AUTHID / Value: {PROVIDED IN EMAIL}
  • Name: X-BOB-PLATFORM / Value: 4
  • Name: X-BOB-CID / Value: 987654321

The service information is as follows:

Path: https://demo.bidorbuy.co.za/services/v3/tradesearch

Params:

  • resultsPerPage - Number of results to retrieve, default is 25
  • pageNumber - The page to retrieve, default is 1
  • IncludedKeywords - String of keywords to search on, can be empty *Condition - A string of either NEW, SECOND_HAND or REFURBISHED corresponding to items set as new, second hand or refurbished respectively
  • TradeType - A string of either ENGLISH_AUCTION, FIXED_PRICE or CLASSIFIED_CONTACT corresponding to items being Auctions, Buy Nows or Classifieds
  • OrderBy - A string for how results will be ordered. Left out will give default ordering, otherwise the values Price, Ending, Opening, BidCount and Title are accepted.

The result of the call will be an JSON object that consists of a list of trade objects. These are the trades that fit your search request and are what needs to be displayed. An example is below result:

{
  "totalResults": 1673675,
  "pageNumber": 1,
  "resultsPerPage": 25,
  "trade": [
    {
      "images": [
        {
          "image": "http://img.bidorbuy.co.za/image/upload/v1475092439/user_images/380/137380/160928215353_2016-09-28%2021.25.04.jpg",
          "thumbnail": "http://a3.tbn.bidorbuy.co.za/image/fetch/dpr_1.0,f_auto,(t_tbn_trans)/http://img.bidorbuy.co.za/image/upload/v1475092439/user_images/380/137380/160928215353_2016-09-28%2021.25.04.jpg"
        }
      ],
      "amount": 32000,
      "title": "*** PREMIUM GRADE TANZANITE *** 5.06CT CERTIFIED TANZANITE",
      "type": "FIXED_PRICE",
      "userId": 137380,
      "hotSelling": false,
      "categoryBreadCrumb": "Gemstones & Rocks/Tanzanites",
      "userAlias": "TANZANITE SA",
      "closeTime": "2016-12-08T18:15:00+02:00",
      "homeCategoryId": 2729,
      "location": "Cape Town",
      "openTime": "2016-11-06T18:15:00+02:00",
      "tradeId": 253316627,
      "status": "OPEN"
    },

For the exercise, only the ability to search on keywords, using the IncludedKeywords parameter, is necessary.

Bonus point would be to add a Condition and/or TradeType filter, using the parameters and their values to filter the trades.

Android test requirements

Develop the app in Android Studio and provide a complete project file with source-code. The test should ideally be completed within 1-2 days, but feel free to go as far as you wish with regards to the UI/UX.

Basic UX/UI requirements:

  • Demonstrate Android Architecture components (Any of them them, eg, LiveData, ViewModel, etc)
  • Demonstrate: ConstraintLayout, DataBinding
  • Android APK with start screen containing a search field
  • Search returns a list of products and displays thumbnail, title etc
  • (Optional) Demonstrate infinite scroll
  • (Optional) Handle network connectivity issues
  • (Optional) Demonstrate layout switch (landscape / portrait)
@magicdude4eva
Copy link
Author

magicdude4eva commented Dec 29, 2019

Donations are always welcome

🍺 Please support me: If the above helped you in any way, then follow me on Twitter or send me some coins:

(CRO)    cro1w2kvwrzp23aq54n3amwav4yy4a9ahq2kz2wtmj (Memo: 644996249) or 0xb83c3Fe378F5224fAdD7a0f8a7dD33a6C96C422C (Cronos)
(USDC)   0xb83c3Fe378F5224fAdD7a0f8a7dD33a6C96C422C
(BTC)    3628nqihXvw2RXsKtTR36dN6WvYzaHyr52
(ETH)    0xb83c3Fe378F5224fAdD7a0f8a7dD33a6C96C422C
(BAT)    0xb83c3Fe378F5224fAdD7a0f8a7dD33a6C96C422C
(LTC)    MQxRAfhVU84KDVUqnZ5eV9MGyyaBEcQeDf
(Ripple) rKV8HEL3vLc6q9waTiJcewdRdSFyx67QFb (Tag: 1172047832)
(XLM)    GB67TJFJO3GUA432EJ4JTODHFYSBTM44P4XQCDOFTXJNNPV2UKUJYVBF (Memo ID: 1406379394)

Go to Curve.com to add your Crypto.com card to ApplePay and signup to Crypto.com for a staking and free Crypto debit card.

Use Binance Exchange to trade #altcoins. Sign up with Coinbase and instantly get $10 in BTC. I also accept old-school PayPal.

If you have no crypto, follow me at least on Twitter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment