- This is an entry test for our ZaloPay candidates
- He/she must write solutions in English to answer following problems
- Code must be written in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fill(array, pos, count = 0): | |
max_count = len(array) / 2 | |
if pos >= len(array ): | |
if count == 0: | |
print array | |
return | |
label = { | |
1: '{', | |
-1: '}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint32_t counter = 0; | |
uint32_t& get_counter(){ | |
return counter; | |
} | |
int main(){ | |
uint32_t _counter = get_counter(); | |
_counter += 1; | |
cout << _counter << endl; // print 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <atomic> | |
#include <iostream> | |
#include <thread> | |
#include <stdint.h> | |
using namespace std; | |
void run_in_pool(std::function<void() > routine, uint8_t max_thread = 4) { | |
std::thread modifiers[max_thread]; | |
uint8_t i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/stat.h> | |
#include <atomic> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <assert.h> | |
#include <map> | |
#include <iostream> | |
#include <string.h> | |
#include <thread> | |
#include "lock/RwLock.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define Data_T(type) template <typename T> type Data<T> | |
template<typename T> | |
class Data { | |
private: | |
T _data; | |
public: | |
Data(T data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PropTypes } from "react"; | |
import { Scrollbars } from "react-custom-scrollbars"; | |
import ResponsiveComponent from "../responsive"; | |
export default class Card extends ResponsiveComponent { | |
render() { | |
const { | |
header, | |
children, | |
raised, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generic interface for a method of transporting data. A TTransport may be | |
* capable of either reading or writing, but not necessarily both. | |
* | |
*/ | |
class TTransport { | |
/** | |
* Attempt to read up to the specified number of bytes into the string. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
#bar { | |
background-color: #eee; | |
height: 600px; | |
width: 300px; | |
display: flex; | |
flex-direction: column; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>vn.zalopay.algo</groupId> | |
<artifactId>cache</artifactId> | |
<version>0.1.0</version> |