ZZomato·BehavioralL1Machine Coding

Imperative vs Declarative Programming

viaLeetCode

Question: What is the difference between imperative and declarative programming?

Expected discussion: Imperative programming describes how to achieve a result via explicit step-by-step statements and control flow (loops, mutation). Declarative programming describes what result is wanted, leaving the "how" to the underlying engine/runtime (e.g. SQL queries, React JSX, functional map/filter/reduce). React itself is often cited as declarative UI programming layered on an imperative DOM API.

Add a follow-up question they asked
No follow-ups yet. Be the first to add one.
asked …
LeaderboardSalary
Language
Account