Skip to content

Instantly share code, notes, and snippets.

@aprofromindia
aprofromindia / RestClient.swift
Last active December 12, 2019 21:55
Rest Client in Swift for iOS, Mac OS apps.
//
// RestClient.swift
//
// Created by Apro on 02/12/19.
//
import Foundation
class RestClient {
private static let postMethod = "POST"
@aprofromindia
aprofromindia / FHIR App.md
Last active June 25, 2019 13:00
Export Health data through FHIR

Please develop the following Mobile app in the platform of your choice : -

  • please develop the app using VIPER architecture (must have)
  • export an users health data using FHIR data format (nice to have).
  • for iOS please use Apple Health/Google Fit repo.
  • for Android please use Google Fit.
  • A team can choose its platform of choice (independent of its current competency - iOS, Android, RN, Flutter, Phonegap, Xamarin).
  • We plan to have a discussion at the end of the task to share and learn from each implementation.
@aprofromindia
aprofromindia / JacksonConfig.java
Created October 7, 2018 22:07
Spring Jackson Java 8 Date Time Config
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
class JacksonConfig {
@Bean
Module dateTimeModule() {
return new JavaTimeModule();
@aprofromindia
aprofromindia / Mobile Pokemon Coding Task.md
Last active January 4, 2019 15:20
Mobile Pokemon Coding Challenge

iOS/Android/React Native Mobile Developer Coding Task

Many thanks for investing the time in interviewing with us. For the next step we would like you to create a Pokemon App (iOS/Android/React Native app) to display an initial list of Pokemons with a further list showing a list of Pokemons evolved from the initial Pokemon. Please submit the code for the specific platform your were asked to in the interview. For React Native candidates, please note since we use a type system in all of our projects, we would prefer if you use Typescript/flow to finish the challenge.

Please follow the following guidelines while developing : -

  • Pokemon is a imaginary animal from the Pokemon video game, generally Pokemons evolve into new species as time evolves.
  • Please use the Poke API v2 to fetch an initial list of pokemons and its various properties (plea
@aprofromindia
aprofromindia / Sample.java
Last active July 5, 2018 12:51
Flatten a multi level array
List<Integer> flatten(final List<?> arrays) {
final List<Integer> result = new ArrayList<>();
flattenRecursive(arrays, 0, result);
return result;
}
private void flattenRecursive(List<?> arrays, int index, List<Integer> result) {
if (arrays.get(index) instanceof List<?>) {
flattenRecursive((List<?>) arrays.get(index), index, result);
} else if (arrays.get(index) instanceof Integer) {
@aprofromindia
aprofromindia / Image Search Mobile Coding Task.md
Last active January 18, 2018 14:27
Google Image Search Mobile Coding Task

iOS/Android Mobile Developer Coding Task

Many thanks for investing the time in interviewing with us. For the next step we would like you to create a Google Image Search mobile client (iOS/Android app) to display an infini-scroll Image list based on a user's search input.

Please follow the following guidelines while developing : -

  • Please use the Google Image Search API for searching and fetching relevant images.
  • Please refrain from using any additional 3rd party APIs (e.g. Alamofire, Retrofit, RxJava etc...) except for the iOS or Google Android SDK, as required.
  • Please focus on proper code structure and applying OOP and/or SOLID coding principles as and when applicable.
  • Please don't spend too much time on producing a snazzy UI; we are more interested in your coding competency.
  • Ideally you shouldn't spend more than 4 hours to finish this task.
  • Please ensure you submit the task within 7 working days fro
@aprofromindia
aprofromindia / Mobile Coding Task.md
Last active August 29, 2018 21:29
iOS/Android Coding Task

iOS/Android/React Native Mobile Developer Coding Task

Many thanks for investing the time in interviewing with us. For the next step we would like you to create a Twitter mobile client (iOS/Android/React Native app) to display the 50 most trending topics around a users' current location.

Please submit the code for the specific platform your were asked to in the interview.

Please follow the following guidelines while developing : -

  • Please use the Twitter Trends API to fetch the relevant trends data.
  • Please refrain from using any additional 3rd party APIs (e.g. Alamofire, Retrofit, RxJava etc...) except for the iOS or Google Android SDK, as required.
  • Please focus on proper code structure and applying OOP and/or SOLID coding principles as and when applicable.
  • Please don't spend too much time on producing a snazzy UI; we are more interested in your coding competency.
@aprofromindia
aprofromindia / StringUtils.java
Created July 20, 2017 17:36
Generic String Utils collection
package com.github.aprofromindia.utils;
import javax.validation.constraints.NotNull;
public class StringUtils {
public static String capitalize(@NotNull String string) {
StringBuilder builder = new StringBuilder();
if (string.length() > 0) {
builder.append(string.substring(0, 1).toUpperCase());
}
@aprofromindia
aprofromindia / wild.md
Created May 19, 2017 14:11
Wild Card Mobile Architecture proposal

Please find my solution below:

  1. I propose to use an MVVM based application architecture.
  2. for iOS I would recommend data binding (View to ViewModel) using RxSwift for a sample implementation by myself click here.
  3. for Android I would propose Data Binding with my own helper library. Rest of the document would only focus on an iOS solution.
  4. As for code organisation, we can use an use-case based folder grouping.
  5. We should also separate our classes into Entities, Domain Services, Application Services, Repositories and Network layer.
  6. the RESTClient should be a singleton, sample [implementation here](https://github.com/aprofromindia/Yahoo-Weather/blob/master/Yahoo%20Weather/RE
@aprofromindia
aprofromindia / Collection.swift
Last active January 29, 2017 11:58
Collection extension for Binary search
extension Collection where Self.Iterator.Element: Comparable {
func binarySearch(element: Iterator.Element) -> Index {
var low = startIndex, high = index(startIndex, offsetBy: count - 1)
while low <= high {
let i = index(low, offsetBy: distance(from: low, to: high)/2)
if self[i] == element {
return i