ibrolord

Security Coding Ques

Apr 16th, 2025 (edited)
215
0
Never
10
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.50 KB | None | 0 0
  1. ## ✅ HIGH-FIDELITY PREP AREAS (IN PRIORITY ORDER)
  2.  
  3. ---
  4.  
  5. ### 1. 🧠 **Log Parsing / Real-world Scripting**
  6.  
  7. > _“Write a script that parses logs and extracts X, or correlates logs A + B to find Y.”_
  8.  
  9. **Why it's high-fidelity**:
  10. This tests your **Python fluency**, **real-world thinking**, and **security awareness**.
  11.  
  12. **Practice:**
  13. - Parse Apache/Nginx logs and extract: IPs, timestamps, paths, status
  14. - Correlate two logs using hashmap of lists
  15. - Clean up dirty JSON or split a malformed CSV
  16. - Defang/Refang IPs
  17. - Detect anomalies or brute-force attempts
  18.  
  19. ---
  20.  
  21. ### 2. 🧰 **LeetCode Easy/Medium (Security-Flavored)**
  22.  
  23. > _“Use dict/set/stack to solve this problem.”_
  24.  
  25. **Why**: Meta wants to know if you can **code competently**, not CS Olympics.
  26.  
  27. **High-fidelity set:**
  28. - ✅ Group Anagrams
  29. - ✅ Two Sum
  30. - ✅ Valid Palindrome (with punctuation)
  31. - ✅ Top K Frequent
  32. - ✅ Simplify Path
  33. - ✅ Valid IP Address
  34. - ✅ Binary to Decimal
  35. - ✅ Balance Parentheses
  36. - ✅ Caesar Cipher
  37. - ✅ Count frequencies, return top N
  38. - ✅ Merge logs based on timestamp
  39. - ✅ Add two numbers as strings
  40.  
  41. ---
  42.  
  43. ### 3. 🔐 **Security Logic + Implementation**
  44.  
  45. > _“Write a Caesar cipher” or “Bruteforce a password file”_
  46.  
  47. **Why**: Shows **security awareness** in real-world scripting contexts.
  48.  
  49. **Practice:**
  50. - Caesar/ROT13/substitution cipher
  51. - Password bruteforce logic
  52. - SSH botnet architecture (high-level design)
  53. - Scan open ports on localhost
  54. - Look for malware indicators in a binary string (Yara-like logic)
  55. - Parse PDF metadata manually
  56.  
  57. ---
  58.  
  59. ### 4. 🌐 **System Design with Security Focus**
  60.  
  61. > _“Design a scalable bot detection system”_
  62.  
  63. **Why**: Especially for IC5+ or system integration roles, this is key.
  64.  
  65. **What to know:**
  66. - PKI / TLS / cert validation
  67. - DLP vs EDR vs MDM tradeoffs
  68. - Scaling log ingestion and alerting
  69. - Designing secure API interactions
  70. - OAuth / token validation / abuse patterns
  71. - Secure file transfer, data retention, access control
  72.  
  73. ---
  74.  
  75. ### 5. 🧪 **Regex, File IO, APIs**
  76.  
  77. > _“Extract all domains from a text file and hit an API for each”_
  78.  
  79. **Why**: Scripting + real-world glue.
  80.  
  81. **Practice:**
  82. - Extract IPs, domains, emails using regex
  83. - Read from file, write JSON result
  84. - Call a REST API and parse response
  85. - Clean malformed inputs (e.g., trailing whitespace, escaped chars)
  86.  
  87. ---
  88.  
  89. ### Bonus: 🧱 **Build these for practice**
  90.  
  91. | Mini Project | What it reinforces |
  92. |----------------------------------|-------------------------------------|
  93. | Apache log parser | File + string + dicts |
  94. | Top K frequent from a file | dict + sort |
  95. | Palindrome sanitizer | stack + regex + punctuation logic |
  96. | PDF metadata scraper | file parsing + data cleaning |
  97. | Bruteforce login simulation | string gen + nested loops + control |
  98.  
  99. ---
  100.  
  101. ## TL;DR – High-Fidelity Prep =
  102.  
  103. | Category | Focus |
  104. |------------------------|--------------------------------------------|
  105. | Python scripting | Logs, files, strings, regex |
  106. | Easy/Medium LC | dict/set/stack-based problems |
  107. | Real-world sec logic | Cipher, metadata, bruteforce, signatures |
  108. | Security system design | TLS, auth, detection, log flow |
  109. | Practical tools | Regex, APIs, file handling |
  110.  
  111. ---
  112.  
  113. Want me to create a **weekly schedule** where you rotate through each of these categories + mock exercises for each?
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123. Cyphers / encryption algorithms
  124.  
  125. Implement a cypher which converts text to emoji or something.
  126. Be able to implement basic cyphers.
  127. Parse arbitrary logs
  128.  
  129. Collect logs (of any kind) and write a parser which pulls out specific details (domains, executable names, timestamps etc.)
  130. Web scrapers
  131.  
  132. Write a script to scrape information from a website.
  133. Port scanners
  134.  
  135. Write a port scanner or detect port scanning.
  136. Botnets
  137.  
  138. How would you build ssh botnet?
  139. Password bruteforcer
  140.  
  141. Generate credentials and store successful logins.
  142. Scrape metadata from PDFs
  143.  
  144. Write a mini forensics tool to collect identifying information from PDF metadata.
  145. Recover deleted items
  146.  
  147. Most software will keep deleted items for ~30 days for recovery. Find out where these are stored.
  148. Write a script to pull these items from local databases.
  149. Malware signatures
  150.  
  151. A program that looks for malware signatures in binaries and code samples.
  152. Look at Yara rules for examples.
  153.  
  154.  
  155. https://docs.google.com/spreadsheets/d/1IrTAb2-4zxcDc1t9snG2ls8nIo3PNiA4wh5VaqF8HGA/edit?gid=0#gid=0
  156.  
  157. Parse timestamp and IP from apache log files
  158. —Correlate data from 2 separate logs, parse and store them using hashmap of lists so you can look it up in O(1) time later
  159. —Count frequency of words that appear in a text
  160. —Make API calls using requests and write tests for your methods
  161. —Write a caesar cipher
  162. —Leetcode easy string manipulation questions
  163. —Leetcode medium string problems involving a stack
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Amazon
  171. jinchika
  172. 3d
  173.  
  174. 1. Start practicing problems from here: https://neetcode.io/practice?tab=blind75
  175. [Only the Easy and Mediums till Stack section should be sufficient mostly]
  176. 2. Then practice problems from here: https://leetcode.com/company/facebook/?favoriteSlug=facebook-six-months [Sort by frequently asked in last 6 months]. Again focus only on Easy and Medium from Arrays&Hashmaps, Sliding window, Two pointers and Stack categories.
  177.  
  178. Meta is known for asking the same facebook-tagged questions in leetcode.
  179.  
  180. I am not from Meta but interviewed there for security engineer position before. I followed above and was able to solve one medium in phone screen and two mediums in onsite coding round (all questions were from facebook-tagged leetcode ones)
  181.  
  182.  
  183. Palindromes, two sum, IP validation, caeser cipher, that kind of stuff
  184.  
  185. 1
  186. Reply
  187.  
  188. Fastly
  189. cYuN72
  190. Yesterday
  191.  
  192. Nothing crazy. I was asked to write code to validate an ip address ipv4; validate a url
  193.  
  194.  
  195. Domain specific question (security), leetcode easy (not meta tagged), behavioural and some sql. All reasonable, just not a lot of time, you have to move fast bc this is all in 45 minutes. Moved on to the final stage
  196.  
  197. I went through the process. I had questions around graph theory, traversal problem in coding round
  198.  
  199.  
  200. It was for infra sec role. Other rounds were around building distributed security systems, analysis process and behavioral
  201.  
  202.  
  203. Building scalable bot detection solution, how to detect ssl certs issued to domains similar to fb, malware detection process, sql queries on detecting badness from logs
  204.  
  205.  
  206. Easy mediums, mostly focused on string manipulation combined with file handling, use of dicts/sets for indexing, etc.
  207.  
  208.  
  209. Fb recruiters does a good job of providing everything you need to prepare for this role. Range of topics with less difficulty compared to other companies (even Amazon). If >=L5 System design only comes with prior experience I assume especially security focused design so ymmv
  210.  
  211.  
  212. The question i got asked: code to output binary to decimal conversion
  213.  
  214. Also got asked: check if IP address is in the correct format
  215.  
  216. Data analysis is focusing on the different types of data you will encounter including logs, metadata, user data etc and how to use that data to understand the security environment.
  217.  
  218.  
  219. Had to write code that would identify a palindrome, need to account for special characters. “Taco, cat” would be considered one, print the actual palindrome.
  220.  
  221.  
  222. You can expect scripting questions like parsing the logs and building logic over it, defang IP, and enrichment of data set.
  223.  
  224.  
  225. 2 medium lc questions
  226.  
  227.  
  228. Depends in which team, Prod sec vs Corp sec, etc. In general, know SSL / TLS, PKI, practical encryption, OWASP Top 10, strong Linux skills (including bash pipelines for text processing), strong scripting skills (e.g. Python), secure architecture. If a prod sec position add code auditing and some real SWE experience. If Corp sec add MDM, DLP, EDR, and infrastructure experience.
  229.  
  230.  
  231.  
  232. My screening was super easy..it was log parsing and splitting the string (I don't consider this LC). I have the onsite next. Any folks with experience if the technical is similar to the technical? The recruiter talked about the system design portion, but I am wondering if it is the typical SWE system design (design a URL shortener, messenger, etc). Any insights into this?
  233.  
  234.  
  235.  
  236. I got an interview call from Meta for Security Engineer - System integration role. What kind of questions can I expect?
  237. 1st round: Software security and threat modelling
  238. 2n round: Scripting, System Design, Software secuirty questions
  239.  
  240.  
  241. 71. Simplify Path variant
  242.  
  243.  
  244. System design was design Leetcode (ironic eh) and security interview was a strange scenario based on PCI and iframes…
  245.  
  246.  
  247. process is stupid, applying for appsec role should require coding related with bruteforcing, parsing api responses and stuff like that, not playing with effing arrays. We have docs and stackoverflow for that
  248.  
  249.  
  250. Are you a sec eng rn? LC is like url parsing. Basically if youre good at SWE LC you only need to prep little for sec eng LC
  251.  
  252.  
  253. I interviewed for meta for a security engineer and there was a coding portion. Had to write a script to identify palindromes but words with spaces and special characters need to be accounted for.
  254.  
  255.  
  256.  
  257. You’ll go through a series of interviews where they will test how good you are at writing code that works, for that, LeetCode 75 is the obvious thing to study.
  258.  
  259. Then, “find the bug” exercises. There will be multiple of them so be smart and be fast, speak clearly and don’t waste precious time saying dumb shit. If you don’t know, you don’t know.
  260.  
  261. Then, secure system design. They’ll present a short list of requirements to build a feature or system and you talk through the process with an emphasis on security.
  262.  
  263. Depending on the interviewer, you may also get some “hack this shit” type of question(s).
  264.  
  265.  
  266.  
  267. Looking at my notes I got LC easy-ish questions like balance parens, 3sum, and sum two binary numbers given as strings
  268.  
  269.  
  270. Google security engineer has scripting questions mostly, on stuff like regex. Onsite may have 1 - 2 LC rounds.
  271. Software security engineer is the same as software engineer with one security round onsite
  272.  
  273.  
  274. Yes, there is a coding round, but it's more like a scripting round, leetcode easy. They just want to make sure you can code and hold your own in technical conversations with engineers.
  275.  
  276. Level is determined by your yoe and interview performance.
  277.  
  278. Ask your recruiter for the interview guide to help get an idea of what the interviews are like.
  279.  
  280.  
  281. You will be asked to obtain root access to a python web server with 4 other candidates and a crowd of people screaming at you. Every 10 lines of code, you will need to take a shot. And every 15 minutes, you will need to take a shot.
  282.  
  283.  
  284. Not FB but I had 2 scripting questions with Google for new grad security engineer. One was to parse some structured data from logs (so be familiar with python and JSON, dicts, files, etc). The other was to implement addition of two strings of integers - solution("1", "2")="3" . Both were pretty trivial and took under 15 mins; FB might have something similar to just know you can code.
  285.  
  286.  
  287. Even people that code every single day I doubt can just do 30 questions and be able to pass. Blind 75 is already more than that. For me it took at least 100+ to start getting the pattern recognition and solving random questions down
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Odqadsy
    37 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • Nordalgu
    22 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=trfoxutwjc
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment